summaryrefslogtreecommitdiffstats
path: root/zebra
diff options
context:
space:
mode:
authorChirag Shah <chirag@cumulusnetworks.com>2019-06-28 19:42:08 +0200
committerChirag Shah <chirag@cumulusnetworks.com>2019-07-02 16:55:05 +0200
commitb6587fc2af3a83550586cd5fbe83f4643dcc6655 (patch)
tree038c5e7315ac23cdff5c0faa9e6e70efb442cd61 /zebra
parentMerge pull request #4608 from donaldsharp/vtysh_pam_helping_hand (diff)
downloadfrr-b6587fc2af3a83550586cd5fbe83f4643dcc6655.tar.xz
frr-b6587fc2af3a83550586cd5fbe83f4643dcc6655.zip
zebra: evpn entries are not cleaned upon frr stop
As part of PR 4458, when a client (bgpd) goes down, zebra cleans up any evpn state including remotely learned neighs, macs and vteps are suppose to be cleaned up, uninstall from kernel tables. Neighs (arps), macs and vteps (HREP entries) were not removed from kernel tables as the uninstall flag as not set. Clean up l3vni associated remote neighs, macs and vteps. Ticket:CM-25468 Reviewed By:CCR-8889 Testing Done: Validated in evpn symmetric routing topology where remotely learned l2/l3 vnis neigh, macs and remote vtep (hrep) entries are installed in kernel table, perform systemctl stop frr.service and validated all remotely learned entries cleaned up from kernel tables. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
Diffstat (limited to 'zebra')
-rw-r--r--zebra/zebra_vxlan.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/zebra/zebra_vxlan.c b/zebra/zebra_vxlan.c
index a3a630d53..222d91105 100644
--- a/zebra/zebra_vxlan.c
+++ b/zebra/zebra_vxlan.c
@@ -9774,22 +9774,35 @@ static void zvni_evpn_cfg_cleanup(struct hash_bucket *bucket, void *ctxt)
zvni->advertise_svi_macip = 0;
zvni->advertise_subnet = 0;
- zvni_neigh_del_all(zvni, 0, 0,
+ zvni_neigh_del_all(zvni, 1, 0,
DEL_REMOTE_NEIGH | DEL_REMOTE_NEIGH_FROM_VTEP);
- zvni_mac_del_all(zvni, 0, 0,
+ zvni_mac_del_all(zvni, 1, 0,
DEL_REMOTE_MAC | DEL_REMOTE_MAC_FROM_VTEP);
- zvni_vtep_del_all(zvni, 0);
+ zvni_vtep_del_all(zvni, 1);
}
/* Cleanup EVPN configuration of a specific VRF */
static void zebra_evpn_vrf_cfg_cleanup(struct zebra_vrf *zvrf)
{
+ zebra_l3vni_t *zl3vni = NULL;
+
zvrf->advertise_all_vni = 0;
zvrf->advertise_gw_macip = 0;
zvrf->advertise_svi_macip = 0;
zvrf->vxlan_flood_ctrl = VXLAN_FLOOD_HEAD_END_REPL;
hash_iterate(zvrf->vni_table, zvni_evpn_cfg_cleanup, NULL);
+
+ if (zvrf->l3vni)
+ zl3vni = zl3vni_lookup(zvrf->l3vni);
+ if (zl3vni) {
+ /* delete and uninstall all rmacs */
+ hash_iterate(zl3vni->rmac_table, zl3vni_del_rmac_hash_entry,
+ zl3vni);
+ /* delete and uninstall all next-hops */
+ hash_iterate(zl3vni->nh_table, zl3vni_del_nh_hash_entry,
+ zl3vni);
+ }
}
/* Cleanup BGP EVPN configuration upon client disconnect */