From: Chirag Shah Date: Tue, 4 Jun 2019 01:42:00 +0000 (-0700) Subject: bgpd: skip evpn remove marked routes from rescan X-Git-Tag: base_7.2~217^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=c869b3f87d4e7acd72eee6a4648606e136642f74;p=mirror%2Ffrr.git bgpd: skip evpn remove marked routes from rescan Skip evpn routes marked for removed from rescan list when an interface is flapped. Ticket:CM-24933 Testing Done: Validated in a scenario where evpn route is marked for remove as bgp evpn withdrawal is received. Due to link flap (frr restart of downstream router), the route was considered for readd via bgp_update. With this fix, the remove marked routes are skipped from update. Signed-off-by: Chirag Shah --- diff --git a/bgpd/bgp_mac.c b/bgpd/bgp_mac.c index f19453fecb..b05ca87319 100644 --- a/bgpd/bgp_mac.c +++ b/bgpd/bgp_mac.c @@ -29,6 +29,7 @@ #include "bgpd/bgp_memory.h" #include "bgpd/bgp_route.h" #include "bgpd/bgp_packet.h" +#include "bgpd/bgp_rd.h" #include "bgpd/bgp_debug.h" #include "bgpd/bgp_evpn_private.h" @@ -169,6 +170,23 @@ static void bgp_process_mac_rescan_table(struct bgp *bgp, struct peer *peer, prd.prefixlen = 64; memcpy(&prd.val, &prn->p.u.val, 8); + if (CHECK_FLAG(pi->flags, BGP_PATH_REMOVED)) { + if (bgp_debug_update(peer, &rn->p, NULL, 1)) { + char pfx_buf[BGP_PRD_PATH_STRLEN]; + + bgp_debug_rdpfxpath2str( + AFI_L2VPN, SAFI_EVPN, &prd, + &rn->p, label_pnt, num_labels, + pi->addpath_rx_id ? 1 : 0, + pi->addpath_rx_id, pfx_buf, + sizeof(pfx_buf)); + zlog_debug( + "%s skip update of %s marked as removed", + peer->host, pfx_buf); + } + continue; + } + memcpy(&evpn, &pi->attr->evpn_overlay, sizeof(evpn)); int32_t ret = bgp_update(peer, &rn->p, pi->addpath_rx_id,