tcp: fix persist handler in closed state 14/43514/4
authorFlorin Coras <[email protected]>
Fri, 1 Aug 2025 23:32:40 +0000 (19:32 -0400)
committerDave Barach <[email protected]>
Sun, 3 Aug 2025 21:52:56 +0000 (21:52 +0000)
Do not rechedule connection if persist handler is called after
connection is closed.

Type: fix

Change-Id: Ibe7c3924c6fb107a36e4d459f32a39e49a0b7ae1
Signed-off-by: Florin Coras <[email protected]>
src/vnet/tcp/tcp_output.c

index 120ad6c..d68c86b 100644 (file)
@@ -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);