diff options
author | Florin Coras <fcoras@cisco.com> | 2019-11-07 12:33:12 -0800 |
---|---|---|
committer | Andrew Yourtchenko <ayourtch@gmail.com> | 2019-11-18 13:34:53 +0000 |
commit | 636a8407586ed45a5b575ea58f4ad584e4a8a27c (patch) | |
tree | 24eb6a111e28415b5b35dc0a0f9e80dbcd36cb74 | |
parent | 061e8671a776c13c065a8bed77e300f96cd5d2c4 (diff) |
tcp: avoid retransmits post reset
Type: fix
Change-Id: Ib6a8f5ca597389700e5746f089a5cec7eee65ab5
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit fd4c3fe364becc02527ed5f9088d904c7bc34a6f)
-rw-r--r-- | src/vnet/tcp/tcp.c | 3 | ||||
-rw-r--r-- | src/vnet/tcp/tcp_output.c | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/vnet/tcp/tcp.c b/src/vnet/tcp/tcp.c index 1d030c9ce71..2de4791fde1 100644 --- a/src/vnet/tcp/tcp.c +++ b/src/vnet/tcp/tcp.c @@ -360,6 +360,7 @@ tcp_connection_reset (tcp_connection_t * tc) * cleanly close the connection */ tcp_timer_set (tc, TCP_TIMER_WAITCLOSE, tcp_cfg.closewait_time); session_transport_reset_notify (&tc->connection); + tcp_cong_recovery_off (tc); tcp_connection_set_state (tc, TCP_STATE_CLOSED); session_transport_closed_notify (&tc->connection); break; @@ -370,6 +371,7 @@ tcp_connection_reset (tcp_connection_t * tc) 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); /* 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); @@ -489,6 +491,7 @@ tcp_session_reset (u32 conn_index, u32 thread_index) session_transport_closed_notify (&tc->connection); tcp_send_reset (tc); tcp_connection_timers_reset (tc); + tcp_cong_recovery_off (tc); tcp_connection_set_state (tc, TCP_STATE_CLOSED); tcp_timer_update (tc, TCP_TIMER_WAITCLOSE, tcp_cfg.cleanup_time); } diff --git a/src/vnet/tcp/tcp_output.c b/src/vnet/tcp/tcp_output.c index 2227ad4ac8c..27154ec5b9d 100644 --- a/src/vnet/tcp/tcp_output.c +++ b/src/vnet/tcp/tcp_output.c @@ -2178,6 +2178,9 @@ tcp_do_retransmit (tcp_connection_t * tc, u32 max_burst_size) tcp_worker_ctx_t *wrk; u32 n_segs; + if (PREDICT_FALSE (tc->state == TCP_STATE_CLOSED)) + return 0; + wrk = tcp_get_worker (tc->c_thread_index); if (tcp_opts_sack_permitted (&tc->rcv_opts)) |