Skip to content

Commit 9392b12

Browse files
ssharkscarlescufi
authored andcommitted
net: tcp: Set the FIN_TIMEOUT to allow all FIN retries
Instead of using a fixed fin timeout, compute it based on the number of retries. Fixes issue found by PR 44545. Signed-off-by: Sjors Hettinga <[email protected]>
1 parent 768e0d7 commit 9392b12

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

subsys/net/ip/tcp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ LOG_MODULE_REGISTER(net_tcp, CONFIG_NET_TCP_LOG_LEVEL);
2828

2929
#define ACK_TIMEOUT_MS CONFIG_NET_TCP_ACK_TIMEOUT
3030
#define ACK_TIMEOUT K_MSEC(ACK_TIMEOUT_MS)
31-
#define FIN_TIMEOUT_MS MSEC_PER_SEC
31+
/* Allow for (tcp_retries + 1) transmissions */
32+
#define FIN_TIMEOUT_MS (tcp_rto * (tcp_retries + 1))
3233
#define FIN_TIMEOUT K_MSEC(FIN_TIMEOUT_MS)
3334

3435
static int tcp_rto = CONFIG_NET_TCP_INIT_RETRANSMISSION_TIMEOUT;

0 commit comments

Comments
 (0)