diff options
author | Ivan Shvedunov <ivan4th@gmail.com> | 2020-07-27 19:59:38 +0300 |
---|---|---|
committer | Ivan Shvedunov <ivan4th@gmail.com> | 2020-07-27 20:16:46 +0300 |
commit | 9fefa89169d296bff41a815fbefed2b41b1a4bb8 (patch) | |
tree | 29fd6e60d633177ae7bf5f533a3c72979a8018eb /src | |
parent | c72995dd79500dd5791e71fd3edeae527c257351 (diff) |
tcp: fix tcp_connection_cleanup() with uninitialized elog
This fixes TCP connection cleanup crash when TCP debugging is enabled.
It could happen if session_stream_accept() returned an error.
Type: fix
Signed-off-by: Ivan Shvedunov <ivan4th@gmail.com>
Change-Id: I0df08969d82bb0f44def81b9e47195bd15502831
Diffstat (limited to 'src')
-rw-r--r-- | src/vnet/tcp/tcp_input.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/vnet/tcp/tcp_input.c b/src/vnet/tcp/tcp_input.c index b8c889ee1cc..8efe0c5a77a 100644 --- a/src/vnet/tcp/tcp_input.c +++ b/src/vnet/tcp/tcp_input.c @@ -2630,6 +2630,13 @@ tcp46_listen_inline (vlib_main_t * vm, vlib_node_runtime_t * node, tcp_connection_init_vars (child); child->rto = TCP_RTO_MIN; + /* + * This initializes elog track, must be done before synack. + * We also do it before possible tcp_connection_cleanup() as it + * generates TCP_EVT_DELETE event. + */ + TCP_EVT (TCP_EVT_SYN_RCVD, child, 1); + if (session_stream_accept (&child->connection, lc->c_s_index, lc->c_thread_index, 0 /* notify */ )) { @@ -2640,9 +2647,6 @@ tcp46_listen_inline (vlib_main_t * vm, vlib_node_runtime_t * node, child->tx_fifo_size = transport_tx_fifo_size (&child->connection); - /* This initializes elog track, must be done before synack */ - TCP_EVT (TCP_EVT_SYN_RCVD, child, 1); - tcp_send_synack (child); done: |