From b24dfec57e7a272e2da4d99191340bbfbef19a45 Mon Sep 17 00:00:00 2001 From: Mohsin Kazmi Date: Thu, 23 Aug 2018 12:24:19 +0200 Subject: coverity: l2 arp termination dump This patch resolves the coverity warning. Change-Id: I3f5e664b442fa9bcafd28c67283596570dc1244d Signed-off-by: Mohsin Kazmi --- src/vnet/l2/l2_api.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/vnet/l2/l2_api.c b/src/vnet/l2/l2_api.c index 5ec7581ff3b..39e52b1ecef 100644 --- a/src/vnet/l2/l2_api.c +++ b/src/vnet/l2/l2_api.c @@ -731,7 +731,7 @@ vl_api_bd_ip_mac_dump_t_handler (vl_api_bd_ip_mac_dump_t * mp) bd_main_t *bdm = &bd_main; l2_bridge_domain_t *bd_config; u32 bd_id = ntohl (mp->bd_id); - u32 bd_index, start = 1, end; + u32 bd_index, start, end; vl_api_registration_t *reg; uword *p; @@ -739,11 +739,12 @@ vl_api_bd_ip_mac_dump_t_handler (vl_api_bd_ip_mac_dump_t * mp) if (!reg) return; - end = vec_len (l2input_main.bd_configs); - /* see bd_id: ~0 means "any" */ if (bd_id == ~0) - bd_index = ~0; + { + start = 1; + end = vec_len (l2input_main.bd_configs); + } else { p = hash_get (bdm->bd_index_by_bd_id, bd_id); -- cgit 1.2.3-korg