diff options
Diffstat (limited to 'zebra/zebra_evpn_mac.c')
| -rw-r--r-- | zebra/zebra_evpn_mac.c | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/zebra/zebra_evpn_mac.c b/zebra/zebra_evpn_mac.c index 2c953eef15..801403c11c 100644 --- a/zebra/zebra_evpn_mac.c +++ b/zebra/zebra_evpn_mac.c @@ -36,6 +36,8 @@ #include "zebra/zebra_router.h" #include "zebra/zebra_errors.h" #include "zebra/zebra_vrf.h" +#include "zebra/zebra_vxlan.h" +#include "zebra/zebra_vxlan_if.h" #include "zebra/zebra_evpn.h" #include "zebra/zebra_evpn_mh.h" #include "zebra/zebra_evpn_mac.h" @@ -198,7 +200,7 @@ int zebra_evpn_rem_mac_install(struct zebra_evpn *zevpn, struct zebra_mac *mac, bool was_static) { const struct zebra_if *zif, *br_zif; - const struct zebra_l2info_vxlan *vxl; + const struct zebra_vxlan_vni *vni; bool sticky; enum zebra_dplane_result res; const struct interface *br_ifp; @@ -214,7 +216,9 @@ int zebra_evpn_rem_mac_install(struct zebra_evpn *zevpn, struct zebra_mac *mac, if (br_ifp == NULL) return -1; - vxl = &zif->l2info.vxl; + vni = zebra_vxlan_if_vni_find(zif, zevpn->vni); + if (!vni) + return -1; sticky = !!CHECK_FLAG(mac->flags, (ZEBRA_MAC_STICKY | ZEBRA_MAC_REMOTE_DEF_GW)); @@ -235,12 +239,12 @@ int zebra_evpn_rem_mac_install(struct zebra_evpn *zevpn, struct zebra_mac *mac, br_zif = (const struct zebra_if *)(br_ifp->info); if (IS_ZEBRA_IF_BRIDGE_VLAN_AWARE(br_zif)) - vid = vxl->access_vlan; + vid = vni->access_vlan; else vid = 0; res = dplane_rem_mac_add(zevpn->vxlan_if, br_ifp, vid, &mac->macaddr, - vtep_ip, sticky, nhg_id, was_static); + vni->vni, vtep_ip, sticky, nhg_id, was_static); if (res != ZEBRA_DPLANE_REQUEST_FAILURE) return 0; else @@ -254,7 +258,7 @@ int zebra_evpn_rem_mac_uninstall(struct zebra_evpn *zevpn, struct zebra_mac *mac, bool force) { const struct zebra_if *zif, *br_zif; - const struct zebra_l2info_vxlan *vxl; + struct zebra_vxlan_vni *vni; struct in_addr vtep_ip; const struct interface *ifp, *br_ifp; vlanid_t vid; @@ -280,19 +284,22 @@ int zebra_evpn_rem_mac_uninstall(struct zebra_evpn *zevpn, if (br_ifp == NULL) return -1; - vxl = &zif->l2info.vxl; + vni = zebra_vxlan_if_vni_find(zif, zevpn->vni); + if (!vni) + return -1; br_zif = (const struct zebra_if *)br_ifp->info; if (IS_ZEBRA_IF_BRIDGE_VLAN_AWARE(br_zif)) - vid = vxl->access_vlan; + vid = vni->access_vlan; else vid = 0; ifp = zevpn->vxlan_if; vtep_ip = mac->fwd_info.r_vtep_ip; - res = dplane_rem_mac_del(ifp, br_ifp, vid, &mac->macaddr, vtep_ip); + res = dplane_rem_mac_del(ifp, br_ifp, vid, &mac->macaddr, vni->vni, + vtep_ip); if (res != ZEBRA_DPLANE_REQUEST_FAILURE) return 0; else @@ -327,6 +334,8 @@ static void zebra_evpn_mac_get_access_info(struct zebra_mac *mac, struct interface **p_ifp, vlanid_t *vid) { + struct zebra_vxlan_vni *vni; + /* if the mac is associated with an ES we must get the access * info from the ES */ @@ -338,7 +347,8 @@ static void zebra_evpn_mac_get_access_info(struct zebra_mac *mac, /* get the vlan from the EVPN */ if (mac->zevpn->vxlan_if) { zif = mac->zevpn->vxlan_if->info; - *vid = zif->l2info.vxl.access_vlan; + vni = zebra_vxlan_if_vni_find(zif, mac->zevpn->vni); + *vid = vni->access_vlan; } else { *vid = 0; } |
