X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fbier%2Fbier_api.c;h=ed1e35f5b249ace5556aeda7e9cc261250acf5a0;hb=4c422f9;hp=7263ec65720604328c921d5b49dc253bd0ad498f;hpb=2303cb181b51f63c909cd506125c1f832432865a;p=vpp.git diff --git a/src/vnet/bier/bier_api.c b/src/vnet/bier/bier_api.c index 7263ec65720..ed1e35f5b24 100644 --- a/src/vnet/bier/bier_api.c +++ b/src/vnet/bier/bier_api.c @@ -123,7 +123,7 @@ send_bier_table_details (vl_api_registration_t * reg, mp = vl_msg_api_alloc(sizeof(*mp)); if (!mp) return; - memset(mp, 0, sizeof(*mp)); + clib_memset(mp, 0, sizeof(*mp)); mp->_vl_msg_id = ntohs(VL_API_BIER_TABLE_DETAILS); mp->context = context; @@ -204,13 +204,24 @@ vl_api_bier_route_add_del_t_handler (vl_api_bier_route_add_del_t * mp) } } - if (mp->br_is_add) + if (mp->br_is_replace) { - bier_table_route_add(&bti, bp, brpaths); + if (0 == vec_len(brpaths)) + { + bier_table_route_delete(&bti, bp); + } + else + { + bier_table_route_path_update(&bti, bp, brpaths); + } + } + else if (mp->br_is_add) + { + bier_table_route_path_add(&bti, bp, brpaths); } else { - bier_table_route_remove(&bti, bp, brpaths); + bier_table_route_path_remove(&bti, bp, brpaths); } vec_free(brpaths); @@ -243,7 +254,7 @@ send_bier_route_details (const bier_table_t *bt, if (!mp) return; - memset(mp, 0, m_size); + clib_memset(mp, 0, m_size); mp->_vl_msg_id = ntohs(VL_API_BIER_ROUTE_DETAILS); mp->context = ctx->context; @@ -293,7 +304,7 @@ vl_api_bier_imp_add_t_handler (vl_api_bier_imp_add_t * mp) { vl_api_bier_imp_add_reply_t *rmp; vnet_main_t *vnm; - index_t bii; + index_t bii = ~0; int rv = 0; vnm = vnet_get_main (); @@ -362,7 +373,7 @@ send_bier_imp_details (vl_api_registration_t * reg, mp = vl_msg_api_alloc(sizeof(*mp) + n_bytes); if (!mp) return; - memset(mp, 0, sizeof(*mp)+n_bytes); + clib_memset(mp, 0, sizeof(*mp)+n_bytes); mp->_vl_msg_id = ntohs(VL_API_BIER_IMP_DETAILS); mp->context = context; @@ -429,7 +440,7 @@ send_bier_disp_table_details (vl_api_registration_t * reg, mp = vl_msg_api_alloc(sizeof(*mp)); if (!mp) return; - memset(mp, 0, sizeof(*mp)); + clib_memset(mp, 0, sizeof(*mp)); mp->_vl_msg_id = ntohs(VL_API_BIER_DISP_TABLE_DETAILS); mp->context = context; @@ -494,13 +505,13 @@ vl_api_bier_disp_entry_add_del_t_handler (vl_api_bier_disp_entry_add_del_t * mp) if (0 == mp->bde_paths[ii].afi) { - clib_memcpy (&brp->frp_addr.ip4, + clib_memcpy_fast (&brp->frp_addr.ip4, mp->bde_paths[ii].next_hop, sizeof (brp->frp_addr.ip4)); } else { - clib_memcpy (&brp->frp_addr.ip6, + clib_memcpy_fast (&brp->frp_addr.ip6, mp->bde_paths[ii].next_hop, sizeof (brp->frp_addr.ip6)); } @@ -605,7 +616,7 @@ send_bier_disp_entry_details (const bier_disp_table_t *bdt, if (!mp) return; - memset(mp, 0, m_size); + clib_memset(mp, 0, m_size); mp->_vl_msg_id = ntohs(VL_API_BIER_DISP_ENTRY_DETAILS); mp->context = ctx->context;