aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/gbp/gbp_api.c
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2019-01-07 19:54:20 +0100
committerNeale Ranns <nranns@cisco.com>2019-01-09 06:10:08 +0000
commit5f4eb24287c02be6f694f6698472ef4978a5e300 (patch)
treee2c783676924b71c7662176728db0b0720797470 /src/plugins/gbp/gbp_api.c
parente3034cdc74f9fe153259a55c03846495d3f9f088 (diff)
gbp: Fix coverity warnings
Change-Id: Iea64d246008b298edeeae338d781b79362f42046 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Diffstat (limited to 'src/plugins/gbp/gbp_api.c')
-rw-r--r--src/plugins/gbp/gbp_api.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/plugins/gbp/gbp_api.c b/src/plugins/gbp/gbp_api.c
index 85473674de4..8d80365c55d 100644
--- a/src/plugins/gbp/gbp_api.c
+++ b/src/plugins/gbp/gbp_api.c
@@ -645,10 +645,10 @@ vl_api_gbp_recirc_add_del_t_handler (vl_api_gbp_recirc_add_del_t * mp)
goto bad_sw_if_index;
if (mp->is_add)
- gbp_recirc_add (sw_if_index,
- ntohs (mp->recirc.epg_id), mp->recirc.is_ext);
+ rv = gbp_recirc_add (sw_if_index,
+ ntohs (mp->recirc.epg_id), mp->recirc.is_ext);
else
- gbp_recirc_delete (sw_if_index);
+ rv = gbp_recirc_delete (sw_if_index);
BAD_SW_IF_INDEX_LABEL;
@@ -700,17 +700,20 @@ static void
vl_api_gbp_ext_itf_add_del_t_handler (vl_api_gbp_ext_itf_add_del_t * mp)
{
vl_api_gbp_ext_itf_add_del_reply_t *rmp;
- u32 sw_if_index;
+ u32 sw_if_index = ~0;
+ vl_api_gbp_ext_itf_t *ext_itf;
int rv = 0;
- sw_if_index = ntohl (mp->ext_itf.sw_if_index);
+ ext_itf = &mp->ext_itf;
+ if (ext_itf)
+ sw_if_index = ntohl (ext_itf->sw_if_index);
+
if (!vnet_sw_if_index_is_api_valid (sw_if_index))
goto bad_sw_if_index;
if (mp->is_add)
rv = gbp_ext_itf_add (sw_if_index,
- ntohl (mp->ext_itf.bd_id),
- ntohl (mp->ext_itf.rd_id));
+ ntohl (ext_itf->bd_id), ntohl (ext_itf->rd_id));
else
rv = gbp_ext_itf_delete (sw_if_index);