Skip to content

Commit 4b1c034

Browse files
jukkarcvinayak
authored andcommitted
[nrf fromtree] net: tcp: Reschedule FIN timer when entering FIN state
The FIN timer was not set when we entered the FIN_WAIT_1 state. This could cause issues if we did not receive proper packets from peer. With this fix, the connection is always terminated even if peer does not respond. Signed-off-by: Robert Lubos <[email protected]> Signed-off-by: Jukka Rissanen <[email protected]> (cherry picked from commit b214207)
1 parent 6edacfa commit 4b1c034

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

subsys/net/ip/tcp.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2681,6 +2681,10 @@ static enum net_verdict tcp_in(struct tcp *conn, struct net_pkt *pkt)
26812681
tcp_send_timer_cancel(conn);
26822682
next = TCP_FIN_WAIT_1;
26832683

2684+
k_work_reschedule_for_queue(&tcp_work_q,
2685+
&conn->fin_timer,
2686+
FIN_TIMEOUT);
2687+
26842688
tcp_out(conn, FIN | ACK);
26852689
conn_seq(conn, + 1);
26862690
verdict = NET_OK;

0 commit comments

Comments
 (0)