tcp: Add assert to check if TCP sends out-of-window data

This commit is contained in:
Xiuchao Wu
2020-06-14 11:56:57 -07:00
committed by Tom Henderson
parent c9b96134b1
commit 07d89d3bfa

View File

@@ -2929,6 +2929,10 @@ TcpSocketBase::SendDataPacket (SequenceNumber32 seq, uint32_t maxSize, bool with
uint8_t flags = withAck ? TcpHeader::ACK : 0;
uint32_t remainingData = m_txBuffer->SizeFromSequence (seq + SequenceNumber32 (sz));
// TCP sender should not send data out of the window advertised by the
// peer when it is not retransmission.
NS_ASSERT (isRetransmission || ((m_highRxAckMark + SequenceNumber32 (m_rWnd)) >= (seq + SequenceNumber32 (maxSize))));
if (m_tcb->m_pacing)
{
NS_LOG_INFO ("Pacing is enabled");