From c869b3f87d4e7acd72eee6a4648606e136642f74 Mon Sep 17 00:00:00 2001 From: Chirag Shah Date: Mon, 3 Jun 2019 18:42:00 -0700 Subject: [PATCH] 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 --- bgpd/bgp_mac.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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, -- 2.39.5