tcp_input: Don't put back sndseq on an old ack

This commit is contained in:
YAMAMOTO Takashi
2021-07-27 13:55:04 +09:00
committed by Xiang Xiao
parent e53f989997
commit b815a2c3a8
+10 -5
View File
@@ -582,6 +582,7 @@ found:
{ {
uint32_t unackseq; uint32_t unackseq;
uint32_t ackseq; uint32_t ackseq;
uint32_t sndseq;
/* The next sequence number is equal to the current sequence /* The next sequence number is equal to the current sequence
* number (sndseq) plus the size of the outstanding, unacknowledged * number (sndseq) plus the size of the outstanding, unacknowledged
@@ -639,11 +640,15 @@ found:
* be beyond ackseq. * be beyond ackseq.
*/ */
ninfo("sndseq: %08" PRIx32 "->%08" PRIx32 sndseq = tcp_getsequence(conn->sndseq);
" unackseq: %08" PRIx32 " new tx_unacked: %" PRId32 "\n", if (TCP_SEQ_LT(sndseq, ackseq))
tcp_getsequence(conn->sndseq), ackseq, unackseq, {
(uint32_t)conn->tx_unacked); ninfo("sndseq: %08" PRIx32 "->%08" PRIx32
tcp_setsequence(conn->sndseq, ackseq); " unackseq: %08" PRIx32 " new tx_unacked: %" PRId32 "\n",
tcp_getsequence(conn->sndseq), ackseq, unackseq,
(uint32_t)conn->tx_unacked);
tcp_setsequence(conn->sndseq, ackseq);
}
/* Do RTT estimation, unless we have done retransmissions. */ /* Do RTT estimation, unless we have done retransmissions. */