From 80a5d48c767a9890b64954b6aa4bff41db4117c2 Mon Sep 17 00:00:00 2001 From: Florin Coras Date: Fri, 1 Aug 2025 19:32:40 -0400 Subject: [PATCH] tcp: fix persist handler in closed state Do not rechedule connection if persist handler is called after connection is closed. Type: fix Change-Id: Ibe7c3924c6fb107a36e4d459f32a39e49a0b7ae1 Signed-off-by: Florin Coras --- src/vnet/tcp/tcp_output.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/vnet/tcp/tcp_output.c b/src/vnet/tcp/tcp_output.c index 120ad6c533e..d68c86b2330 100644 --- a/src/vnet/tcp/tcp_output.c +++ b/src/vnet/tcp/tcp_output.c @@ -1536,9 +1536,11 @@ tcp_timer_persist_handler (tcp_connection_t * tc) tcp_worker_stats_inc (wrk, to_persist, 1); + if (tc->state == TCP_STATE_CLOSED) + return; + /* Problem already solved or worse */ - if (tc->state == TCP_STATE_CLOSED || tc->snd_wnd > tc->snd_mss - || (tc->flags & TCP_CONN_FINSNT)) + if (tc->snd_wnd > tc->snd_mss || (tc->flags & TCP_CONN_FINSNT)) goto update_scheduler; available_bytes = transport_max_tx_dequeue (&tc->connection); -- 2.16.6