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 <s.a.hettinga@gmail.com>
This commit is contained in:
Sjors Hettinga 2022-04-25 07:50:51 +02:00 committed by Carles Cufí
commit 9392b12d4b

View file

@ -28,7 +28,8 @@ LOG_MODULE_REGISTER(net_tcp, CONFIG_NET_TCP_LOG_LEVEL);
#define ACK_TIMEOUT_MS CONFIG_NET_TCP_ACK_TIMEOUT
#define ACK_TIMEOUT K_MSEC(ACK_TIMEOUT_MS)
#define FIN_TIMEOUT_MS MSEC_PER_SEC
/* Allow for (tcp_retries + 1) transmissions */
#define FIN_TIMEOUT_MS (tcp_rto * (tcp_retries + 1))
#define FIN_TIMEOUT K_MSEC(FIN_TIMEOUT_MS)
static int tcp_rto = CONFIG_NET_TCP_INIT_RETRANSMISSION_TIMEOUT;