diff options
author | Florin Coras <fcoras@cisco.com> | 2019-02-07 00:15:53 -0800 |
---|---|---|
committer | John Lo <loj@cisco.com> | 2019-02-07 16:53:01 +0000 |
commit | cd56f69af9adcd23cac6d625ef2169e3ef3635fc (patch) | |
tree | cbd02920f36ccf4a295294a1e39fca372aba2b16 | |
parent | 63132185d09b6aa27183d7060763626d13826354 (diff) |
tcp: fix reset sending in syn-sent
Change-Id: I468b1015bca5f95b162fb49e904aa4e4d38db75e
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit d4c49be5e20406220cf89083c9df86c3c0761a81)
-rw-r--r-- | src/vnet/tcp/tcp.h | 2 | ||||
-rw-r--r-- | src/vnet/tcp/tcp_input.c | 6 | ||||
-rw-r--r-- | src/vnet/tcp/tcp_output.c | 5 |
3 files changed, 7 insertions, 6 deletions
diff --git a/src/vnet/tcp/tcp.h b/src/vnet/tcp/tcp.h index dca045128ed..8266f1ff449 100644 --- a/src/vnet/tcp/tcp.h +++ b/src/vnet/tcp/tcp.h @@ -616,7 +616,7 @@ void tcp_make_ack (tcp_connection_t * ts, vlib_buffer_t * b); void tcp_make_fin (tcp_connection_t * tc, vlib_buffer_t * b); void tcp_make_synack (tcp_connection_t * ts, vlib_buffer_t * b); void tcp_send_reset_w_pkt (tcp_connection_t * tc, vlib_buffer_t * pkt, - u8 is_ip4); + u32 thread_index, u8 is_ip4); void tcp_send_reset (tcp_connection_t * tc); void tcp_send_syn (tcp_connection_t * tc); void tcp_send_synack (tcp_connection_t * tc); diff --git a/src/vnet/tcp/tcp_input.c b/src/vnet/tcp/tcp_input.c index 6a376350595..f1f945e1092 100644 --- a/src/vnet/tcp/tcp_input.c +++ b/src/vnet/tcp/tcp_input.c @@ -2394,7 +2394,7 @@ tcp46_syn_sent_inline (vlib_main_t * vm, vlib_node_runtime_t * node, if (seq_leq (ack0, tc0->iss) || seq_gt (ack0, tc0->snd_nxt)) { if (!tcp_rst (tcp0)) - tcp_send_reset_w_pkt (tc0, b0, is_ip4); + tcp_send_reset_w_pkt (tc0, b0, my_thread_index, is_ip4); error0 = TCP_ERROR_RCV_WND; goto drop; } @@ -2497,7 +2497,7 @@ tcp46_syn_sent_inline (vlib_main_t * vm, vlib_node_runtime_t * node, if (session_stream_connect_notify (&new_tc0->connection, 0)) { clib_warning ("connect notify fail"); - tcp_send_reset_w_pkt (new_tc0, b0, is_ip4); + tcp_send_reset_w_pkt (new_tc0, b0, my_thread_index, is_ip4); tcp_connection_cleanup (new_tc0); goto drop; } @@ -2518,7 +2518,7 @@ tcp46_syn_sent_inline (vlib_main_t * vm, vlib_node_runtime_t * node, if (session_stream_connect_notify (&new_tc0->connection, 0)) { tcp_connection_cleanup (new_tc0); - tcp_send_reset_w_pkt (tc0, b0, is_ip4); + tcp_send_reset_w_pkt (tc0, b0, my_thread_index, is_ip4); TCP_EVT_DBG (TCP_EVT_RST_SENT, tc0); goto drop; } diff --git a/src/vnet/tcp/tcp_output.c b/src/vnet/tcp/tcp_output.c index 97f5b81f9e8..f0fe25495a1 100644 --- a/src/vnet/tcp/tcp_output.c +++ b/src/vnet/tcp/tcp_output.c @@ -826,9 +826,10 @@ tcp_make_reset_in_place (vlib_main_t * vm, vlib_buffer_t * b0, * It extracts connection info out of original packet */ void -tcp_send_reset_w_pkt (tcp_connection_t * tc, vlib_buffer_t * pkt, u8 is_ip4) +tcp_send_reset_w_pkt (tcp_connection_t * tc, vlib_buffer_t * pkt, + u32 thread_index, u8 is_ip4) { - tcp_worker_ctx_t *wrk = tcp_get_worker (tc->c_thread_index); + tcp_worker_ctx_t *wrk = tcp_get_worker (thread_index); vlib_main_t *vm = wrk->vm; vlib_buffer_t *b; u32 bi, sw_if_index, fib_index; |