From 819d5fdb39526386ee8fe4a8729f960e84443cbd Mon Sep 17 00:00:00 2001 From: Dave Barach Date: Tue, 2 Oct 2018 16:33:56 -0400 Subject: VPP-1440: clean up coverity warnings Change-Id: Ic6823fb617ecae547a5f0e28b1e037848e40f682 Signed-off-by: Dave Barach --- src/plugins/nsim/node.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/plugins/nsim') diff --git a/src/plugins/nsim/node.c b/src/plugins/nsim/node.c index e78e74482ff..dfd0bf747f1 100644 --- a/src/plugins/nsim/node.c +++ b/src/plugins/nsim/node.c @@ -125,7 +125,10 @@ nsim_inline (vlib_main_t * vm, ep->current_length); } else /* out of wheel space, drop pkt */ - b[0]->error = no_buffer_error; + { + b[0]->error = no_buffer_error; + is_drop0 = 1; + } if (is_trace) { @@ -134,8 +137,7 @@ nsim_inline (vlib_main_t * vm, nsim_trace_t *t = vlib_add_trace (vm, node, b[0], sizeof (*t)); t->expires = expires; t->is_drop = is_drop0; - if (is_drop0 == 0) - t->tx_sw_if_index = ep->tx_sw_if_index; + t->tx_sw_if_index = (is_drop0 == 0) ? ep->tx_sw_if_index : 0; } } -- cgit 1.2.3-korg