calculate send scale factor when sending the SYN-ACK instead of when reading the SYN options
authorTom Henderson <tomh@tomh.org>
Wed, 10 Sep 2014 15:08:30 -0700
changeset 10912 4734ff3dd909
parent 10911 c224a92a02a2
child 10913 b3f7c37b0be7
calculate send scale factor when sending the SYN-ACK instead of when reading the SYN options
src/internet/model/tcp-socket-base.cc
--- a/src/internet/model/tcp-socket-base.cc	Wed Sep 10 15:06:10 2014 -0700
+++ b/src/internet/model/tcp-socket-base.cc	Wed Sep 10 15:08:30 2014 -0700
@@ -1666,8 +1666,8 @@
       header.SetSourcePort (m_endPoint6->GetLocalPort ());
       header.SetDestinationPort (m_endPoint6->GetPeerPort ());
     }
+  AddOptions (header);
   header.SetWindowSize (AdvertisedWindowSize ());
-  AddOptions (header);
   m_rto = m_rtt->RetransmitTimeout ();
   bool hasSyn = flags & TcpHeader::SYN;
   bool hasFin = flags & TcpHeader::FIN;
@@ -2548,8 +2548,6 @@
       m_rcvScaleFactor = 14;
     }
 
-  m_sndScaleFactor = CalculateWScale ();
-
   NS_LOG_INFO (m_node->GetId () << " Received a scale factor of " <<
                  static_cast<int> (m_rcvScaleFactor));
 }