sr: SRv6 coverity
Fixes 4 coverity issues
Type: fix
@@ -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)),
+ vlib_increment_combined_counter
+ (&(sm->sr_ls_valid_counters),
thread_index, ls0 - sm->localsids,
- 1, vlib_buffer_length_in_chain (vm,
- b0));
+ 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);
