aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp/tcp_input.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2020-02-22 02:27:21 +0000
committerDave Barach <openvpp@barachs.net>2020-02-25 14:48:46 +0000
commit7a3a8664bbc9e295d6382949d2d0bcd1998a05f1 (patch)
treeb16832f9db11bf71fcd64be628df689062f7431f /src/vnet/tcp/tcp_input.c
parent47d8f5dcd655f0e01774822fca17dd38e7f557dd (diff)
tcp: handle cleanups without timers
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ida896e9fbe83b4c76578b089bb3fd2bef5e07fd2
Diffstat (limited to 'src/vnet/tcp/tcp_input.c')
-rwxr-xr-xsrc/vnet/tcp/tcp_input.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/vnet/tcp/tcp_input.c b/src/vnet/tcp/tcp_input.c
index adbfe7a50ac..e93e8bae273 100755
--- a/src/vnet/tcp/tcp_input.c
+++ b/src/vnet/tcp/tcp_input.c
@@ -332,12 +332,10 @@ tcp_rcv_rst (tcp_worker_ctx_t * wrk, tcp_connection_t * tc)
break;
case TCP_STATE_ESTABLISHED:
tcp_connection_timers_reset (tc);
- /* Set the cleanup timer, in case the session layer/app don't
- * cleanly close the connection */
- tcp_timer_set (tc, TCP_TIMER_WAITCLOSE, tcp_cfg.closewait_time);
tcp_cong_recovery_off (tc);
tcp_program_reset_ntf (wrk, tc);
tcp_connection_set_state (tc, TCP_STATE_CLOSED);
+ tcp_program_cleanup (wrk, tc);
break;
case TCP_STATE_CLOSE_WAIT:
case TCP_STATE_FIN_WAIT_1:
@@ -345,12 +343,12 @@ tcp_rcv_rst (tcp_worker_ctx_t * wrk, tcp_connection_t * tc)
case TCP_STATE_CLOSING:
case TCP_STATE_LAST_ACK:
tcp_connection_timers_reset (tc);
- tcp_timer_set (tc, TCP_TIMER_WAITCLOSE, tcp_cfg.closewait_time);
tcp_cong_recovery_off (tc);
tcp_program_reset_ntf (wrk, tc);
/* Make sure we mark the session as closed. In some states we may
* be still trying to send data */
tcp_connection_set_state (tc, TCP_STATE_CLOSED);
+ tcp_program_cleanup (wrk, tc);
break;
case TCP_STATE_CLOSED:
case TCP_STATE_TIME_WAIT:
@@ -3029,9 +3027,8 @@ tcp46_rcv_process_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
if (tc0->flags & TCP_CONN_FINRCVD)
{
tcp_connection_set_state (tc0, TCP_STATE_CLOSED);
- tcp_timer_set (tc0, TCP_TIMER_WAITCLOSE,
- tcp_cfg.cleanup_time);
session_transport_closed_notify (&tc0->connection);
+ tcp_program_cleanup (wrk, tc0);
goto drop;
}
@@ -3112,7 +3109,7 @@ tcp46_rcv_process_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
* we can't ensure that we have no packets already enqueued
* to output. Rely instead on the waitclose timer */
tcp_connection_timers_reset (tc0);
- tcp_timer_set (tc0, TCP_TIMER_WAITCLOSE, tcp_cfg.cleanup_time);
+ tcp_program_cleanup (tcp_get_worker (tc0->c_thread_index), tc0);
goto drop;