X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fplugins%2Fgbp%2Fgbp_endpoint.c;h=e1a810cf222bc2a52d680452424f79b4b8ed41d1;hb=59f71132e;hp=c6cab3fbfb88ab910e596f84a68ecc653bf5f3fc;hpb=f50bac1bb25b02d7f086627c4c0a0709ee0f61d5;p=vpp.git diff --git a/src/plugins/gbp/gbp_endpoint.c b/src/plugins/gbp/gbp_endpoint.c index c6cab3fbfb8..e1a810cf222 100644 --- a/src/plugins/gbp/gbp_endpoint.c +++ b/src/plugins/gbp/gbp_endpoint.c @@ -24,13 +24,12 @@ #include #include -#include #include #include #include #include #include -#include +#include #include #include @@ -208,12 +207,6 @@ gbp_endpoint_index (const gbp_endpoint_t * ge) return (ge - gbp_endpoint_pool); } -static ip46_type_t -ip46_address_get_type (const ip46_address_t * a) -{ - return (ip46_address_is_ip4 (a) ? IP46_TYPE_IP4 : IP46_TYPE_IP6); -} - static int gbp_endpoint_ip_is_equal (const fib_prefix_t * fp, const ip46_address_t * ip) { @@ -775,14 +768,11 @@ gbb_endpoint_fwd_recalc (gbp_endpoint_t * ge) { gbp_endpoint_add_itf (gbp_itf_get_sw_if_index (gef->gef_itf), gei); - if (FIB_PROTOCOL_IP4 == pfx->fp_proto) - send_ip4_garp_w_addr (vlib_get_main (), - &pfx->fp_addr.ip4, - gg->gg_uplink_sw_if_index); - else - send_ip6_na_w_addr (vlib_get_main (), - &pfx->fp_addr.ip6, - gg->gg_uplink_sw_if_index); + ip_neighbor_advertise (vlib_get_main (), + (FIB_PROTOCOL_IP4 == pfx->fp_proto ? + IP46_TYPE_IP4 : + IP46_TYPE_IP6), + &pfx->fp_addr, gg->gg_uplink_sw_if_index); } } } @@ -1408,8 +1398,8 @@ gbp_endpoint_scan_l2 (vlib_main_t * vm) last_start = vlib_time_now (vm); } - b = >e_table->buckets[i]; - if (b->offset == 0) + b = clib_bihash_get_bucket_16_8 (gte_table, i); + if (clib_bihash_bucket_is_empty_16_8 (b)) continue; v = clib_bihash_get_value_16_8 (gte_table, b->offset); @@ -1426,7 +1416,7 @@ gbp_endpoint_scan_l2 (vlib_main_t * vm) * Note: we may have just freed the bucket's backing * storage, so check right here... */ - if (b->offset == 0) + if (clib_bihash_bucket_is_empty_16_8 (b)) goto doublebreak; } v++; @@ -1463,8 +1453,8 @@ gbp_endpoint_scan_l3 (vlib_main_t * vm) last_start = vlib_time_now (vm); } - b = >e_table->buckets[i]; - if (b->offset == 0) + b = clib_bihash_get_bucket_24_8 (gte_table, i); + if (clib_bihash_bucket_is_empty_24_8 (b)) continue; v = clib_bihash_get_value_24_8 (gte_table, b->offset); @@ -1481,7 +1471,7 @@ gbp_endpoint_scan_l3 (vlib_main_t * vm) * Note: we may have just freed the bucket's backing * storage, so check right here... */ - if (b->offset == 0) + if (clib_bihash_bucket_is_empty_24_8 (b)) goto doublebreak; } v++;