]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: evpn handle del event for dup detected mac
authorChirag Shah <chirag@nvidia.com>
Wed, 1 Dec 2021 04:42:01 +0000 (20:42 -0800)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Mon, 24 Apr 2023 13:51:53 +0000 (13:51 +0000)
Upon receiving local mobility event for MAC + NEIGH,
both are detected as duplicate upon hitting DAD threshold.

Duplicated detected ( freezed) MAC + NEIGH are not known
to bgpd.

If locally learnt MAC + NEIGH are deleted in kernel,
the MAC is marked as AUTO after sending delete event
to bgpd.

Bgpd only reinstalls best route for MAC_IP route (NEIGH)
but not for MAC event.
This puts a situation where MAC is AUTO state and
associated neigh as remote.

Fix:
DUPLICATE + LOCAL MAC deletion, set MAC delete request
as reinstall from bgpd.

Ticket:#2873307
Reviewed By:
Testing Done:

Freeze MAC + two NEIGHs in local mobility event.
Delete MAC and NEIGH from kerenl.
bgp rsync remote mac route which puts MAC to remote state.

Signed-off-by: Chirag Shah <chirag@nvidia.com>
(cherry picked from commit ad7685de2871996469d370192af7afafc234a3ca)

zebra/zebra_evpn_mac.c

index cbdc17653b9a26e7c864a2b5d323bf10382eb3b1..8a903623636b4aa4f823e42662c526676f518516 100644 (file)
@@ -1318,16 +1318,26 @@ int zebra_evpn_mac_send_add_to_client(vni_t vni, const struct ethaddr *macaddr,
 int zebra_evpn_mac_send_del_to_client(vni_t vni, const struct ethaddr *macaddr,
                                      uint32_t flags, bool force)
 {
+       int state = ZEBRA_NEIGH_ACTIVE;
+
        if (!force) {
                if (CHECK_FLAG(flags, ZEBRA_MAC_LOCAL_INACTIVE)
                    && !CHECK_FLAG(flags, ZEBRA_MAC_ES_PEER_ACTIVE))
                        /* the host was not advertised - nothing  to delete */
                        return 0;
+
+               /* MAC is LOCAL and DUP_DETECTED, this local mobility event
+                * is not known to bgpd. Upon receiving local delete
+                * ask bgp to reinstall the best route (remote entry).
+                */
+               if (CHECK_FLAG(flags, ZEBRA_MAC_LOCAL) &&
+                   CHECK_FLAG(flags, ZEBRA_MAC_DUPLICATE))
+                       state = ZEBRA_NEIGH_INACTIVE;
        }
 
        return zebra_evpn_macip_send_msg_to_client(
-               vni, macaddr, NULL, 0 /* flags */, 0 /* seq */,
-               ZEBRA_NEIGH_ACTIVE, NULL, ZEBRA_MACIP_DEL);
+               vni, macaddr, NULL, 0 /* flags */, 0 /* seq */, state, NULL,
+               ZEBRA_MACIP_DEL);
 }
 
 /*