From 3f78bbb8e875f3fccbcd167289ba2d307cb86263 Mon Sep 17 00:00:00 2001 From: Florin Coras Date: Thu, 13 Feb 2020 19:24:58 +0000 Subject: [PATCH] tcp: reset fin-wait-2 timeout connections Type: improvement Signed-off-by: Florin Coras Change-Id: Id931f3f308a01788d222d0d62f26f5c579321c6a --- src/vnet/tcp/tcp.c | 8 ++++++++ src/vnet/tcp/tcp.h | 1 + 2 files changed, 9 insertions(+) diff --git a/src/vnet/tcp/tcp.c b/src/vnet/tcp/tcp.c index f83f00aa695..e34f773d7d3 100644 --- a/src/vnet/tcp/tcp.c +++ b/src/vnet/tcp/tcp.c @@ -1431,6 +1431,14 @@ tcp_timer_waitclose_handler (u32 conn_index, u32 thread_index) session_transport_closed_notify (&tc->connection); tcp_worker_stats_inc (thread_index, to_closing, 1); break; + case TCP_STATE_FIN_WAIT_2: + tcp_send_reset (tc); + tcp_connection_timers_reset (tc); + tcp_connection_set_state (tc, TCP_STATE_CLOSED); + session_transport_closed_notify (&tc->connection); + tcp_timer_set (tc, TCP_TIMER_WAITCLOSE, tcp_cfg.cleanup_time); + tcp_worker_stats_inc (thread_index, to_finwait2, 1); + break; default: tcp_connection_del (tc); break; diff --git a/src/vnet/tcp/tcp.h b/src/vnet/tcp/tcp.h index 1549efbeb7f..a60e105f0d2 100644 --- a/src/vnet/tcp/tcp.h +++ b/src/vnet/tcp/tcp.h @@ -508,6 +508,7 @@ typedef struct _tcp_lookup_dispatch _(tr_events, u32, "timer retransmit events") \ _(to_closewait, u32, "timeout close-wait") \ _(to_finwait1, u32, "timeout fin-wait-1") \ + _(to_finwait2, u32, "timeout fin-wait-2") \ _(to_lastack, u32, "timeout last-ack") \ _(to_closing, u32, "timeout closing") \ _(tr_abort, u32, "timer retransmit abort") \ -- 2.16.6