diff options
author | vivek <vivek@cumulusnetworks.com> | 2019-09-06 06:11:07 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2020-03-10 15:02:43 +0100 |
commit | 4b3f26f4c97e5ed0f88f2c9355c7b0c4d3c5968a (patch) | |
tree | 620b646e3956e943f90e5220d2726fec12c94e5e /zebra/zebra_vxlan.c | |
parent | lib: immediately ping systemd when started (diff) | |
download | frr-4b3f26f4c97e5ed0f88f2c9355c7b0c4d3c5968a.tar.xz frr-4b3f26f4c97e5ed0f88f2c9355c7b0c4d3c5968a.zip |
zebra: Readd special flood MAC upon del notification
Readd the special MAC that represents the flood (head-end replication) entry
for EVPN-VxLAN upon getting a delete notification for it.
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Chirag Shah <chirag@cumulusnetworks.com>
Ticket: CM-25797
Ticket: CM-26238
Testing Done:
1. evpn-min, evpn-smoke - results summarized in CM-25798
Diffstat (limited to 'zebra/zebra_vxlan.c')
-rw-r--r-- | zebra/zebra_vxlan.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/zebra/zebra_vxlan.c b/zebra/zebra_vxlan.c index dce48d39b..61865e5ba 100644 --- a/zebra/zebra_vxlan.c +++ b/zebra/zebra_vxlan.c @@ -7788,6 +7788,52 @@ stream_failure: } /* + * Handle remote vtep delete by kernel; re-add the vtep if we have it + */ +int zebra_vxlan_check_readd_vtep(struct interface *ifp, + struct in_addr vtep_ip) +{ + struct zebra_if *zif; + struct zebra_vrf *zvrf = NULL; + struct zebra_l2info_vxlan *vxl; + vni_t vni; + zebra_vni_t *zvni = NULL; + zebra_vtep_t *zvtep = NULL; + + zif = ifp->info; + assert(zif); + vxl = &zif->l2info.vxl; + vni = vxl->vni; + + /* If EVPN is not enabled, nothing to do. */ + if (!is_evpn_enabled()) + return 0; + + /* Locate VRF corresponding to interface. */ + zvrf = vrf_info_lookup(ifp->vrf_id); + if (!zvrf) + return -1; + + /* Locate hash entry; it is expected to exist. */ + zvni = zvni_lookup(vni); + if (!zvni) + return 0; + + /* If the remote vtep entry doesn't exists nothing to do */ + zvtep = zvni_vtep_find(zvni, &vtep_ip); + if (!zvtep) + return 0; + + if (IS_ZEBRA_DEBUG_VXLAN) + zlog_debug( + "Del MAC for remote VTEP %s intf %s(%u) VNI %u - readd", + inet_ntoa(vtep_ip), ifp->name, ifp->ifindex, vni); + + zvni_vtep_install(zvni, zvtep); + return 0; +} + +/* * Handle notification of MAC add/update over VxLAN. If the kernel is notifying * us, this must involve a multihoming scenario. Treat this as implicit delete * of any prior local MAC. |