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

Submitter:  Ambroz Bizjak <abizjak>
Submitted:  Sun 27 Nov 2016 07:01:49 PM UTC
   
 
Category:  TCP Severity:  3 - Normal
Item Group:  Faulty Behaviour Status:  Fixed
Privacy:  Public Assigned to:  goldsimon
Open/Closed:  Closed Planned 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>
Group administrator
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>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-11-28 goldsimon CategoryNone TCP
        StatusNone Fixed
        Assigned toNone goldsimon
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code