This is an automated email from the ASF dual-hosted git repository. xiaoxiang781216 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 3ac04aef9b964e9ad7dce8e664cca29a2a8f0865 Author: zhanghongyu <[email protected]> AuthorDate: Fri Dec 12 17:03:58 2025 +0800 net/tcp: stop timer when receive TCP_ACK in TCP_SYN_xxx state otherwise, after receiving the ACK, although there is no data to be retransmitted, the tcp_timer will still be continuously scheduled according to the RTO, which is unreasonable. Signed-off-by: zhanghongyu <[email protected]> --- net/tcp/tcp_input.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/tcp/tcp_input.c b/net/tcp/tcp_input.c index 20a269ebd50..07c7dcf05ba 100644 --- a/net/tcp/tcp_input.c +++ b/net/tcp/tcp_input.c @@ -1283,7 +1283,9 @@ found: /* Check if no packet need to retransmission, clear timer. */ - if (conn->tx_unacked == 0 && (conn->tcpstateflags == TCP_ESTABLISHED || + if (conn->tx_unacked == 0 && (conn->tcpstateflags == TCP_SYN_SENT || + conn->tcpstateflags == TCP_SYN_RCVD || + conn->tcpstateflags == TCP_ESTABLISHED || conn->tcpstateflags == TCP_CLOSE_WAIT || conn->tcpstateflags == TCP_FIN_WAIT_1)) {
