]> git.proxmox.com Git - mirror_frr.git/commitdiff
zebra: evpn entries are not cleaned upon frr stop
authorChirag Shah <chirag@cumulusnetworks.com>
Fri, 28 Jun 2019 17:42:08 +0000 (10:42 -0700)
committerChirag Shah <chirag@cumulusnetworks.com>
Tue, 2 Jul 2019 14:55:05 +0000 (07:55 -0700)
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>
zebra/zebra_vxlan.c

index a3a630d53e53697956c9cd1e9e9a5995ce518cd3..222d91105effca91358160447007f9c8f1d10cdf 100644 (file)
@@ -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 */