bug 2174: m_rWnd not updated when segments without ACK are received
authorNatale Patriciello <natale.patriciello@gmail.com>
Thu, 03 Sep 2015 21:20:53 -0700
changeset 11633 6b74df04cf44
parent 11632 88d6e64c778c
child 11634 99173c0ad09b
bug 2174: m_rWnd not updated when segments without ACK are received
src/internet/model/tcp-socket-base.cc
--- a/src/internet/model/tcp-socket-base.cc	Thu Sep 03 21:12:22 2015 -0700
+++ b/src/internet/model/tcp-socket-base.cc	Thu Sep 03 21:20:53 2015 -0700
@@ -1048,6 +1048,14 @@
     {
       UpdateWindowSize (tcpHeader);
     }
+  else if (tcpHeader.GetFlags () & TcpHeader::SYN)
+    {
+      /* The window field in a segment where the SYN bit is set (i.e., a <SYN>
+       * or <SYN,ACK>) MUST NOT be scaled (from RFC 7323 page 9). But should be
+       * saved anyway..
+       */
+      m_rWnd = tcpHeader.GetWindowSize ();
+    }
 
   // TCP state machine code in different process functions
   // C.f.: tcp_rcv_state_process() in tcp_input.c in Linux kernel