tcp_timer.c: send TCP_RST when keepalive timeout

The RFC requires sending an TCP_RST packet in this scenario, so to better
comply with the standard definition, the sending of TCP_RST is added.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
zhanghongyu
2025-08-15 10:19:41 +08:00
committed by Xiang Xiao
parent f99dd20c4e
commit da43a2e53b
+9 -1
View File
@@ -695,7 +695,15 @@ void tcp_timer(FAR struct net_driver_s *dev, FAR struct tcp_conn_s *conn)
devif_conn_event(conn->dev, TCP_ABORT,
conn->sconn.list);
tcp_stop_monitor(conn, TCP_ABORT);
/* We also send a reset packet to the remote host. */
tcp_send(dev, conn, TCP_RST | TCP_ACK, hdrlen);
/* Stop the timer work */
conn->keeptimer = 0;
conn->timer = 0;
}
else
{