]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: debug logs to detect incorrect mac deletions 7399/head
authorAnuradha Karuppiah <anuradhak@cumulusnetworks.com>
Tue, 26 May 2020 13:49:56 +0000 (06:49 -0700)
committerAnuradha Karuppiah <anuradhak@nvidia.com>
Tue, 1 Dec 2020 17:46:28 +0000 (09:46 -0800)
A MAC entry cannot be deleted while a neigh is referencing it. It seems
there is some race condition where this may be happening. The log is
to help identify those cases.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
zebra/zebra_evpn_mac.c

index 0b0670f079e334f741d9c215109b5b581e1fba40..44394b95aab4f7781c840748b049c522293c6248 100644 (file)
@@ -1005,6 +1005,14 @@ int zebra_evpn_mac_del(zebra_evpn_t *zevpn, zebra_mac_t *mac)
                           mac->flags);
        }
 
+       /* If the MAC is freed before the neigh we will end up
+        * with a stale pointer against the neigh
+        */
+       if (!list_isempty(mac->neigh_list))
+               zlog_warn("%s: MAC %pEA flags 0x%x neigh list not empty %d",
+                         __func__, &mac->macaddr, mac->flags,
+                         listcount(mac->neigh_list));
+
        /* force de-ref any ES entry linked to the MAC */
        zebra_evpn_es_mac_deref_entry(mac);