From de7fcacb35423d22960a84168ca40ef7c13b21a9 Mon Sep 17 00:00:00 2001 From: Florin Coras Date: Thu, 16 Jan 2020 04:04:54 +0000 Subject: tcp: fix listen node coverity warning Type: fix Signed-off-by: Florin Coras Change-Id: If5ec3ec4f46d3840c2b3c3005f093b5dddefc289 --- src/vnet/tcp/tcp_input.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'src/vnet/tcp') diff --git a/src/vnet/tcp/tcp_input.c b/src/vnet/tcp/tcp_input.c index cf74fb91ce1..59b01047026 100755 --- a/src/vnet/tcp/tcp_input.c +++ b/src/vnet/tcp/tcp_input.c @@ -3221,6 +3221,18 @@ tcp46_listen_inline (vlib_main_t * vm, vlib_node_runtime_t * node, n_left_from -= 1; b0 = vlib_get_buffer (vm, bi0); + + if (is_ip4) + { + ip40 = vlib_buffer_get_current (b0); + th0 = tcp_buffer_hdr (b0); + } + else + { + ip60 = vlib_buffer_get_current (b0); + th0 = tcp_buffer_hdr (b0); + } + lc0 = tcp_listener_get (vnet_buffer (b0)->tcp.connection_index); if (PREDICT_FALSE (lc0 == 0)) { @@ -3236,17 +3248,6 @@ tcp46_listen_inline (vlib_main_t * vm, vlib_node_runtime_t * node, tcp_connection_del (tc0); } - if (is_ip4) - { - ip40 = vlib_buffer_get_current (b0); - th0 = tcp_buffer_hdr (b0); - } - else - { - ip60 = vlib_buffer_get_current (b0); - th0 = tcp_buffer_hdr (b0); - } - /* Create child session. For syn-flood protection use filter */ /* 1. first check for an RST: handled in dispatch */ -- cgit 1.2.3-korg