From fd40906be90e65273df96dca29b9e7134499468a Mon Sep 17 00:00:00 2001 From: Anuradha Karuppiah Date: Tue, 8 Sep 2020 09:23:04 -0700 Subject: [PATCH] zebra: flush macs linked to the bond when it moves out of bypass When a ES-bond is in bypass state MACs learnt on it are linked to the access port instead of the ES. When LACP converges on the bond it moves out of bypass and the MACs previously learnt on it are flushed to force a re-learn on new traffic. Ticket: CM-31326 Signed-off-by: Anuradha Karuppiah --- zebra/zebra_evpn_mh.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/zebra/zebra_evpn_mh.c b/zebra/zebra_evpn_mh.c index 249a2f0aad..5a28ee10c6 100644 --- a/zebra/zebra_evpn_mh.c +++ b/zebra/zebra_evpn_mh.c @@ -2682,6 +2682,7 @@ static void zebra_evpn_es_bypass_update_macs(struct zebra_evpn_es *es, zebra_mac_t *mac; struct listnode *node; struct listnode *nnode; + struct zebra_if *zif; /* Flush all MACs linked to the ES */ for (ALL_LIST_ELEMENTS(es->mac_list, node, nnode, mac)) { @@ -2696,6 +2697,25 @@ static void zebra_evpn_es_bypass_update_macs(struct zebra_evpn_es *es, es->esi_str); zebra_evpn_flush_local_mac(mac, ifp); } + + /* While in bypass-mode locally learnt MACs are linked + * to the access port instead of the ES + */ + zif = ifp->info; + if (!zif->mac_list) + return; + + for (ALL_LIST_ELEMENTS(zif->mac_list, node, nnode, mac)) { + if (!CHECK_FLAG(mac->flags, ZEBRA_MAC_LOCAL)) + continue; + + if (IS_ZEBRA_DEBUG_EVPN_MH_MAC) + zlog_debug("VNI %u mac %pEA %s update ifp %s", + mac->zevpn->vni, + &mac->macaddr, + bypass ? "bypass" : "non-bypass", ifp->name); + zebra_evpn_flush_local_mac(mac, ifp); + } } void zebra_evpn_es_bypass_update(struct zebra_evpn_es *es, -- 2.39.5