]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: special sync routes lower seq handling
authorStephen Worley <sworley@nvidia.com>
Tue, 26 Oct 2021 21:48:49 +0000 (17:48 -0400)
committerStephen Worley <sworley@nvidia.com>
Tue, 11 Oct 2022 19:18:39 +0000 (15:18 -0400)
Add some special handling to accept lower seq routes for local
known routes when not ready. This aligns the code back a bit more
to where it was before to fix seen issues with sync routes.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
zebra/zebra_evpn_mac.c
zebra/zebra_evpn_neigh.c

index c58b55abdffb2aff294e935648fbda454a97c2a5..4300b55c3ba1fdc417133c190485c5bea6ad930a 100644 (file)
@@ -1600,20 +1600,33 @@ static inline bool zebra_evpn_mac_is_bgp_seq_ok(struct zebra_evpn *zevpn,
        char mac_buf[MAC_BUF_SIZE];
        uint32_t tmp_seq;
        const char *n_type;
+       bool is_local = false;
 
        if (CHECK_FLAG(mac->flags, ZEBRA_MAC_LOCAL)) {
                tmp_seq = mac->loc_seq;
                n_type = "local";
+               is_local = true;
        } else {
                tmp_seq = mac->rem_seq;
                n_type = "remote";
        }
 
        if (seq < tmp_seq) {
+
+               if (is_local && !zebra_evpn_mac_is_ready_for_bgp(mac->flags)) {
+                       if (IS_ZEBRA_DEBUG_EVPN_MH_MAC || IS_ZEBRA_DEBUG_VXLAN)
+                               zlog_debug(
+                                       "%s-macip not ready vni %u %s-mac %pEA lower seq %u f 0x%x",
+                                       sync ? "sync" : "rem", zevpn->vni,
+                                       n_type, &mac->macaddr, tmp_seq,
+                                       mac->flags);
+                       return true;
+               }
+
                /* if the mac was never advertised to bgp we must accept
                 * whatever sequence number bgp sends
                 */
-               if (zebra_vxlan_accept_bgp_seq()) {
+               if (!is_local && zebra_vxlan_accept_bgp_seq()) {
                        if (IS_ZEBRA_DEBUG_EVPN_MH_MAC ||
                            IS_ZEBRA_DEBUG_VXLAN) {
                                zlog_debug(
index c187b5947f14bd37cd7cb0b6bbc34fea83791566..7b5f1fc240e4ee86584f96f949be77b085e16e8c 100644 (file)
@@ -501,20 +501,33 @@ bool zebra_evpn_neigh_is_bgp_seq_ok(struct zebra_evpn *zevpn,
 {
        uint32_t tmp_seq;
        const char *n_type;
+       bool is_local = false;
 
        if (CHECK_FLAG(n->flags, ZEBRA_NEIGH_LOCAL)) {
                tmp_seq = n->loc_seq;
                n_type = "local";
+               is_local = true;
        } else {
                tmp_seq = n->rem_seq;
                n_type = "remote";
        }
 
        if (seq < tmp_seq) {
+               if (is_local && !zebra_evpn_neigh_is_ready_for_bgp(n)) {
+                       if (IS_ZEBRA_DEBUG_EVPN_MH_NEIGH ||
+                           IS_ZEBRA_DEBUG_VXLAN)
+                               zlog_debug(
+                                       "%s-macip not ready vni %u %s mac %pEA IP %pIA lower seq %u f 0x%x",
+                                       sync ? "sync" : "remote", zevpn->vni,
+                                       n_type, macaddr, &n->ip, tmp_seq,
+                                       n->flags);
+                       return true;
+               }
+
                /* if the neigh was never advertised to bgp we must accept
                 * whatever sequence number bgp sends
                 */
-               if (zebra_vxlan_accept_bgp_seq()) {
+               if (!is_local && zebra_vxlan_accept_bgp_seq()) {
                        if (IS_ZEBRA_DEBUG_EVPN_MH_NEIGH
                            || IS_ZEBRA_DEBUG_VXLAN)
                                zlog_debug(