diff options
Diffstat (limited to 'src/plugins/gbp/gbp_api.c')
-rw-r--r-- | src/plugins/gbp/gbp_api.c | 17 |
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); |