diff options
Diffstat (limited to 'zebra/zebra_evpn_mac.c')
| -rw-r--r-- | zebra/zebra_evpn_mac.c | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/zebra/zebra_evpn_mac.c b/zebra/zebra_evpn_mac.c index c1bb19d4e5..6fc01925eb 100644 --- a/zebra/zebra_evpn_mac.c +++ b/zebra/zebra_evpn_mac.c @@ -106,19 +106,6 @@ static void zebra_evpn_mac_ifp_new(struct zebra_if *zif) listset_app_node_mem(zif->mac_list); } -/* Free up the mac_list if any as a part of the interface del/cleanup */ -void zebra_evpn_mac_ifp_del(struct interface *ifp) -{ - struct zebra_if *zif = ifp->info; - - if (zif->mac_list) { - if (IS_ZEBRA_DEBUG_EVPN_MH_MAC) - zlog_debug("MAC list deleted for ifp %s (%u)", - zif->ifp->name, zif->ifp->ifindex); - list_delete(&zif->mac_list); - } -} - /* Unlink local mac from a destination access port */ static void zebra_evpn_mac_ifp_unlink(struct zebra_mac *zmac) { @@ -139,6 +126,25 @@ static void zebra_evpn_mac_ifp_unlink(struct zebra_mac *zmac) zmac->ifp = NULL; } +/* Free up the mac_list if any as a part of the interface del/cleanup */ +void zebra_evpn_mac_ifp_del(struct interface *ifp) +{ + struct zebra_if *zif = ifp->info; + struct listnode *node; + struct zebra_mac *zmac; + + if (zif->mac_list) { + if (IS_ZEBRA_DEBUG_EVPN_MH_MAC) + zlog_debug("MAC list deleted for ifp %s (%u)", + zif->ifp->name, zif->ifp->ifindex); + + for (ALL_LIST_ELEMENTS_RO(zif->mac_list, node, zmac)) { + zebra_evpn_mac_ifp_unlink(zmac); + } + list_delete(&zif->mac_list); + } +} + /* Link local mac to destination access port. This is done only if the * local mac is associated with a zero ESI i.e. single attach or lacp-bypass * bridge port member |
