]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgpd: Fix deterministic-med check for stale paths
authorvivek <vivek@cumulusnetworks.com>
Thu, 3 Dec 2020 04:04:19 +0000 (20:04 -0800)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Thu, 16 Feb 2023 19:46:38 +0000 (19:46 +0000)
When performing deterministic MED processing, ensure that the peer
status is not checked when we encounter a stale path. Otherwise, this
path will be skipped from the DMED consideration leading to it potentially
not being installed.

Test scenario: Consider a prefix with 2 (multi)paths. The peer that
announces the path with the winning DMED undergoes a graceful-restart.
Before it comes back up, the other path goes away. Prior to the fix, a
third router that receives both these paths would have ended up not
having any path installed to the prefix after the above events.

Signed-off-by: Vivek Venkatraman <vivek@nvidia.com>
For internal use:
Ticket: CM-32032
Testing done: Multiple manual testing

(cherry picked from commit de692a4ebe0b8ea8e191d8ac1f3b41a386edd577)

bgpd/bgp_route.c

index d7ff0e3c0a3c76034ec76c4ef7ca26d1791bf98d..17a01fa77ed268e0d85d73bf5ac9991b13c02e7a 100644 (file)
@@ -2658,9 +2658,12 @@ void bgp_best_selection(struct bgp *bgp, struct bgp_dest *dest,
                                continue;
                        if (BGP_PATH_HOLDDOWN(pi1))
                                continue;
-                       if (pi1->peer != bgp->peer_self)
+                       if (pi1->peer != bgp->peer_self &&
+                           !CHECK_FLAG(pi1->peer->sflags,
+                                       PEER_STATUS_NSF_WAIT)) {
                                if (!peer_established(pi1->peer))
                                        continue;
+                       }
 
                        new_select = pi1;
                        if (pi1->next) {