From 6cf4c95517dfa1e3db4def36b53e91c168f18dd0 Mon Sep 17 00:00:00 2001 From: wangchen Date: Fri, 4 Jul 2025 10:40:08 +0800 Subject: [PATCH] tcp_input: Add condition to check sndseq and ackseq equality When triggering TCP retransmission through a timer, conn->unacked_q will save more packets, which may result in sndseq being equal to ackseq. Previous implementations may cause conn->nrtx to not be cleared, leading to an increase in conn->rto errors and a longer timer time Signed-off-by: wangchen --- net/tcp/tcp_input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/tcp/tcp_input.c b/net/tcp/tcp_input.c index 8d23d8f1fe1..1bb3378d258 100644 --- a/net/tcp/tcp_input.c +++ b/net/tcp/tcp_input.c @@ -1070,7 +1070,7 @@ found: */ uint32_t sndseq = tcp_getsequence(conn->sndseq); - if (TCP_SEQ_LT(sndseq, ackseq)) + if (TCP_SEQ_LTE(sndseq, ackseq)) { ninfo("sndseq: %08" PRIx32 "->%08" PRIx32 " unackseq: %08" PRIx32 " new tx_unacked: %" PRIu32 "\n",