This is an automated email from the ASF dual-hosted git repository.
jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new c8f6c8b72df net/tcp/tcp_send: Remove work_available check when
updating retransmit timer
c8f6c8b72df is described below
commit c8f6c8b72df530218e49a5c71ef50f0d6d8e03fa
Author: zhekunren <[email protected]>
AuthorDate: Fri Jul 31 16:44:07 2026 +0800
net/tcp/tcp_send: Remove work_available check when updating retransmit timer
The condition work_available(&conn->work) && tx_unacked != 0
prevented tcp_update_retrantimer from being called when the work
queue was still busy, leaving conn->timer stale or zero on
subsequent sends. This caused the RTT estimation to compute a
false RTT (m = rto - 0 = rto), creating a positive feedback loop
that inflated the RTO to extreme values (e.g., 232 half-seconds
= ~116 seconds).
Fix: remove the work_available check so that tcp_update_retrantimer
is always called when there is unacknowledged data. The decision to
re-queue the work is handled internally by tcp_update_timer.
Signed-off-by: zhekunren <[email protected]>
---
net/tcp/tcp_send.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/tcp/tcp_send.c b/net/tcp/tcp_send.c
index c5303688176..7869618e170 100644
--- a/net/tcp/tcp_send.c
+++ b/net/tcp/tcp_send.c
@@ -149,7 +149,7 @@ static void tcp_sendcommon(FAR struct net_driver_s *dev,
}
else
{
- if (work_available(&conn->work) && conn->tx_unacked != 0)
+ if (conn->tx_unacked != 0)
{
conn->timeout = false;
tcp_update_retrantimer(conn, conn->rto);