]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: skip evpn remove marked routes from rescan
authorChirag Shah <chirag@cumulusnetworks.com>
Tue, 4 Jun 2019 01:42:00 +0000 (18:42 -0700)
committerChirag Shah <chirag@cumulusnetworks.com>
Thu, 13 Jun 2019 04:46:16 +0000 (21:46 -0700)
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 <chirag@cumulusnetworks.com>
bgpd/bgp_mac.c

index f19453fecb68db648532a1da44d79f9b19d7a6e0..b05ca87319132715068303c14346084a6dd7d4c7 100644 (file)
@@ -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,