diff options
author | Donatas Abraitis <donatas@opensourcerouting.org> | 2023-04-24 15:51:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-24 15:51:10 +0200 |
commit | 76cd90fb4e183eeed8a5832b9581ee345a3cb8e8 (patch) | |
tree | 7cb5a01047fec34ed016abe518a84c4e2d92c74c /zebra | |
parent | Merge pull request #13365 from LabNConsulting/chopps/add-perf-option (diff) | |
parent | zebra:fix evpn dup detected local mac del event (diff) | |
download | frr-76cd90fb4e183eeed8a5832b9581ee345a3cb8e8.tar.xz frr-76cd90fb4e183eeed8a5832b9581ee345a3cb8e8.zip |
Merge pull request #13330 from chiragshah6/fdev1
zebra: EVPN handle duplicate detected local mac delete event
Diffstat (limited to 'zebra')
-rw-r--r-- | zebra/zebra_evpn_mac.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/zebra/zebra_evpn_mac.c b/zebra/zebra_evpn_mac.c index 5ba075e29..6d5cd6614 100644 --- a/zebra/zebra_evpn_mac.c +++ b/zebra/zebra_evpn_mac.c @@ -1038,12 +1038,11 @@ int zebra_evpn_macip_send_msg_to_client(vni_t vni, char flag_buf[MACIP_BUF_SIZE]; zlog_debug( - "Send MACIP %s f %s MAC %pEA IP %pIA seq %u L2-VNI %u ESI %s to %s", + "Send MACIP %s f %s state %u MAC %pEA IP %pIA seq %u L2-VNI %u ESI %s to %s", (cmd == ZEBRA_MACIP_ADD) ? "Add" : "Del", zclient_evpn_dump_macip_flags(flags, flag_buf, sizeof(flag_buf)), - macaddr, ip, seq, vni, - es ? es->esi_str : "-", + state, macaddr, ip, seq, vni, es ? es->esi_str : "-", zebra_route_string(client->proto)); } @@ -1341,16 +1340,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); } /* @@ -2435,7 +2444,7 @@ int zebra_evpn_del_local_mac(struct zebra_evpn *zevpn, struct zebra_mac *mac, /* Remove MAC from BGP. */ zebra_evpn_mac_send_del_to_client(zevpn->vni, &mac->macaddr, mac->flags, - false /* force */); + clear_static /* force */); zebra_evpn_es_mac_deref_entry(mac); |