diff options
author | Pablo Camarillo <pcamaril@cisco.com> | 2020-03-12 16:26:45 +0000 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2020-03-13 13:34:31 +0000 |
commit | 2b2a40cf3fe88dd25a9d3511bfa1628d9ad025a6 (patch) | |
tree | 868f763e0e55c7b050ecfef0fc1262ce9fda5c6e /src | |
parent | 7e86947d779d2ac949c2e753590e5d097d56650e (diff) |
sr: SRv6 coverity
Fixes 4 coverity issues
Type: fix
Signed-off-by: Pablo Camarillo <pcamaril@cisco.com>
Change-Id: Ib3ef1df3e5d601d7751445ae1c9603bb6ce0f80c
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/srv6-un/node.c | 31 |
1 files changed, 8 insertions, 23 deletions
diff --git a/src/plugins/srv6-un/node.c b/src/plugins/srv6-un/node.c index caca18c56f2..9368f2083ef 100644 --- a/src/plugins/srv6-un/node.c +++ b/src/plugins/srv6-un/node.c @@ -187,34 +187,22 @@ srv6_un_localsid_fn (vlib_main_t * vm, } vlib_increment_combined_counter - (((next0 == - SRV6_UN_LOCALSID_NEXT_ERROR) ? - &(sm->sr_ls_invalid_counters) : - &(sm->sr_ls_valid_counters)), + (&(sm->sr_ls_valid_counters), thread_index, ls0 - sm->localsids, 1, vlib_buffer_length_in_chain (vm, b0)); vlib_increment_combined_counter - (((next1 == - SRV6_UN_LOCALSID_NEXT_ERROR) ? - &(sm->sr_ls_invalid_counters) : - &(sm->sr_ls_valid_counters)), + (&(sm->sr_ls_valid_counters), thread_index, ls1 - sm->localsids, 1, vlib_buffer_length_in_chain (vm, b1)); vlib_increment_combined_counter - (((next2 == - SRV6_UN_LOCALSID_NEXT_ERROR) ? - &(sm->sr_ls_invalid_counters) : - &(sm->sr_ls_valid_counters)), + (&(sm->sr_ls_valid_counters), thread_index, ls2 - sm->localsids, 1, vlib_buffer_length_in_chain (vm, b2)); vlib_increment_combined_counter - (((next3 == - SRV6_UN_LOCALSID_NEXT_ERROR) ? - &(sm->sr_ls_invalid_counters) : - &(sm->sr_ls_valid_counters)), + (&(sm->sr_ls_valid_counters), thread_index, ls3 - sm->localsids, 1, vlib_buffer_length_in_chain (vm, b3)); @@ -261,13 +249,10 @@ srv6_un_localsid_fn (vlib_main_t * vm, } /* This increments the SRv6 per LocalSID counters. */ - vlib_increment_combined_counter (((next0 == - SRV6_UN_LOCALSID_NEXT_ERROR) ? - &(sm->sr_ls_invalid_counters) : - &(sm->sr_ls_valid_counters)), - thread_index, ls0 - sm->localsids, - 1, vlib_buffer_length_in_chain (vm, - b0)); + vlib_increment_combined_counter + (&(sm->sr_ls_valid_counters), + thread_index, ls0 - sm->localsids, + 1, vlib_buffer_length_in_chain (vm, b0)); vlib_validate_buffer_enqueue_x1 (vm, node, next_index, to_next, n_left_to_next, bi0, next0); |