diff options
Diffstat (limited to 'zebra/zebra_vxlan.c')
| -rw-r--r-- | zebra/zebra_vxlan.c | 620 |
1 files changed, 325 insertions, 295 deletions
diff --git a/zebra/zebra_vxlan.c b/zebra/zebra_vxlan.c index 2fcaefdfbf..c13c867d2a 100644 --- a/zebra/zebra_vxlan.c +++ b/zebra/zebra_vxlan.c @@ -63,54 +63,60 @@ DEFINE_MTYPE_STATIC(ZEBRA, L3VNI_MAC, "EVPN L3VNI MAC"); DEFINE_MTYPE_STATIC(ZEBRA, L3NEIGH, "EVPN Neighbor"); DEFINE_MTYPE_STATIC(ZEBRA, ZVXLAN_SG, "zebra VxLAN multicast group"); -DEFINE_HOOK(zebra_rmac_update, (zebra_mac_t *rmac, zebra_l3vni_t *zl3vni, - bool delete, const char *reason), (rmac, zl3vni, delete, reason)); +DEFINE_HOOK(zebra_rmac_update, + (struct zebra_mac * rmac, struct zebra_l3vni *zl3vni, bool delete, + const char *reason), + (rmac, zl3vni, delete, reason)); /* static function declarations */ static void zevpn_print_neigh_hash_all_evpn(struct hash_bucket *bucket, void **args); -static void zl3vni_print_nh(zebra_neigh_t *n, struct vty *vty, +static void zl3vni_print_nh(struct zebra_neigh *n, struct vty *vty, json_object *json); -static void zl3vni_print_rmac(zebra_mac_t *zrmac, struct vty *vty, +static void zl3vni_print_rmac(struct zebra_mac *zrmac, struct vty *vty, json_object *json); static void zevpn_print_mac_hash_all_evpn(struct hash_bucket *bucket, void *ctxt); /* l3-vni next-hop neigh related APIs */ -static zebra_neigh_t *zl3vni_nh_lookup(zebra_l3vni_t *zl3vni, - const struct ipaddr *ip); +static struct zebra_neigh *zl3vni_nh_lookup(struct zebra_l3vni *zl3vni, + const struct ipaddr *ip); static void *zl3vni_nh_alloc(void *p); -static zebra_neigh_t *zl3vni_nh_add(zebra_l3vni_t *zl3vni, - const struct ipaddr *vtep_ip, - const struct ethaddr *rmac); -static int zl3vni_nh_del(zebra_l3vni_t *zl3vni, zebra_neigh_t *n); -static int zl3vni_nh_install(zebra_l3vni_t *zl3vni, zebra_neigh_t *n); -static int zl3vni_nh_uninstall(zebra_l3vni_t *zl3vni, zebra_neigh_t *n); +static struct zebra_neigh *zl3vni_nh_add(struct zebra_l3vni *zl3vni, + const struct ipaddr *vtep_ip, + const struct ethaddr *rmac); +static int zl3vni_nh_del(struct zebra_l3vni *zl3vni, struct zebra_neigh *n); +static int zl3vni_nh_install(struct zebra_l3vni *zl3vni, struct zebra_neigh *n); +static int zl3vni_nh_uninstall(struct zebra_l3vni *zl3vni, + struct zebra_neigh *n); /* l3-vni rmac related APIs */ static void zl3vni_print_rmac_hash(struct hash_bucket *, void *); -static zebra_mac_t *zl3vni_rmac_lookup(zebra_l3vni_t *zl3vni, - const struct ethaddr *rmac); +static struct zebra_mac *zl3vni_rmac_lookup(struct zebra_l3vni *zl3vni, + const struct ethaddr *rmac); static void *zl3vni_rmac_alloc(void *p); -static zebra_mac_t *zl3vni_rmac_add(zebra_l3vni_t *zl3vni, - const struct ethaddr *rmac); -static int zl3vni_rmac_del(zebra_l3vni_t *zl3vni, zebra_mac_t *zrmac); -static int zl3vni_rmac_install(zebra_l3vni_t *zl3vni, zebra_mac_t *zrmac); -static int zl3vni_rmac_uninstall(zebra_l3vni_t *zl3vni, zebra_mac_t *zrmac); +static struct zebra_mac *zl3vni_rmac_add(struct zebra_l3vni *zl3vni, + const struct ethaddr *rmac); +static int zl3vni_rmac_del(struct zebra_l3vni *zl3vni, struct zebra_mac *zrmac); +static int zl3vni_rmac_install(struct zebra_l3vni *zl3vni, + struct zebra_mac *zrmac); +static int zl3vni_rmac_uninstall(struct zebra_l3vni *zl3vni, + struct zebra_mac *zrmac); /* l3-vni related APIs*/ static void *zl3vni_alloc(void *p); -static zebra_l3vni_t *zl3vni_add(vni_t vni, vrf_id_t vrf_id); -static int zl3vni_del(zebra_l3vni_t *zl3vni); -static void zebra_vxlan_process_l3vni_oper_up(zebra_l3vni_t *zl3vni); -static void zebra_vxlan_process_l3vni_oper_down(zebra_l3vni_t *zl3vni); +static struct zebra_l3vni *zl3vni_add(vni_t vni, vrf_id_t vrf_id); +static int zl3vni_del(struct zebra_l3vni *zl3vni); +static void zebra_vxlan_process_l3vni_oper_up(struct zebra_l3vni *zl3vni); +static void zebra_vxlan_process_l3vni_oper_down(struct zebra_l3vni *zl3vni); static void zevpn_build_hash_table(void); static unsigned int zebra_vxlan_sg_hash_key_make(const void *p); static bool zebra_vxlan_sg_hash_eq(const void *p1, const void *p2); static void zebra_vxlan_sg_do_deref(struct zebra_vrf *zvrf, struct in_addr sip, struct in_addr mcast_grp); -static zebra_vxlan_sg_t *zebra_vxlan_sg_do_ref(struct zebra_vrf *vrf, - struct in_addr sip, struct in_addr mcast_grp); +static struct zebra_vxlan_sg *zebra_vxlan_sg_do_ref(struct zebra_vrf *vrf, + struct in_addr sip, + struct in_addr mcast_grp); static void zebra_vxlan_sg_deref(struct in_addr local_vtep_ip, struct in_addr mcast_grp); static void zebra_vxlan_sg_ref(struct in_addr local_vtep_ip, @@ -200,7 +206,7 @@ static void zevpn_print_neigh_hash_all_evpn(struct hash_bucket *bucket, { struct vty *vty; json_object *json = NULL, *json_evpn = NULL; - zebra_evpn_t *zevpn; + struct zebra_evpn *zevpn; uint32_t num_neigh; struct neigh_walk_ctx wctx; char vni_str[VNI_STR_LEN]; @@ -210,7 +216,7 @@ static void zevpn_print_neigh_hash_all_evpn(struct hash_bucket *bucket, json = (json_object *)args[1]; print_dup = (uint32_t)(uintptr_t)args[2]; - zevpn = (zebra_evpn_t *)bucket->data; + zevpn = (struct zebra_evpn *)bucket->data; num_neigh = hashcount(zevpn->neigh_table); @@ -267,7 +273,7 @@ static void zevpn_print_neigh_hash_all_evpn_detail(struct hash_bucket *bucket, { struct vty *vty; json_object *json = NULL, *json_evpn = NULL; - zebra_evpn_t *zevpn; + struct zebra_evpn *zevpn; uint32_t num_neigh; struct neigh_walk_ctx wctx; char vni_str[VNI_STR_LEN]; @@ -277,7 +283,7 @@ static void zevpn_print_neigh_hash_all_evpn_detail(struct hash_bucket *bucket, json = (json_object *)args[1]; print_dup = (uint32_t)(uintptr_t)args[2]; - zevpn = (zebra_evpn_t *)bucket->data; + zevpn = (struct zebra_evpn *)bucket->data; if (!zevpn) { if (json) vty_out(vty, "{}\n"); @@ -321,7 +327,7 @@ static void zevpn_print_neigh_hash_all_evpn_detail(struct hash_bucket *bucket, } /* print a specific next hop for an l3vni */ -static void zl3vni_print_nh(zebra_neigh_t *n, struct vty *vty, +static void zl3vni_print_nh(struct zebra_neigh *n, struct vty *vty, json_object *json) { char buf1[ETHER_ADDR_STRLEN]; @@ -357,7 +363,7 @@ static void zl3vni_print_nh(zebra_neigh_t *n, struct vty *vty, } /* Print a specific RMAC entry */ -static void zl3vni_print_rmac(zebra_mac_t *zrmac, struct vty *vty, +static void zl3vni_print_rmac(struct zebra_mac *zrmac, struct vty *vty, json_object *json) { char buf1[ETHER_ADDR_STRLEN]; @@ -402,7 +408,7 @@ static void zevpn_print_mac_hash_all_evpn(struct hash_bucket *bucket, void *ctxt struct vty *vty; json_object *json = NULL, *json_evpn = NULL; json_object *json_mac = NULL; - zebra_evpn_t *zevpn; + struct zebra_evpn *zevpn; uint32_t num_macs; struct mac_walk_ctx *wctx = ctxt; char vni_str[VNI_STR_LEN]; @@ -410,7 +416,7 @@ static void zevpn_print_mac_hash_all_evpn(struct hash_bucket *bucket, void *ctxt vty = wctx->vty; json = wctx->json; - zevpn = (zebra_evpn_t *)bucket->data; + zevpn = (struct zebra_evpn *)bucket->data; wctx->zevpn = zevpn; /*We are iterating over a new VNI, set the count to 0*/ @@ -477,7 +483,7 @@ static void zevpn_print_mac_hash_all_evpn_detail(struct hash_bucket *bucket, struct vty *vty; json_object *json = NULL, *json_evpn = NULL; json_object *json_mac = NULL; - zebra_evpn_t *zevpn; + struct zebra_evpn *zevpn; uint32_t num_macs; struct mac_walk_ctx *wctx = ctxt; char vni_str[VNI_STR_LEN]; @@ -485,7 +491,7 @@ static void zevpn_print_mac_hash_all_evpn_detail(struct hash_bucket *bucket, vty = wctx->vty; json = wctx->json; - zevpn = (zebra_evpn_t *)bucket->data; + zevpn = (struct zebra_evpn *)bucket->data; if (!zevpn) { if (json) vty_out(vty, "{}\n"); @@ -541,7 +547,7 @@ static void zl3vni_print_nh_hash(struct hash_bucket *bucket, void *ctx) struct vty *vty = NULL; struct json_object *json_evpn = NULL; struct json_object *json_nh = NULL; - zebra_neigh_t *n = NULL; + struct zebra_neigh *n = NULL; char buf1[ETHER_ADDR_STRLEN]; char buf2[INET6_ADDRSTRLEN]; @@ -550,7 +556,7 @@ static void zl3vni_print_nh_hash(struct hash_bucket *bucket, void *ctx) json_evpn = wctx->json; if (json_evpn) json_nh = json_object_new_object(); - n = (zebra_neigh_t *)bucket->data; + n = (struct zebra_neigh *)bucket->data; if (!json_evpn) { vty_out(vty, "%-15s %-17s\n", @@ -574,7 +580,7 @@ static void zl3vni_print_nh_hash_all_vni(struct hash_bucket *bucket, struct vty *vty = NULL; json_object *json = NULL; json_object *json_evpn = NULL; - zebra_l3vni_t *zl3vni = NULL; + struct zebra_l3vni *zl3vni = NULL; uint32_t num_nh = 0; struct nh_walk_ctx wctx; char vni_str[VNI_STR_LEN]; @@ -582,7 +588,7 @@ static void zl3vni_print_nh_hash_all_vni(struct hash_bucket *bucket, vty = (struct vty *)args[0]; json = (struct json_object *)args[1]; - zl3vni = (zebra_l3vni_t *)bucket->data; + zl3vni = (struct zebra_l3vni *)bucket->data; num_nh = hashcount(zl3vni->nh_table); if (!num_nh) @@ -613,7 +619,7 @@ static void zl3vni_print_rmac_hash_all_vni(struct hash_bucket *bucket, struct vty *vty = NULL; json_object *json = NULL; json_object *json_evpn = NULL; - zebra_l3vni_t *zl3vni = NULL; + struct zebra_l3vni *zl3vni = NULL; uint32_t num_rmacs; struct rmac_walk_ctx wctx; char vni_str[VNI_STR_LEN]; @@ -621,7 +627,7 @@ static void zl3vni_print_rmac_hash_all_vni(struct hash_bucket *bucket, vty = (struct vty *)args[0]; json = (struct json_object *)args[1]; - zl3vni = (zebra_l3vni_t *)bucket->data; + zl3vni = (struct zebra_l3vni *)bucket->data; num_rmacs = hashcount(zl3vni->rmac_table); if (!num_rmacs) @@ -652,7 +658,7 @@ static void zl3vni_print_rmac_hash_all_vni(struct hash_bucket *bucket, static void zl3vni_print_rmac_hash(struct hash_bucket *bucket, void *ctx) { - zebra_mac_t *zrmac = NULL; + struct zebra_mac *zrmac = NULL; struct rmac_walk_ctx *wctx = NULL; struct vty *vty = NULL; struct json_object *json = NULL; @@ -664,7 +670,7 @@ static void zl3vni_print_rmac_hash(struct hash_bucket *bucket, void *ctx) json = wctx->json; if (json) json_rmac = json_object_new_object(); - zrmac = (zebra_mac_t *)bucket->data; + zrmac = (struct zebra_mac *)bucket->data; if (!json) { vty_out(vty, "%-17s %-21pI4\n", @@ -685,12 +691,12 @@ static void zl3vni_print_rmac_hash(struct hash_bucket *bucket, void *ctx) } /* print a specific L3 VNI entry */ -static void zl3vni_print(zebra_l3vni_t *zl3vni, void **ctx) +static void zl3vni_print(struct zebra_l3vni *zl3vni, void **ctx) { char buf[PREFIX_STRLEN]; struct vty *vty = NULL; json_object *json = NULL; - zebra_evpn_t *zevpn = NULL; + struct zebra_evpn *zevpn = NULL; json_object *json_evpn_list = NULL; struct listnode *node = NULL, *nnode = NULL; @@ -758,12 +764,12 @@ static void zl3vni_print_hash(struct hash_bucket *bucket, void *ctx[]) struct vty *vty = NULL; json_object *json = NULL; json_object *json_evpn = NULL; - zebra_l3vni_t *zl3vni = NULL; + struct zebra_l3vni *zl3vni = NULL; vty = (struct vty *)ctx[0]; json = (json_object *)ctx[1]; - zl3vni = (zebra_l3vni_t *)bucket->data; + zl3vni = (struct zebra_l3vni *)bucket->data; if (!json) { vty_out(vty, "%-10u %-4s %-21s %-8lu %-8lu %-15s %-37s\n", @@ -795,7 +801,7 @@ static void zl3vni_print_hash(struct hash_bucket *bucket, void *ctx[]) static void zl3vni_print_hash_detail(struct hash_bucket *bucket, void *data) { struct vty *vty = NULL; - zebra_l3vni_t *zl3vni = NULL; + struct zebra_l3vni *zl3vni = NULL; json_object *json_array = NULL; bool use_json = false; struct zebra_evpn_show *zes = data; @@ -804,7 +810,7 @@ static void zl3vni_print_hash_detail(struct hash_bucket *bucket, void *data) json_array = zes->json; use_json = zes->use_json; - zl3vni = (zebra_l3vni_t *)bucket->data; + zl3vni = (struct zebra_l3vni *)bucket->data; zebra_vxlan_print_vni(vty, zes->zvrf, zl3vni->vni, use_json, json_array); @@ -887,7 +893,7 @@ struct interface *zvni_map_to_svi(vlanid_t vid, struct interface *br_if) return tmp_if; } -static int zebra_evpn_vxlan_del(zebra_evpn_t *zevpn) +static int zebra_evpn_vxlan_del(struct zebra_evpn *zevpn) { zevpn_vxlan_if_set(zevpn, zevpn->vxlan_if, false /* set */); @@ -914,8 +920,8 @@ static int zevpn_build_hash_table_zns(struct ns *ns, /* Walk VxLAN interfaces and create EVPN hash. */ for (rn = route_top(zns->if_table); rn; rn = route_next(rn)) { vni_t vni; - zebra_evpn_t *zevpn = NULL; - zebra_l3vni_t *zl3vni = NULL; + struct zebra_evpn *zevpn = NULL; + struct zebra_l3vni *zl3vni = NULL; struct zebra_if *zif; struct zebra_l2info_vxlan *vxl; @@ -1068,11 +1074,11 @@ static void zevpn_build_hash_table(void) */ static void zebra_evpn_vxlan_cleanup_all(struct hash_bucket *bucket, void *arg) { - zebra_evpn_t *zevpn = NULL; - zebra_l3vni_t *zl3vni = NULL; + struct zebra_evpn *zevpn = NULL; + struct zebra_l3vni *zl3vni = NULL; struct zebra_vrf *zvrf = (struct zebra_vrf *)arg; - zevpn = (zebra_evpn_t *)bucket->data; + zevpn = (struct zebra_evpn *)bucket->data; /* remove from l3-vni list */ if (zvrf->l3vni) @@ -1086,9 +1092,9 @@ static void zebra_evpn_vxlan_cleanup_all(struct hash_bucket *bucket, void *arg) /* cleanup L3VNI */ static void zl3vni_cleanup_all(struct hash_bucket *bucket, void *args) { - zebra_l3vni_t *zl3vni = NULL; + struct zebra_l3vni *zl3vni = NULL; - zl3vni = (zebra_l3vni_t *)bucket->data; + zl3vni = (struct zebra_l3vni *)bucket->data; zebra_vxlan_process_l3vni_oper_down(zl3vni); } @@ -1132,11 +1138,11 @@ static void rb_delete_host(struct host_rb_tree_entry *hrbe, struct prefix *host) /* * Look up MAC hash entry. */ -static zebra_mac_t *zl3vni_rmac_lookup(zebra_l3vni_t *zl3vni, - const struct ethaddr *rmac) +static struct zebra_mac *zl3vni_rmac_lookup(struct zebra_l3vni *zl3vni, + const struct ethaddr *rmac) { - zebra_mac_t tmp; - zebra_mac_t *pmac; + struct zebra_mac tmp; + struct zebra_mac *pmac; memset(&tmp, 0, sizeof(tmp)); memcpy(&tmp.macaddr, rmac, ETH_ALEN); @@ -1150,10 +1156,10 @@ static zebra_mac_t *zl3vni_rmac_lookup(zebra_l3vni_t *zl3vni, */ static void *zl3vni_rmac_alloc(void *p) { - const zebra_mac_t *tmp_rmac = p; - zebra_mac_t *zrmac; + const struct zebra_mac *tmp_rmac = p; + struct zebra_mac *zrmac; - zrmac = XCALLOC(MTYPE_L3VNI_MAC, sizeof(zebra_mac_t)); + zrmac = XCALLOC(MTYPE_L3VNI_MAC, sizeof(struct zebra_mac)); *zrmac = *tmp_rmac; return ((void *)zrmac); @@ -1162,13 +1168,13 @@ static void *zl3vni_rmac_alloc(void *p) /* * Add RMAC entry to l3-vni */ -static zebra_mac_t *zl3vni_rmac_add(zebra_l3vni_t *zl3vni, - const struct ethaddr *rmac) +static struct zebra_mac *zl3vni_rmac_add(struct zebra_l3vni *zl3vni, + const struct ethaddr *rmac) { - zebra_mac_t tmp_rmac; - zebra_mac_t *zrmac = NULL; + struct zebra_mac tmp_rmac; + struct zebra_mac *zrmac = NULL; - memset(&tmp_rmac, 0, sizeof(zebra_mac_t)); + memset(&tmp_rmac, 0, sizeof(struct zebra_mac)); memcpy(&tmp_rmac.macaddr, rmac, ETH_ALEN); zrmac = hash_get(zl3vni->rmac_table, &tmp_rmac, zl3vni_rmac_alloc); assert(zrmac); @@ -1184,9 +1190,9 @@ static zebra_mac_t *zl3vni_rmac_add(zebra_l3vni_t *zl3vni, /* * Delete MAC entry. */ -static int zl3vni_rmac_del(zebra_l3vni_t *zl3vni, zebra_mac_t *zrmac) +static int zl3vni_rmac_del(struct zebra_l3vni *zl3vni, struct zebra_mac *zrmac) { - zebra_mac_t *tmp_rmac; + struct zebra_mac *tmp_rmac; struct host_rb_entry *hle; while (!RB_EMPTY(host_rb_tree_entry, &zrmac->host_rb)) { @@ -1205,7 +1211,8 @@ static int zl3vni_rmac_del(zebra_l3vni_t *zl3vni, zebra_mac_t *zrmac) /* * Install remote RMAC into the forwarding plane. */ -static int zl3vni_rmac_install(zebra_l3vni_t *zl3vni, zebra_mac_t *zrmac) +static int zl3vni_rmac_install(struct zebra_l3vni *zl3vni, + struct zebra_mac *zrmac) { const struct zebra_if *zif = NULL, *br_zif = NULL; const struct zebra_l2info_vxlan *vxl = NULL; @@ -1246,7 +1253,8 @@ static int zl3vni_rmac_install(zebra_l3vni_t *zl3vni, zebra_mac_t *zrmac) /* * Uninstall remote RMAC from the forwarding plane. */ -static int zl3vni_rmac_uninstall(zebra_l3vni_t *zl3vni, zebra_mac_t *zrmac) +static int zl3vni_rmac_uninstall(struct zebra_l3vni *zl3vni, + struct zebra_mac *zrmac) { const struct zebra_if *zif = NULL, *br_zif; const struct zebra_l2info_vxlan *vxl = NULL; @@ -1291,12 +1299,12 @@ static int zl3vni_rmac_uninstall(zebra_l3vni_t *zl3vni, zebra_mac_t *zrmac) } /* handle rmac add */ -static int zl3vni_remote_rmac_add(zebra_l3vni_t *zl3vni, +static int zl3vni_remote_rmac_add(struct zebra_l3vni *zl3vni, const struct ethaddr *rmac, const struct ipaddr *vtep_ip, const struct prefix *host_prefix) { - zebra_mac_t *zrmac = NULL; + struct zebra_mac *zrmac = NULL; zrmac = zl3vni_rmac_lookup(zl3vni, rmac); if (!zrmac) { @@ -1339,8 +1347,9 @@ static int zl3vni_remote_rmac_add(zebra_l3vni_t *zl3vni, /* handle rmac delete */ -static void zl3vni_remote_rmac_del(zebra_l3vni_t *zl3vni, zebra_mac_t *zrmac, - struct prefix *host_prefix) +static void zl3vni_remote_rmac_del(struct zebra_l3vni *zl3vni, + struct zebra_mac *zrmac, + struct prefix *host_prefix) { rb_delete_host(&zrmac->host_rb, host_prefix); @@ -1360,11 +1369,11 @@ static void zl3vni_remote_rmac_del(zebra_l3vni_t *zl3vni, zebra_mac_t *zrmac, /* * Look up nh hash entry on a l3-vni. */ -static zebra_neigh_t *zl3vni_nh_lookup(zebra_l3vni_t *zl3vni, - const struct ipaddr *ip) +static struct zebra_neigh *zl3vni_nh_lookup(struct zebra_l3vni *zl3vni, + const struct ipaddr *ip) { - zebra_neigh_t tmp; - zebra_neigh_t *n; + struct zebra_neigh tmp; + struct zebra_neigh *n; memset(&tmp, 0, sizeof(tmp)); memcpy(&tmp.ip, ip, sizeof(struct ipaddr)); @@ -1379,10 +1388,10 @@ static zebra_neigh_t *zl3vni_nh_lookup(zebra_l3vni_t *zl3vni, */ static void *zl3vni_nh_alloc(void *p) { - const zebra_neigh_t *tmp_n = p; - zebra_neigh_t *n; + const struct zebra_neigh *tmp_n = p; + struct zebra_neigh *n; - n = XCALLOC(MTYPE_L3NEIGH, sizeof(zebra_neigh_t)); + n = XCALLOC(MTYPE_L3NEIGH, sizeof(struct zebra_neigh)); *n = *tmp_n; return ((void *)n); @@ -1391,14 +1400,14 @@ static void *zl3vni_nh_alloc(void *p) /* * Add neighbor entry. */ -static zebra_neigh_t *zl3vni_nh_add(zebra_l3vni_t *zl3vni, - const struct ipaddr *ip, - const struct ethaddr *mac) +static struct zebra_neigh *zl3vni_nh_add(struct zebra_l3vni *zl3vni, + const struct ipaddr *ip, + const struct ethaddr *mac) { - zebra_neigh_t tmp_n; - zebra_neigh_t *n = NULL; + struct zebra_neigh tmp_n; + struct zebra_neigh *n = NULL; - memset(&tmp_n, 0, sizeof(zebra_neigh_t)); + memset(&tmp_n, 0, sizeof(struct zebra_neigh)); memcpy(&tmp_n.ip, ip, sizeof(struct ipaddr)); n = hash_get(zl3vni->nh_table, &tmp_n, zl3vni_nh_alloc); assert(n); @@ -1415,9 +1424,9 @@ static zebra_neigh_t *zl3vni_nh_add(zebra_l3vni_t *zl3vni, /* * Delete neighbor entry. */ -static int zl3vni_nh_del(zebra_l3vni_t *zl3vni, zebra_neigh_t *n) +static int zl3vni_nh_del(struct zebra_l3vni *zl3vni, struct zebra_neigh *n) { - zebra_neigh_t *tmp_n; + struct zebra_neigh *tmp_n; struct host_rb_entry *hle; while (!RB_EMPTY(host_rb_tree_entry, &n->host_rb)) { @@ -1436,7 +1445,7 @@ static int zl3vni_nh_del(zebra_l3vni_t *zl3vni, zebra_neigh_t *n) /* * Install remote nh as neigh into the kernel. */ -static int zl3vni_nh_install(zebra_l3vni_t *zl3vni, zebra_neigh_t *n) +static int zl3vni_nh_install(struct zebra_l3vni *zl3vni, struct zebra_neigh *n) { uint8_t flags; int ret = 0; @@ -1461,7 +1470,8 @@ static int zl3vni_nh_install(zebra_l3vni_t *zl3vni, zebra_neigh_t *n) /* * Uninstall remote nh from the kernel. */ -static int zl3vni_nh_uninstall(zebra_l3vni_t *zl3vni, zebra_neigh_t *n) +static int zl3vni_nh_uninstall(struct zebra_l3vni *zl3vni, + struct zebra_neigh *n) { if (!(n->flags & ZEBRA_NEIGH_REMOTE) || !(n->flags & ZEBRA_NEIGH_REMOTE_NH)) @@ -1476,12 +1486,12 @@ static int zl3vni_nh_uninstall(zebra_l3vni_t *zl3vni, zebra_neigh_t *n) } /* add remote vtep as a neigh entry */ -static int zl3vni_remote_nh_add(zebra_l3vni_t *zl3vni, +static int zl3vni_remote_nh_add(struct zebra_l3vni *zl3vni, const struct ipaddr *vtep_ip, const struct ethaddr *rmac, const struct prefix *host_prefix) { - zebra_neigh_t *nh = NULL; + struct zebra_neigh *nh = NULL; /* Create the next hop entry, or update its mac, if necessary. */ nh = zl3vni_nh_lookup(zl3vni, vtep_ip); @@ -1514,7 +1524,8 @@ static int zl3vni_remote_nh_add(zebra_l3vni_t *zl3vni, } /* handle nh neigh delete */ -static void zl3vni_remote_nh_del(zebra_l3vni_t *zl3vni, zebra_neigh_t *nh, +static void zl3vni_remote_nh_del(struct zebra_l3vni *zl3vni, + struct zebra_neigh *nh, struct prefix *host_prefix) { rb_delete_host(&nh->host_rb, host_prefix); @@ -1531,11 +1542,11 @@ static void zl3vni_remote_nh_del(zebra_l3vni_t *zl3vni, zebra_neigh_t *nh, /* handle neigh update from kernel - the only thing of interest is to * readd stale entries. */ -static int zl3vni_local_nh_add_update(zebra_l3vni_t *zl3vni, struct ipaddr *ip, - uint16_t state) +static int zl3vni_local_nh_add_update(struct zebra_l3vni *zl3vni, + struct ipaddr *ip, uint16_t state) { #ifdef GNU_LINUX - zebra_neigh_t *n = NULL; + struct zebra_neigh *n = NULL; n = zl3vni_nh_lookup(zl3vni, ip); if (!n) @@ -1551,9 +1562,9 @@ static int zl3vni_local_nh_add_update(zebra_l3vni_t *zl3vni, struct ipaddr *ip, } /* handle neigh delete from kernel */ -static int zl3vni_local_nh_del(zebra_l3vni_t *zl3vni, struct ipaddr *ip) +static int zl3vni_local_nh_del(struct zebra_l3vni *zl3vni, struct ipaddr *ip) { - zebra_neigh_t *n = NULL; + struct zebra_neigh *n = NULL; n = zl3vni_nh_lookup(zl3vni, ip); if (!n) @@ -1573,7 +1584,7 @@ static int zl3vni_local_nh_del(zebra_l3vni_t *zl3vni, struct ipaddr *ip) */ static unsigned int l3vni_hash_keymake(const void *p) { - const zebra_l3vni_t *zl3vni = p; + const struct zebra_l3vni *zl3vni = p; return jhash_1word(zl3vni->vni, 0); } @@ -1583,8 +1594,8 @@ static unsigned int l3vni_hash_keymake(const void *p) */ static bool l3vni_hash_cmp(const void *p1, const void *p2) { - const zebra_l3vni_t *zl3vni1 = p1; - const zebra_l3vni_t *zl3vni2 = p2; + const struct zebra_l3vni *zl3vni1 = p1; + const struct zebra_l3vni *zl3vni2 = p2; return (zl3vni1->vni == zl3vni2->vni); } @@ -1594,10 +1605,10 @@ static bool l3vni_hash_cmp(const void *p1, const void *p2) */ static void *zl3vni_alloc(void *p) { - zebra_l3vni_t *zl3vni = NULL; - const zebra_l3vni_t *tmp_l3vni = p; + struct zebra_l3vni *zl3vni = NULL; + const struct zebra_l3vni *tmp_l3vni = p; - zl3vni = XCALLOC(MTYPE_ZL3VNI, sizeof(zebra_l3vni_t)); + zl3vni = XCALLOC(MTYPE_ZL3VNI, sizeof(struct zebra_l3vni)); zl3vni->vni = tmp_l3vni->vni; return ((void *)zl3vni); } @@ -1605,12 +1616,12 @@ static void *zl3vni_alloc(void *p) /* * Look up L3 VNI hash entry. */ -zebra_l3vni_t *zl3vni_lookup(vni_t vni) +struct zebra_l3vni *zl3vni_lookup(vni_t vni) { - zebra_l3vni_t tmp_l3vni; - zebra_l3vni_t *zl3vni = NULL; + struct zebra_l3vni tmp_l3vni; + struct zebra_l3vni *zl3vni = NULL; - memset(&tmp_l3vni, 0, sizeof(zebra_l3vni_t)); + memset(&tmp_l3vni, 0, sizeof(struct zebra_l3vni)); tmp_l3vni.vni = vni; zl3vni = hash_lookup(zrouter.l3vni_table, &tmp_l3vni); @@ -1620,12 +1631,12 @@ zebra_l3vni_t *zl3vni_lookup(vni_t vni) /* * Add L3 VNI hash entry. */ -static zebra_l3vni_t *zl3vni_add(vni_t vni, vrf_id_t vrf_id) +static struct zebra_l3vni *zl3vni_add(vni_t vni, vrf_id_t vrf_id) { - zebra_l3vni_t tmp_zl3vni; - zebra_l3vni_t *zl3vni = NULL; + struct zebra_l3vni tmp_zl3vni; + struct zebra_l3vni *zl3vni = NULL; - memset(&tmp_zl3vni, 0, sizeof(zebra_l3vni_t)); + memset(&tmp_zl3vni, 0, sizeof(struct zebra_l3vni)); tmp_zl3vni.vni = vni; zl3vni = hash_get(zrouter.l3vni_table, &tmp_zl3vni, zl3vni_alloc); @@ -1649,9 +1660,9 @@ static zebra_l3vni_t *zl3vni_add(vni_t vni, vrf_id_t vrf_id) /* * Delete L3 VNI hash entry. */ -static int zl3vni_del(zebra_l3vni_t *zl3vni) +static int zl3vni_del(struct zebra_l3vni *zl3vni) { - zebra_l3vni_t *tmp_zl3vni; + struct zebra_l3vni *tmp_zl3vni; /* free the list of l2vnis */ list_delete(&zl3vni->l2vnis); @@ -1677,7 +1688,7 @@ static int zl3vni_map_to_vxlan_if_ns(struct ns *ns, void **_pifp) { struct zebra_ns *zns = ns->info; - zebra_l3vni_t *zl3vni = (zebra_l3vni_t *)_zl3vni; + struct zebra_l3vni *zl3vni = (struct zebra_l3vni *)_zl3vni; struct route_node *rn = NULL; struct interface *ifp = NULL; struct zebra_vrf *zvrf; @@ -1725,7 +1736,7 @@ static int zl3vni_map_to_vxlan_if_ns(struct ns *ns, return NS_WALK_CONTINUE; } -struct interface *zl3vni_map_to_vxlan_if(zebra_l3vni_t *zl3vni) +struct interface *zl3vni_map_to_vxlan_if(struct zebra_l3vni *zl3vni) { struct interface **p_ifp; struct interface *ifp = NULL; @@ -1737,7 +1748,7 @@ struct interface *zl3vni_map_to_vxlan_if(zebra_l3vni_t *zl3vni) return ifp; } -struct interface *zl3vni_map_to_svi_if(zebra_l3vni_t *zl3vni) +struct interface *zl3vni_map_to_svi_if(struct zebra_l3vni *zl3vni) { struct zebra_if *zif = NULL; /* zebra_if for vxlan_if */ struct zebra_l2info_vxlan *vxl = NULL; /* l2 info for vxlan_if */ @@ -1757,7 +1768,7 @@ struct interface *zl3vni_map_to_svi_if(zebra_l3vni_t *zl3vni) return zvni_map_to_svi(vxl->access_vlan, zif->brslave_info.br_if); } -struct interface *zl3vni_map_to_mac_vlan_if(zebra_l3vni_t *zl3vni) +struct interface *zl3vni_map_to_mac_vlan_if(struct zebra_l3vni *zl3vni) { struct zebra_if *zif = NULL; /* zebra_if for vxlan_if */ @@ -1776,7 +1787,7 @@ struct interface *zl3vni_map_to_mac_vlan_if(zebra_l3vni_t *zl3vni) } -zebra_l3vni_t *zl3vni_from_vrf(vrf_id_t vrf_id) +struct zebra_l3vni *zl3vni_from_vrf(vrf_id_t vrf_id) { struct zebra_vrf *zvrf = NULL; @@ -1787,23 +1798,63 @@ zebra_l3vni_t *zl3vni_from_vrf(vrf_id_t vrf_id) return zl3vni_lookup(zvrf->l3vni); } +static int zl3vni_from_svi_ns(struct ns *ns, void *_in_param, void **_p_zl3vni) +{ + int found = 0; + struct zebra_ns *zns = ns->info; + struct zebra_l3vni **p_zl3vni = (struct zebra_l3vni **)_p_zl3vni; + struct zebra_from_svi_param *in_param = + (struct zebra_from_svi_param *)_in_param; + struct route_node *rn = NULL; + struct interface *tmp_if = NULL; + struct zebra_if *zif = NULL; + struct zebra_l2info_vxlan *vxl = NULL; + + if (!in_param) + return NS_WALK_STOP; + + /* loop through all vxlan-interface */ + for (rn = route_top(zns->if_table); rn; rn = route_next(rn)) { + tmp_if = (struct interface *)rn->info; + if (!tmp_if) + continue; + zif = tmp_if->info; + if (!zif || zif->zif_type != ZEBRA_IF_VXLAN) + continue; + if (!if_is_operative(tmp_if)) + continue; + vxl = &zif->l2info.vxl; + + if (zif->brslave_info.br_if != in_param->br_if) + continue; + + if (!in_param->bridge_vlan_aware + || vxl->access_vlan == in_param->vid) { + found = 1; + break; + } + } + + if (!found) + return NS_WALK_CONTINUE; + + if (p_zl3vni) + *p_zl3vni = zl3vni_lookup(vxl->vni); + return NS_WALK_STOP; +} + /* * Map SVI and associated bridge to a VNI. This is invoked upon getting * neighbor notifications, to see if they are of interest. */ -static zebra_l3vni_t *zl3vni_from_svi(struct interface *ifp, - struct interface *br_if) +static struct zebra_l3vni *zl3vni_from_svi(struct interface *ifp, + struct interface *br_if) { - int found = 0; - vlanid_t vid = 0; - uint8_t bridge_vlan_aware = 0; - zebra_l3vni_t *zl3vni = NULL; - struct zebra_ns *zns = NULL; - struct route_node *rn = NULL; + struct zebra_l3vni *zl3vni = NULL; struct zebra_if *zif = NULL; - struct interface *tmp_if = NULL; struct zebra_l2info_bridge *br = NULL; - struct zebra_l2info_vxlan *vxl = NULL; + struct zebra_from_svi_param in_param = {}; + struct zebra_l3vni **p_zl3vni; if (!br_if) return NULL; @@ -1811,13 +1862,14 @@ static zebra_l3vni_t *zl3vni_from_svi(struct interface *ifp, /* Make sure the linked interface is a bridge. */ if (!IS_ZEBRA_IF_BRIDGE(br_if)) return NULL; + in_param.br_if = br_if; /* Determine if bridge is VLAN-aware or not */ zif = br_if->info; assert(zif); br = &zif->l2info.br; - bridge_vlan_aware = br->vlan_aware; - if (bridge_vlan_aware) { + in_param.bridge_vlan_aware = br->vlan_aware; + if (in_param.bridge_vlan_aware) { struct zebra_l2info_vlan *vl; if (!IS_ZEBRA_IF_VLAN(ifp)) @@ -1826,44 +1878,23 @@ static zebra_l3vni_t *zl3vni_from_svi(struct interface *ifp, zif = ifp->info; assert(zif); vl = &zif->l2info.vl; - vid = vl->vid; + in_param.vid = vl->vid; } /* See if this interface (or interface plus VLAN Id) maps to a VxLAN */ /* TODO: Optimize with a hash. */ - zns = zebra_ns_lookup(NS_DEFAULT); - for (rn = route_top(zns->if_table); rn; rn = route_next(rn)) { - tmp_if = (struct interface *)rn->info; - if (!tmp_if) - continue; - zif = tmp_if->info; - if (!zif || zif->zif_type != ZEBRA_IF_VXLAN) - continue; - if (!if_is_operative(tmp_if)) - continue; - vxl = &zif->l2info.vxl; - if (zif->brslave_info.br_if != br_if) - continue; + p_zl3vni = &zl3vni; - if (!bridge_vlan_aware || vxl->access_vlan == vid) { - found = 1; - break; - } - } - - if (!found) - return NULL; - - zl3vni = zl3vni_lookup(vxl->vni); + ns_walk_func(zl3vni_from_svi_ns, (void *)&in_param, (void **)p_zl3vni); return zl3vni; } vni_t vni_id_from_svi(struct interface *ifp, struct interface *br_if) { vni_t vni = 0; - zebra_evpn_t *zevpn = NULL; - zebra_l3vni_t *zl3vni = NULL; + struct zebra_evpn *zevpn = NULL; + struct zebra_l3vni *zl3vni = NULL; /* Check if an L3VNI belongs to this SVI interface. * If not, check if an L2VNI belongs to this SVI interface. @@ -1880,7 +1911,7 @@ vni_t vni_id_from_svi(struct interface *ifp, struct interface *br_if) return vni; } -static inline void zl3vni_get_vrr_rmac(zebra_l3vni_t *zl3vni, +static inline void zl3vni_get_vrr_rmac(struct zebra_l3vni *zl3vni, struct ethaddr *rmac) { if (!zl3vni) @@ -1896,7 +1927,7 @@ static inline void zl3vni_get_vrr_rmac(zebra_l3vni_t *zl3vni, /* * Inform BGP about l3-vni. */ -static int zl3vni_send_add_to_client(zebra_l3vni_t *zl3vni) +static int zl3vni_send_add_to_client(struct zebra_l3vni *zl3vni) { struct stream *s = NULL; struct zserv *client = NULL; @@ -1957,7 +1988,7 @@ static int zl3vni_send_add_to_client(zebra_l3vni_t *zl3vni) /* * Inform BGP about local l3-VNI deletion. */ -static int zl3vni_send_del_to_client(zebra_l3vni_t *zl3vni) +static int zl3vni_send_del_to_client(struct zebra_l3vni *zl3vni) { struct stream *s = NULL; struct zserv *client = NULL; @@ -1984,7 +2015,7 @@ static int zl3vni_send_del_to_client(zebra_l3vni_t *zl3vni) return zserv_send_message(client, s); } -static void zebra_vxlan_process_l3vni_oper_up(zebra_l3vni_t *zl3vni) +static void zebra_vxlan_process_l3vni_oper_up(struct zebra_l3vni *zl3vni) { if (!zl3vni) return; @@ -1993,7 +2024,7 @@ static void zebra_vxlan_process_l3vni_oper_up(zebra_l3vni_t *zl3vni) zl3vni_send_add_to_client(zl3vni); } -static void zebra_vxlan_process_l3vni_oper_down(zebra_l3vni_t *zl3vni) +static void zebra_vxlan_process_l3vni_oper_down(struct zebra_l3vni *zl3vni) { if (!zl3vni) return; @@ -2004,8 +2035,8 @@ static void zebra_vxlan_process_l3vni_oper_down(zebra_l3vni_t *zl3vni) static void zevpn_add_to_l3vni_list(struct hash_bucket *bucket, void *ctxt) { - zebra_evpn_t *zevpn = (zebra_evpn_t *)bucket->data; - zebra_l3vni_t *zl3vni = (zebra_l3vni_t *)ctxt; + struct zebra_evpn *zevpn = (struct zebra_evpn *)bucket->data; + struct zebra_l3vni *zl3vni = (struct zebra_l3vni *)ctxt; if (zevpn->vrf_id == zl3vni_vrf_id(zl3vni)) listnode_add_sort(zl3vni->l2vnis, zevpn); @@ -2020,7 +2051,7 @@ static void zevpn_add_to_l3vni_list(struct hash_bucket *bucket, void *ctxt) static int zebra_vxlan_handle_vni_transition(struct zebra_vrf *zvrf, vni_t vni, int add) { - zebra_evpn_t *zevpn = NULL; + struct zebra_evpn *zevpn = NULL; /* There is a possibility that VNI notification was already received * from kernel and we programmed it as L2-VNI @@ -2129,11 +2160,11 @@ static int zebra_vxlan_handle_vni_transition(struct zebra_vrf *zvrf, vni_t vni, /* delete and uninstall rmac hash entry */ static void zl3vni_del_rmac_hash_entry(struct hash_bucket *bucket, void *ctx) { - zebra_mac_t *zrmac = NULL; - zebra_l3vni_t *zl3vni = NULL; + struct zebra_mac *zrmac = NULL; + struct zebra_l3vni *zl3vni = NULL; - zrmac = (zebra_mac_t *)bucket->data; - zl3vni = (zebra_l3vni_t *)ctx; + zrmac = (struct zebra_mac *)bucket->data; + zl3vni = (struct zebra_l3vni *)ctx; zl3vni_rmac_uninstall(zl3vni, zrmac); /* Send RMAC for FPM processing */ @@ -2145,20 +2176,20 @@ static void zl3vni_del_rmac_hash_entry(struct hash_bucket *bucket, void *ctx) /* delete and uninstall nh hash entry */ static void zl3vni_del_nh_hash_entry(struct hash_bucket *bucket, void *ctx) { - zebra_neigh_t *n = NULL; - zebra_l3vni_t *zl3vni = NULL; + struct zebra_neigh *n = NULL; + struct zebra_l3vni *zl3vni = NULL; - n = (zebra_neigh_t *)bucket->data; - zl3vni = (zebra_l3vni_t *)ctx; + n = (struct zebra_neigh *)bucket->data; + zl3vni = (struct zebra_l3vni *)ctx; zl3vni_nh_uninstall(zl3vni, n); zl3vni_nh_del(zl3vni, n); } /* re-add remote rmac if needed */ -static int zebra_vxlan_readd_remote_rmac(zebra_l3vni_t *zl3vni, +static int zebra_vxlan_readd_remote_rmac(struct zebra_l3vni *zl3vni, struct ethaddr *rmac) { - zebra_mac_t *zrmac = NULL; + struct zebra_mac *zrmac = NULL; zrmac = zl3vni_rmac_lookup(zl3vni, rmac); if (!zrmac) @@ -2176,7 +2207,7 @@ static int zebra_vxlan_readd_remote_rmac(zebra_l3vni_t *zl3vni, int is_l3vni_for_prefix_routes_only(vni_t vni) { - zebra_l3vni_t *zl3vni = NULL; + struct zebra_l3vni *zl3vni = NULL; zl3vni = zl3vni_lookup(vni); if (!zl3vni) @@ -2190,7 +2221,7 @@ void zebra_vxlan_evpn_vrf_route_add(vrf_id_t vrf_id, const struct ethaddr *rmac, const struct ipaddr *vtep_ip, const struct prefix *host_prefix) { - zebra_l3vni_t *zl3vni = NULL; + struct zebra_l3vni *zl3vni = NULL; struct ipaddr ipv4_vtep; zl3vni = zl3vni_from_vrf(vrf_id); @@ -2229,9 +2260,9 @@ void zebra_vxlan_evpn_vrf_route_del(vrf_id_t vrf_id, struct ipaddr *vtep_ip, struct prefix *host_prefix) { - zebra_l3vni_t *zl3vni = NULL; - zebra_neigh_t *nh = NULL; - zebra_mac_t *zrmac = NULL; + struct zebra_l3vni *zl3vni = NULL; + struct zebra_neigh *nh = NULL; + struct zebra_mac *zrmac = NULL; zl3vni = zl3vni_from_vrf(vrf_id); if (!zl3vni) @@ -2255,8 +2286,8 @@ void zebra_vxlan_evpn_vrf_route_del(vrf_id_t vrf_id, void zebra_vxlan_print_specific_rmac_l3vni(struct vty *vty, vni_t l3vni, struct ethaddr *rmac, bool use_json) { - zebra_l3vni_t *zl3vni = NULL; - zebra_mac_t *zrmac = NULL; + struct zebra_l3vni *zl3vni = NULL; + struct zebra_mac *zrmac = NULL; json_object *json = NULL; if (!is_evpn_enabled()) { @@ -2299,7 +2330,7 @@ void zebra_vxlan_print_specific_rmac_l3vni(struct vty *vty, vni_t l3vni, void zebra_vxlan_print_rmacs_l3vni(struct vty *vty, vni_t l3vni, bool use_json) { - zebra_l3vni_t *zl3vni; + struct zebra_l3vni *zl3vni; uint32_t num_rmacs; struct rmac_walk_ctx wctx; json_object *json = NULL; @@ -2372,8 +2403,8 @@ void zebra_vxlan_print_rmacs_all_l3vni(struct vty *vty, bool use_json) void zebra_vxlan_print_specific_nh_l3vni(struct vty *vty, vni_t l3vni, struct ipaddr *ip, bool use_json) { - zebra_l3vni_t *zl3vni = NULL; - zebra_neigh_t *n = NULL; + struct zebra_l3vni *zl3vni = NULL; + struct zebra_neigh *n = NULL; json_object *json = NULL; if (!is_evpn_enabled()) { @@ -2419,7 +2450,7 @@ void zebra_vxlan_print_nh_l3vni(struct vty *vty, vni_t l3vni, bool use_json) uint32_t num_nh; struct nh_walk_ctx wctx; json_object *json = NULL; - zebra_l3vni_t *zl3vni = NULL; + struct zebra_l3vni *zl3vni = NULL; if (!is_evpn_enabled()) return; @@ -2493,7 +2524,7 @@ void zebra_vxlan_print_l3vni(struct vty *vty, vni_t vni, bool use_json) { void *args[2]; json_object *json = NULL; - zebra_l3vni_t *zl3vni = NULL; + struct zebra_l3vni *zl3vni = NULL; if (!is_evpn_enabled()) { if (use_json) @@ -2528,7 +2559,7 @@ void zebra_vxlan_print_vrf_vni(struct vty *vty, struct zebra_vrf *zvrf, json_object *json_vrfs) { char buf[ETHER_ADDR_STRLEN]; - zebra_l3vni_t *zl3vni = NULL; + struct zebra_l3vni *zl3vni = NULL; zl3vni = zl3vni_lookup(zvrf->l3vni); if (!zl3vni) @@ -2565,7 +2596,7 @@ void zebra_vxlan_print_vrf_vni(struct vty *vty, struct zebra_vrf *zvrf, void zebra_vxlan_print_neigh_vni(struct vty *vty, struct zebra_vrf *zvrf, vni_t vni, bool use_json) { - zebra_evpn_t *zevpn; + struct zebra_evpn *zevpn; uint32_t num_neigh; struct neigh_walk_ctx wctx; json_object *json = NULL; @@ -2683,8 +2714,8 @@ void zebra_vxlan_print_specific_neigh_vni(struct vty *vty, struct zebra_vrf *zvrf, vni_t vni, struct ipaddr *ip, bool use_json) { - zebra_evpn_t *zevpn; - zebra_neigh_t *n; + struct zebra_evpn *zevpn; + struct zebra_neigh *n; json_object *json = NULL; if (!is_evpn_enabled()) @@ -2725,7 +2756,7 @@ void zebra_vxlan_print_neigh_vni_vtep(struct vty *vty, struct zebra_vrf *zvrf, vni_t vni, struct in_addr vtep_ip, bool use_json) { - zebra_evpn_t *zevpn; + struct zebra_evpn *zevpn; uint32_t num_neigh; struct neigh_walk_ctx wctx; json_object *json = NULL; @@ -2774,7 +2805,7 @@ void zebra_vxlan_print_neigh_vni_dad(struct vty *vty, vni_t vni, bool use_json) { - zebra_evpn_t *zevpn; + struct zebra_evpn *zevpn; uint32_t num_neigh; struct neigh_walk_ctx wctx; json_object *json = NULL; @@ -2837,7 +2868,7 @@ void zebra_vxlan_print_neigh_vni_dad(struct vty *vty, void zebra_vxlan_print_macs_vni(struct vty *vty, struct zebra_vrf *zvrf, vni_t vni, bool use_json) { - zebra_evpn_t *zevpn; + struct zebra_evpn *zevpn; uint32_t num_macs; struct mac_walk_ctx wctx; json_object *json = NULL; @@ -2987,8 +3018,8 @@ void zebra_vxlan_print_specific_mac_vni(struct vty *vty, struct zebra_vrf *zvrf, vni_t vni, struct ethaddr *macaddr, bool use_json) { - zebra_evpn_t *zevpn; - zebra_mac_t *mac; + struct zebra_evpn *zevpn; + struct zebra_mac *mac; json_object *json = NULL; if (!is_evpn_enabled()) @@ -3029,7 +3060,7 @@ void zebra_vxlan_print_macs_vni_dad(struct vty *vty, struct zebra_vrf *zvrf, vni_t vni, bool use_json) { - zebra_evpn_t *zevpn; + struct zebra_evpn *zevpn; struct mac_walk_ctx wctx; uint32_t num_macs; json_object *json = NULL; @@ -3086,10 +3117,10 @@ int zebra_vxlan_clear_dup_detect_vni_mac(struct zebra_vrf *zvrf, vni_t vni, struct ethaddr *macaddr, char *errmsg, size_t errmsg_len) { - zebra_evpn_t *zevpn; - zebra_mac_t *mac; + struct zebra_evpn *zevpn; + struct zebra_mac *mac; struct listnode *node = NULL; - zebra_neigh_t *nbr = NULL; + struct zebra_neigh *nbr = NULL; if (!is_evpn_enabled()) return 0; @@ -3174,9 +3205,9 @@ int zebra_vxlan_clear_dup_detect_vni_ip(struct zebra_vrf *zvrf, vni_t vni, struct ipaddr *ip, char *errmsg, size_t errmsg_len) { - zebra_evpn_t *zevpn; - zebra_neigh_t *nbr; - zebra_mac_t *mac; + struct zebra_evpn *zevpn; + struct zebra_neigh *nbr; + struct zebra_mac *mac; char buf[INET6_ADDRSTRLEN]; char buf2[ETHER_ADDR_STRLEN]; @@ -3240,12 +3271,12 @@ int zebra_vxlan_clear_dup_detect_vni_ip(struct zebra_vrf *zvrf, vni_t vni, static void zevpn_clear_dup_mac_hash(struct hash_bucket *bucket, void *ctxt) { struct mac_walk_ctx *wctx = ctxt; - zebra_mac_t *mac; - zebra_evpn_t *zevpn; + struct zebra_mac *mac; + struct zebra_evpn *zevpn; struct listnode *node = NULL; - zebra_neigh_t *nbr = NULL; + struct zebra_neigh *nbr = NULL; - mac = (zebra_mac_t *)bucket->data; + mac = (struct zebra_mac *)bucket->data; if (!mac) return; @@ -3296,12 +3327,12 @@ static void zevpn_clear_dup_mac_hash(struct hash_bucket *bucket, void *ctxt) static void zevpn_clear_dup_detect_hash_vni_all(struct hash_bucket *bucket, void **args) { - zebra_evpn_t *zevpn; + struct zebra_evpn *zevpn; struct zebra_vrf *zvrf; struct mac_walk_ctx m_wctx; struct neigh_walk_ctx n_wctx; - zevpn = (zebra_evpn_t *)bucket->data; + zevpn = (struct zebra_evpn *)bucket->data; if (!zevpn) return; @@ -3342,7 +3373,7 @@ int zebra_vxlan_clear_dup_detect_vni_all(struct zebra_vrf *zvrf) int zebra_vxlan_clear_dup_detect_vni(struct zebra_vrf *zvrf, vni_t vni) { - zebra_evpn_t *zevpn; + struct zebra_evpn *zevpn; struct mac_walk_ctx m_wctx; struct neigh_walk_ctx n_wctx; @@ -3380,7 +3411,7 @@ void zebra_vxlan_print_macs_vni_vtep(struct vty *vty, struct zebra_vrf *zvrf, vni_t vni, struct in_addr vtep_ip, bool use_json) { - zebra_evpn_t *zevpn; + struct zebra_evpn *zevpn; uint32_t num_macs; struct mac_walk_ctx wctx; json_object *json = NULL; @@ -3437,8 +3468,8 @@ void zebra_vxlan_print_vni(struct vty *vty, struct zebra_vrf *zvrf, vni_t vni, { json_object *json = NULL; void *args[2]; - zebra_l3vni_t *zl3vni = NULL; - zebra_evpn_t *zevpn = NULL; + struct zebra_l3vni *zl3vni = NULL; + struct zebra_evpn *zevpn = NULL; if (!is_evpn_enabled()) return; @@ -3686,8 +3717,8 @@ int zebra_vxlan_handle_kernel_neigh_del(struct interface *ifp, struct interface *link_if, struct ipaddr *ip) { - zebra_evpn_t *zevpn = NULL; - zebra_l3vni_t *zl3vni = NULL; + struct zebra_evpn *zevpn = NULL; + struct zebra_l3vni *zl3vni = NULL; /* check if this is a remote neigh entry corresponding to remote * next-hop @@ -3737,8 +3768,8 @@ int zebra_vxlan_handle_kernel_neigh_update(struct interface *ifp, bool is_router, bool local_inactive, bool dp_static) { - zebra_evpn_t *zevpn = NULL; - zebra_l3vni_t *zl3vni = NULL; + struct zebra_evpn *zevpn = NULL; + struct zebra_l3vni *zl3vni = NULL; /* check if this is a remote neigh entry corresponding to remote * next-hop @@ -3937,8 +3968,8 @@ int zebra_vxlan_check_readd_vtep(struct interface *ifp, struct zebra_vrf *zvrf = NULL; struct zebra_l2info_vxlan *vxl; vni_t vni; - zebra_evpn_t *zevpn = NULL; - zebra_vtep_t *zvtep = NULL; + struct zebra_evpn *zevpn = NULL; + struct zebra_vtep *zvtep = NULL; zif = ifp->info; assert(zif); @@ -3986,8 +4017,8 @@ static int zebra_vxlan_check_del_local_mac(struct interface *ifp, struct zebra_if *zif; struct zebra_l2info_vxlan *vxl; vni_t vni; - zebra_evpn_t *zevpn; - zebra_mac_t *mac; + struct zebra_evpn *zevpn; + struct zebra_mac *mac; zif = ifp->info; assert(zif); @@ -4082,9 +4113,9 @@ int zebra_vxlan_dp_network_mac_del(struct interface *ifp, struct zebra_if *zif = NULL; struct zebra_l2info_vxlan *vxl = NULL; vni_t vni; - zebra_evpn_t *zevpn = NULL; - zebra_l3vni_t *zl3vni = NULL; - zebra_mac_t *mac = NULL; + struct zebra_evpn *zevpn = NULL; + struct zebra_l3vni *zl3vni = NULL; + struct zebra_mac *mac = NULL; zif = ifp->info; assert(zif); @@ -4138,8 +4169,8 @@ int zebra_vxlan_dp_network_mac_del(struct interface *ifp, int zebra_vxlan_local_mac_del(struct interface *ifp, struct interface *br_if, struct ethaddr *macaddr, vlanid_t vid) { - zebra_evpn_t *zevpn; - zebra_mac_t *mac; + struct zebra_evpn *zevpn; + struct zebra_mac *mac; /* We are interested in MACs only on ports or (port, VLAN) that * map to a VNI. @@ -4175,7 +4206,7 @@ int zebra_vxlan_local_mac_add_update(struct interface *ifp, bool sticky, bool local_inactive, bool dp_static) { - zebra_evpn_t *zevpn; + struct zebra_evpn *zevpn; struct zebra_vrf *zvrf; assert(ifp); @@ -4270,8 +4301,8 @@ stream_failure: void zebra_vxlan_remote_vtep_del(vrf_id_t vrf_id, vni_t vni, struct in_addr vtep_ip) { - zebra_evpn_t *zevpn; - zebra_vtep_t *zvtep; + struct zebra_evpn *zevpn; + struct zebra_vtep *zvtep; struct interface *ifp; struct zebra_if *zif; struct zebra_vrf *zvrf; @@ -4334,10 +4365,10 @@ void zebra_vxlan_remote_vtep_del(vrf_id_t vrf_id, vni_t vni, void zebra_vxlan_remote_vtep_add(vrf_id_t vrf_id, vni_t vni, struct in_addr vtep_ip, int flood_control) { - zebra_evpn_t *zevpn; + struct zebra_evpn *zevpn; struct interface *ifp; struct zebra_if *zif; - zebra_vtep_t *zvtep; + struct zebra_vtep *zvtep; struct zebra_vrf *zvrf; if (!is_evpn_enabled()) { @@ -4468,7 +4499,7 @@ int zebra_vxlan_add_del_gw_macip(struct interface *ifp, const struct prefix *p, { struct ipaddr ip; struct ethaddr macaddr; - zebra_evpn_t *zevpn = NULL; + struct zebra_evpn *zevpn = NULL; memset(&ip, 0, sizeof(struct ipaddr)); memset(&macaddr, 0, sizeof(struct ethaddr)); @@ -4592,7 +4623,7 @@ int zebra_vxlan_add_del_gw_macip(struct interface *ifp, const struct prefix *p, */ int zebra_vxlan_svi_down(struct interface *ifp, struct interface *link_if) { - zebra_l3vni_t *zl3vni = NULL; + struct zebra_l3vni *zl3vni = NULL; zl3vni = zl3vni_from_svi(ifp, link_if); if (zl3vni) { @@ -4603,7 +4634,7 @@ int zebra_vxlan_svi_down(struct interface *ifp, struct interface *link_if) /* remove association with svi-if */ zl3vni->svi_if = NULL; } else { - zebra_evpn_t *zevpn = NULL; + struct zebra_evpn *zevpn = NULL; /* Unlink the SVI from the access VLAN */ zebra_evpn_acc_bd_svi_set(ifp->info, link_if->info, false); @@ -4635,8 +4666,8 @@ int zebra_vxlan_svi_down(struct interface *ifp, struct interface *link_if) */ int zebra_vxlan_svi_up(struct interface *ifp, struct interface *link_if) { - zebra_evpn_t *zevpn = NULL; - zebra_l3vni_t *zl3vni = NULL; + struct zebra_evpn *zevpn = NULL; + struct zebra_l3vni *zl3vni = NULL; zl3vni = zl3vni_from_svi(ifp, link_if); if (zl3vni) { @@ -4697,7 +4728,7 @@ int zebra_vxlan_svi_up(struct interface *ifp, struct interface *link_if) */ void zebra_vxlan_macvlan_down(struct interface *ifp) { - zebra_l3vni_t *zl3vni = NULL; + struct zebra_l3vni *zl3vni = NULL; struct zebra_if *zif, *link_zif; struct interface *link_ifp, *link_if; @@ -4737,7 +4768,7 @@ void zebra_vxlan_macvlan_down(struct interface *ifp) */ void zebra_vxlan_macvlan_up(struct interface *ifp) { - zebra_l3vni_t *zl3vni = NULL; + struct zebra_l3vni *zl3vni = NULL; struct zebra_if *zif, *link_zif; struct interface *link_ifp, *link_if; @@ -4768,8 +4799,8 @@ int zebra_vxlan_if_down(struct interface *ifp) vni_t vni; struct zebra_if *zif = NULL; struct zebra_l2info_vxlan *vxl = NULL; - zebra_l3vni_t *zl3vni = NULL; - zebra_evpn_t *zevpn; + struct zebra_l3vni *zl3vni = NULL; + struct zebra_evpn *zevpn; /* Check if EVPN is enabled. */ if (!is_evpn_enabled()) @@ -4831,8 +4862,8 @@ int zebra_vxlan_if_up(struct interface *ifp) vni_t vni; struct zebra_if *zif = NULL; struct zebra_l2info_vxlan *vxl = NULL; - zebra_evpn_t *zevpn = NULL; - zebra_l3vni_t *zl3vni = NULL; + struct zebra_evpn *zevpn = NULL; + struct zebra_l3vni *zl3vni = NULL; /* Check if EVPN is enabled. */ if (!is_evpn_enabled()) @@ -4908,8 +4939,8 @@ int zebra_vxlan_if_del(struct interface *ifp) vni_t vni; struct zebra_if *zif = NULL; struct zebra_l2info_vxlan *vxl = NULL; - zebra_evpn_t *zevpn = NULL; - zebra_l3vni_t *zl3vni = NULL; + struct zebra_evpn *zevpn = NULL; + struct zebra_l3vni *zl3vni = NULL; /* Check if EVPN is enabled. */ if (!is_evpn_enabled()) @@ -4982,8 +5013,8 @@ int zebra_vxlan_if_update(struct interface *ifp, uint16_t chgflags) vni_t vni; struct zebra_if *zif = NULL; struct zebra_l2info_vxlan *vxl = NULL; - zebra_evpn_t *zevpn = NULL; - zebra_l3vni_t *zl3vni = NULL; + struct zebra_evpn *zevpn = NULL; + struct zebra_l3vni *zl3vni = NULL; struct interface *vlan_if = NULL; /* Check if EVPN is enabled. */ @@ -5012,6 +5043,13 @@ int zebra_vxlan_if_update(struct interface *ifp, uint16_t chgflags) return 0; } + if ((chgflags & ZEBRA_VXLIF_MASTER_MAC_CHANGE) + && if_is_operative(ifp) && is_l3vni_oper_up(zl3vni)) { + zebra_vxlan_process_l3vni_oper_down(zl3vni); + zebra_vxlan_process_l3vni_oper_up(zl3vni); + return 0; + } + /* access-vlan change - process oper down, associate with new * svi_if and then process oper up again */ @@ -5159,8 +5197,8 @@ int zebra_vxlan_if_add(struct interface *ifp) vni_t vni; struct zebra_if *zif = NULL; struct zebra_l2info_vxlan *vxl = NULL; - zebra_evpn_t *zevpn = NULL; - zebra_l3vni_t *zl3vni = NULL; + struct zebra_evpn *zevpn = NULL; + struct zebra_l3vni *zl3vni = NULL; /* Check if EVPN is enabled. */ if (!is_evpn_enabled()) @@ -5235,24 +5273,15 @@ int zebra_vxlan_if_add(struct interface *ifp) listnode_add_sort_nodup(zl3vni->l2vnis, zevpn); } - if (IS_ZEBRA_DEBUG_VXLAN) { - char addr_buf1[INET_ADDRSTRLEN]; - char addr_buf2[INET_ADDRSTRLEN]; - - inet_ntop(AF_INET, &vxl->vtep_ip, - addr_buf1, INET_ADDRSTRLEN); - inet_ntop(AF_INET, &vxl->mcast_grp, - addr_buf2, INET_ADDRSTRLEN); - + if (IS_ZEBRA_DEBUG_VXLAN) zlog_debug( - "Add L2-VNI %u VRF %s intf %s(%u) VLAN %u local IP %s mcast_grp %s master %u", + "Add L2-VNI %u VRF %s intf %s(%u) VLAN %u local IP %pI4 mcast_grp %pI4 master %u", vni, vlan_if ? vrf_id_to_name(vlan_if->vrf_id) : VRF_DEFAULT_NAME, ifp->name, ifp->ifindex, vxl->access_vlan, - addr_buf1, addr_buf2, + &vxl->vtep_ip, &vxl->mcast_grp, zif->brslave_info.bridge_ifindex); - } /* If down or not mapped to a bridge, we're done. */ if (!if_is_operative(ifp) || !zif->brslave_info.br_if) @@ -5272,7 +5301,7 @@ int zebra_vxlan_process_vrf_vni_cmd(struct zebra_vrf *zvrf, vni_t vni, char *err, int err_str_sz, int filter, int add) { - zebra_l3vni_t *zl3vni = NULL; + struct zebra_l3vni *zl3vni = NULL; struct zebra_vrf *zvrf_evpn = NULL; zvrf_evpn = zebra_vrf_get_evpn(); @@ -5388,7 +5417,7 @@ int zebra_vxlan_process_vrf_vni_cmd(struct zebra_vrf *zvrf, vni_t vni, int zebra_vxlan_vrf_enable(struct zebra_vrf *zvrf) { - zebra_l3vni_t *zl3vni = NULL; + struct zebra_l3vni *zl3vni = NULL; if (zvrf->l3vni) zl3vni = zl3vni_lookup(zvrf->l3vni); @@ -5403,7 +5432,7 @@ int zebra_vxlan_vrf_enable(struct zebra_vrf *zvrf) int zebra_vxlan_vrf_disable(struct zebra_vrf *zvrf) { - zebra_l3vni_t *zl3vni = NULL; + struct zebra_l3vni *zl3vni = NULL; if (zvrf->l3vni) zl3vni = zl3vni_lookup(zvrf->l3vni); @@ -5424,7 +5453,7 @@ int zebra_vxlan_vrf_disable(struct zebra_vrf *zvrf) int zebra_vxlan_vrf_delete(struct zebra_vrf *zvrf) { - zebra_l3vni_t *zl3vni = NULL; + struct zebra_l3vni *zl3vni = NULL; vni_t vni; if (zvrf->l3vni) @@ -5488,7 +5517,7 @@ void zebra_vxlan_advertise_svi_macip(ZAPI_HANDLER_ARGS) struct stream *s; int advertise; vni_t vni = 0; - zebra_evpn_t *zevpn = NULL; + struct zebra_evpn *zevpn = NULL; struct interface *ifp = NULL; if (!EVPN_ENABLED(zvrf)) { @@ -5588,7 +5617,7 @@ void zebra_vxlan_advertise_subnet(ZAPI_HANDLER_ARGS) struct stream *s; int advertise; vni_t vni = 0; - zebra_evpn_t *zevpn = NULL; + struct zebra_evpn *zevpn = NULL; struct interface *ifp = NULL; struct zebra_if *zif = NULL; struct zebra_l2info_vxlan zl2_info; @@ -5654,7 +5683,7 @@ void zebra_vxlan_advertise_gw_macip(ZAPI_HANDLER_ARGS) struct stream *s; int advertise; vni_t vni = 0; - zebra_evpn_t *zevpn = NULL; + struct zebra_evpn *zevpn = NULL; struct interface *ifp = NULL; if (!EVPN_ENABLED(zvrf)) { @@ -5916,7 +5945,7 @@ void zebra_vxlan_disable(void) /* get the l3vni svi ifindex */ ifindex_t get_l3vni_svi_ifindex(vrf_id_t vrf_id) { - zebra_l3vni_t *zl3vni = NULL; + struct zebra_l3vni *zl3vni = NULL; zl3vni = zl3vni_from_vrf(vrf_id); if (!zl3vni || !is_l3vni_oper_up(zl3vni)) @@ -5967,7 +5996,7 @@ static int zebra_vxlan_sg_send(struct zebra_vrf *zvrf, static unsigned int zebra_vxlan_sg_hash_key_make(const void *p) { - const zebra_vxlan_sg_t *vxlan_sg = p; + const struct zebra_vxlan_sg *vxlan_sg = p; return (jhash_2words(vxlan_sg->sg.src.s_addr, vxlan_sg->sg.grp.s_addr, 0)); @@ -5975,17 +6004,17 @@ static unsigned int zebra_vxlan_sg_hash_key_make(const void *p) static bool zebra_vxlan_sg_hash_eq(const void *p1, const void *p2) { - const zebra_vxlan_sg_t *sg1 = p1; - const zebra_vxlan_sg_t *sg2 = p2; + const struct zebra_vxlan_sg *sg1 = p1; + const struct zebra_vxlan_sg *sg2 = p2; return ((sg1->sg.src.s_addr == sg2->sg.src.s_addr) && (sg1->sg.grp.s_addr == sg2->sg.grp.s_addr)); } -static zebra_vxlan_sg_t *zebra_vxlan_sg_new(struct zebra_vrf *zvrf, - struct prefix_sg *sg) +static struct zebra_vxlan_sg *zebra_vxlan_sg_new(struct zebra_vrf *zvrf, + struct prefix_sg *sg) { - zebra_vxlan_sg_t *vxlan_sg; + struct zebra_vxlan_sg *vxlan_sg; vxlan_sg = XCALLOC(MTYPE_ZVXLAN_SG, sizeof(*vxlan_sg)); @@ -6001,20 +6030,20 @@ static zebra_vxlan_sg_t *zebra_vxlan_sg_new(struct zebra_vrf *zvrf, return vxlan_sg; } -static zebra_vxlan_sg_t *zebra_vxlan_sg_find(struct zebra_vrf *zvrf, - struct prefix_sg *sg) +static struct zebra_vxlan_sg *zebra_vxlan_sg_find(struct zebra_vrf *zvrf, + struct prefix_sg *sg) { - zebra_vxlan_sg_t lookup; + struct zebra_vxlan_sg lookup; lookup.sg = *sg; return hash_lookup(zvrf->vxlan_sg_table, &lookup); } -static zebra_vxlan_sg_t *zebra_vxlan_sg_add(struct zebra_vrf *zvrf, - struct prefix_sg *sg) +static struct zebra_vxlan_sg *zebra_vxlan_sg_add(struct zebra_vrf *zvrf, + struct prefix_sg *sg) { - zebra_vxlan_sg_t *vxlan_sg; - zebra_vxlan_sg_t *parent = NULL; + struct zebra_vxlan_sg *vxlan_sg; + struct zebra_vxlan_sg *parent = NULL; struct in_addr sip; vxlan_sg = zebra_vxlan_sg_find(zvrf, sg); @@ -6046,7 +6075,7 @@ static zebra_vxlan_sg_t *zebra_vxlan_sg_add(struct zebra_vrf *zvrf, return vxlan_sg; } -static void zebra_vxlan_sg_del(zebra_vxlan_sg_t *vxlan_sg) +static void zebra_vxlan_sg_del(struct zebra_vxlan_sg *vxlan_sg) { struct in_addr sip; struct zebra_vrf *zvrf; @@ -6077,7 +6106,7 @@ static void zebra_vxlan_sg_del(zebra_vxlan_sg_t *vxlan_sg) static void zebra_vxlan_sg_do_deref(struct zebra_vrf *zvrf, struct in_addr sip, struct in_addr mcast_grp) { - zebra_vxlan_sg_t *vxlan_sg; + struct zebra_vxlan_sg *vxlan_sg; struct prefix_sg sg; sg.family = AF_INET; @@ -6095,10 +6124,11 @@ static void zebra_vxlan_sg_do_deref(struct zebra_vrf *zvrf, zebra_vxlan_sg_del(vxlan_sg); } -static zebra_vxlan_sg_t *zebra_vxlan_sg_do_ref(struct zebra_vrf *zvrf, - struct in_addr sip, struct in_addr mcast_grp) +static struct zebra_vxlan_sg *zebra_vxlan_sg_do_ref(struct zebra_vrf *zvrf, + struct in_addr sip, + struct in_addr mcast_grp) { - zebra_vxlan_sg_t *vxlan_sg; + struct zebra_vxlan_sg *vxlan_sg; struct prefix_sg sg; sg.family = AF_INET; @@ -6145,7 +6175,7 @@ static void zebra_vxlan_sg_ref(struct in_addr local_vtep_ip, static void zebra_vxlan_xg_pre_cleanup(struct hash_bucket *bucket, void *arg) { - zebra_vxlan_sg_t *vxlan_sg = (zebra_vxlan_sg_t *)bucket->data; + struct zebra_vxlan_sg *vxlan_sg = (struct zebra_vxlan_sg *)bucket->data; /* increment the ref count against (*,G) to prevent them from being * deleted @@ -6156,7 +6186,7 @@ static void zebra_vxlan_xg_pre_cleanup(struct hash_bucket *bucket, void *arg) static void zebra_vxlan_xg_post_cleanup(struct hash_bucket *bucket, void *arg) { - zebra_vxlan_sg_t *vxlan_sg = (zebra_vxlan_sg_t *)bucket->data; + struct zebra_vxlan_sg *vxlan_sg = (struct zebra_vxlan_sg *)bucket->data; /* decrement the dummy ref count against (*,G) to delete them */ if (vxlan_sg->sg.src.s_addr == INADDR_ANY) { @@ -6169,7 +6199,7 @@ static void zebra_vxlan_xg_post_cleanup(struct hash_bucket *bucket, void *arg) static void zebra_vxlan_sg_cleanup(struct hash_bucket *bucket, void *arg) { - zebra_vxlan_sg_t *vxlan_sg = (zebra_vxlan_sg_t *)bucket->data; + struct zebra_vxlan_sg *vxlan_sg = (struct zebra_vxlan_sg *)bucket->data; zebra_vxlan_sg_del(vxlan_sg); } @@ -6189,7 +6219,7 @@ static void zebra_vxlan_cleanup_sg_table(struct zebra_vrf *zvrf) static void zebra_vxlan_sg_replay_send(struct hash_bucket *bucket, void *arg) { - zebra_vxlan_sg_t *vxlan_sg = (zebra_vxlan_sg_t *)bucket->data; + struct zebra_vxlan_sg *vxlan_sg = (struct zebra_vxlan_sg *)bucket->data; zebra_vxlan_sg_send(vxlan_sg->zvrf, &vxlan_sg->sg, vxlan_sg->sg_str, ZEBRA_VXLAN_SG_ADD); @@ -6217,7 +6247,7 @@ void zebra_vxlan_sg_replay(ZAPI_HANDLER_ARGS) /* Cleanup EVPN configuration of a specific VRF */ static void zebra_evpn_vrf_cfg_cleanup(struct zebra_vrf *zvrf) { - zebra_l3vni_t *zl3vni = NULL; + struct zebra_l3vni *zl3vni = NULL; zvrf->advertise_all_vni = 0; zvrf->advertise_gw_macip = 0; |
