mirror of
https://github.com/apache/nuttx.git
synced 2026-05-20 20:44:39 +08:00
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:
+9
-1
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user