[BUG 2068] Window scale moved in DoForwardUp method

This commit is contained in:
Natale Patriciello
2016-01-22 16:18:47 +01:00
parent d17168bc7e
commit 315f1fa74a
2 changed files with 9 additions and 36 deletions

View File

@@ -1166,8 +1166,6 @@ TcpSocketBase::DoForwardUp (Ptr<Packet> 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 <SYN>
@@ -1176,6 +1174,15 @@ TcpSocketBase::DoForwardUp (Ptr<Packet> 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 <SYN> or <SYN-ACK> 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)
{

View File

@@ -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