summaryrefslogtreecommitdiffstats
path: root/src/plugins/lb/node.c
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2018-10-02 16:33:56 -0400
committerFlorin Coras <florin.coras@gmail.com>2018-10-02 21:36:12 +0000
commit819d5fdb39526386ee8fe4a8729f960e84443cbd (patch)
treef81e79c45024a20e04c817d5a0f44cd26b3d6ee8 /src/plugins/lb/node.c
parentbf49590c07162be44b21d0e0440e7fb96b2746d5 (diff)
VPP-1440: clean up coverity warnings
Change-Id: Ic6823fb617ecae547a5f0e28b1e037848e40f682 Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/plugins/lb/node.c')
-rw-r--r--src/plugins/lb/node.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/lb/node.c b/src/plugins/lb/node.c
index 8163e35a06e..ab192af11aa 100644
--- a/src/plugins/lb/node.c
+++ b/src/plugins/lb/node.c
@@ -646,13 +646,14 @@ lb_nodeport_node_fn (vlib_main_t * vm, vlib_node_runtime_t * node,
entry0 = hash_get_mem(lbm->vip_index_by_nodeport, &(udp_0->dst_port));
//Enqueue to next
- vnet_buffer(p0)->ip.adj_index[VLIB_TX] = entry0[0];
+ vnet_buffer(p0)->ip.adj_index[VLIB_TX] = entry0 ? entry0[0]
+ : ADJ_INDEX_INVALID;
if (PREDICT_FALSE(p0->flags & VLIB_BUFFER_IS_TRACED))
{
lb_nodeport_trace_t *tr = vlib_add_trace (vm, node, p0,
sizeof(*tr));
- tr->vip_index = entry0[0];
+ tr->vip_index = entry0 ? entry0[0] : ADJ_INDEX_INVALID;
tr->node_port = (u32) clib_net_to_host_u16 (udp_0->dst_port);
}