buglwIP - A Lightweight TCP/IP stack - Bugs: bug #49717, Window size in received SYN and...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #49717: Window size in received SYN and SYN-ACK assumed scaled but is not

Submitted by:  Ambroz Bizjak <abizjak>
Submitted on:  Sun 27 Nov 2016 07:01:49 PM UTC  
 
Category: TCPSeverity: 3 - Normal
Item Group: Faulty BehaviourStatus: Fixed
Privacy: PublicAssigned to: Simon Goldschmidt <goldsimon>
Open/Closed: ClosedPlanned Release: None
lwIP version: git head

Mon 28 Nov 2016 09:30:31 AM UTC, comment #3:

Re comment #2:
If we did that, passive open could only send 1 byte at first.

The original but report is correct, though. Fixed by not scaling in SYN segments.

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Sun 27 Nov 2016 07:39:25 PM UTC, comment #2:

RFC 793 specifies updating SND.WND only when receiving an ACK while already in ESTABLISHED or SYN-RCVD state (page 72). So I suggest that lwIP set snd_wnd to 1 when the SYN is received ignoring the window size in the segment.

Ambroz Bizjak <abizjak>
Sun 27 Nov 2016 07:29:38 PM UTC, comment #1:

Also I find it strange that lwIP even looks at the window size in a received SYN (not SYN-ACK) segment, because it won't send any real data until the transition from SYN_RCVD to ESTABLISHED.

Looks like lwIP will even accept a zero window size in the SYN in which case it would never send the SYN-ACK but start sending window probes.

Ambroz Bizjak <abizjak>
Sun 27 Nov 2016 07:01:49 PM UTC, original submission:

From looking at the code I believe lwIP incorrectly interprets the window size values in received SYN and SYN-ACK segments.

RFC 7323 states:

"The window field in a segment where the SYN bit is set (i.e., a <SYN> or <SYN,ACK>) MUST NOT be scaled."

In the code this is in tcp_in.c lines 605 (SYN) 754 (SYN-ACK). In both cases pcb->snd_wnd is set to SND_WND_SCALE(pcb, tcphdr->wnd) after tcp_parseopt is called which would have set pcb->snd_scale if the window scale option is present.

Ambroz Bizjak <abizjak>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by goldsimon (Posted a comment)
  • -unavailable- added by abizjak (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 28 Nov 2016 09:30:31 AM UTCgoldsimonCategoryNone=>TCP
      StatusNone=>Fixed
      Assigned toNone=>goldsimon
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1