internet: call NotifyConnectionFailed on SYN timeout

Fixes https://gitlab.com/nsnam/ns-3-dev/issues/76
This commit is contained in:
Alexander Krotov
2019-08-08 18:39:35 +03:00
committed by Tom Henderson
parent 68bb36d5fa
commit 1b79d59968

View File

@@ -2577,7 +2577,9 @@ TcpSocketBase::SendEmptyPacket (uint8_t flags)
{ // No more connection retries, give up
NS_LOG_LOGIC ("Connection failed.");
m_rtt->Reset (); //According to recommendation -> RFC 6298
CloseAndNotify ();
NotifyConnectionFailed ();
m_state = CLOSED;
DeallocateEndPoint ();
return;
}
else
@@ -3479,21 +3481,14 @@ TcpSocketBase::ReTxTimeout ()
if (m_state == SYN_SENT)
{
if (m_synCount > 0)
NS_ASSERT (m_synCount > 0);
if (m_tcb->m_useEcn == TcpSocketState::On)
{
if (m_tcb->m_useEcn != TcpSocketState::Off)
{
SendEmptyPacket (TcpHeader::SYN | TcpHeader::ECE | TcpHeader::CWR);
}
else
{
SendEmptyPacket (TcpHeader::SYN);
}
m_tcb->m_ecnState = TcpSocketState::ECN_DISABLED;
SendEmptyPacket (TcpHeader::SYN | TcpHeader::ECE | TcpHeader::CWR);
}
else
{
NotifyConnectionFailed ();
SendEmptyPacket (TcpHeader::SYN);
}
return;
}