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)
{
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