Commit efd720f039 for frr

commit efd720f039375040b12543dd4ad232a1189d5c7f
Author: Brad House <bhouse@nexthop.ai>
Date:   Tue Nov 10 20:53:28 2026 +0000

    zebra: skip the dataplane only for the AUTO MAC a walk deletes

    zebra_evpn_check_mac_del_from_db() clears wctx->uninstall when it
    deletes an AUTO MAC with no neighbors, as that MAC is not in the
    dataplane. The flag belongs to the whole walk, so every MAC visited
    after it is deleted without being uninstalled, and remote MACs stay in
    the kernel and in an FPM dataplane.

    Make the skip apply to that MAC only.

    Signed-off-by: Brad House <bhouse@nexthop.ai>

diff --git a/zebra/zebra_evpn_mac.c b/zebra/zebra_evpn_mac.c
index 888978ee56..8b0e21b802 100644
--- a/zebra/zebra_evpn_mac.c
+++ b/zebra/zebra_evpn_mac.c
@@ -1240,9 +1240,11 @@ struct zebra_mac *zebra_evpn_mac_add_auto(struct zebra_evpn *zevpn,
 	return mac;
 }

-static bool zebra_evpn_check_mac_del_from_db(struct mac_walk_ctx *wctx,
-					     struct zebra_mac *mac)
+static bool zebra_evpn_check_mac_del_from_db(struct mac_walk_ctx *wctx, struct zebra_mac *mac,
+					     bool *uninstall)
 {
+	*uninstall = wctx->uninstall;
+
 	if (CHECK_FLAG(wctx->flags, DEL_LOCAL_MAC) &&
 	    CHECK_FLAG(mac->flags, ZEBRA_MAC_LOCAL))
 		return true;
@@ -1283,7 +1285,7 @@ static bool zebra_evpn_check_mac_del_from_db(struct mac_walk_ctx *wctx,
 				   zebra_evpn_zebra_mac_flag_dump(mac, mac_buf,
 								  sizeof(mac_buf)));
 		}
-		wctx->uninstall = 0;
+		*uninstall = false;

 		return true;
 	}
@@ -1298,8 +1300,9 @@ static void zebra_evpn_mac_del_hash_entry(struct hash_bucket *bucket, void *arg)
 {
 	struct mac_walk_ctx *wctx = arg;
 	struct zebra_mac *mac = bucket->data;
+	bool uninstall;

-	if (!zebra_evpn_check_mac_del_from_db(wctx, mac))
+	if (!zebra_evpn_check_mac_del_from_db(wctx, mac, &uninstall))
 		return;

 	if (wctx->upd_client && CHECK_FLAG(mac->flags, ZEBRA_MAC_LOCAL)) {
@@ -1307,7 +1310,7 @@ static void zebra_evpn_mac_del_hash_entry(struct hash_bucket *bucket, void *arg)
 						  &mac->macaddr, mac->flags,
 						  false);
 	}
-	if (wctx->uninstall) {
+	if (uninstall) {
 		if (zebra_evpn_mac_is_static(mac))
 			zebra_evpn_sync_mac_dp_install(mac, false, true,
 						       __func__);