diff --git a/src/internet/model/tcp-socket-base.cc b/src/internet/model/tcp-socket-base.cc index fc1805253..84eef8052 100644 --- a/src/internet/model/tcp-socket-base.cc +++ b/src/internet/model/tcp-socket-base.cc @@ -1166,8 +1166,6 @@ TcpSocketBase::DoForwardUp (Ptr packet, const Address &fromAddress, m_rxTrace (packet, tcpHeader, this); - ReadOptions (tcpHeader); - if (tcpHeader.GetFlags () & TcpHeader::SYN) { /* The window field in a segment where the SYN bit is set (i.e., a @@ -1176,6 +1174,15 @@ TcpSocketBase::DoForwardUp (Ptr packet, const Address &fromAddress, */ m_rWnd = tcpHeader.GetWindowSize (); + if (tcpHeader.HasOption (TcpOption::WINSCALE) && m_winScalingEnabled) + { + ProcessOptionWScale (tcpHeader.GetOption (TcpOption::WINSCALE)); + } + else + { + m_winScalingEnabled = false; + } + // When receiving a or we should adapt TS to the other end if (tcpHeader.HasOption (TcpOption::TS) && m_timestampEnabled) { @@ -3104,26 +3111,6 @@ TcpSocketBase::GetAllowBroadcast (void) const return false; } -void -TcpSocketBase::ReadOptions (const TcpHeader& header) -{ - NS_LOG_FUNCTION (this << header); - - if ((header.GetFlags () & TcpHeader::SYN)) - { - if (m_winScalingEnabled) - { - m_winScalingEnabled = false; - - if (header.HasOption (TcpOption::WINSCALE)) - { - m_winScalingEnabled = true; - ProcessOptionWScale (header.GetOption (TcpOption::WINSCALE)); - } - } - } -} - void TcpSocketBase::AddOptions (TcpHeader& header) { diff --git a/src/internet/model/tcp-socket-base.h b/src/internet/model/tcp-socket-base.h index d5ae8b8fd..87eeae48c 100644 --- a/src/internet/model/tcp-socket-base.h +++ b/src/internet/model/tcp-socket-base.h @@ -824,20 +824,6 @@ protected: */ virtual void DoRetransmit (void); - /** - * \brief Read TCP options from incoming packets - * - * This method sequentially checks each kind of option, and if it - * is present in the header, starts its processing. - * - * To deal with hosts which don't have the option enabled (or - * implemented) we disable all options, and then re-enable them - * if in the packet there is the option itself. - * - * \param tcpHeader the packet's TCP header - */ - virtual void ReadOptions (const TcpHeader& tcpHeader); - /** \brief Add options to TcpHeader * * Test each option, and if it is enabled on our side, add it