aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2020-01-16 04:04:54 +0000
committerDave Barach <openvpp@barachs.net>2020-01-16 15:17:17 +0000
commitde7fcacb35423d22960a84168ca40ef7c13b21a9 (patch)
tree941514b28160f3387dbfa7901294f8c1a088d759 /src/vnet
parentf0bae64f6fd4c410c19f6ece688443f389932688 (diff)
tcp: fix listen node coverity warning
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: If5ec3ec4f46d3840c2b3c3005f093b5dddefc289
Diffstat (limited to 'src/vnet')
-rwxr-xr-xsrc/vnet/tcp/tcp_input.c23
1 files changed, 12 insertions, 11 deletions
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 */