summaryrefslogtreecommitdiff
path: root/bgpd
diff options
context:
space:
mode:
authorRuss White <russ@riw.us>2025-01-28 11:29:15 -0500
committerGitHub <noreply@github.com>2025-01-28 11:29:15 -0500
commit219b00cb74a76f1af4e739cbe912ee9a4419ccb9 (patch)
tree3ee2c03c81c9538ac8ab4c0010a6204fa8be399b /bgpd
parentcec2e9b1594f170ceb3bce159a21b87c9b6fb2f7 (diff)
parent9f5536807eadbc2e729492cfd87d38007f19236c (diff)
Merge pull request #17924 from donaldsharp/evaluate_paths_optimization
bgpd: Optimize evaluate paths for a peer going down
Diffstat (limited to 'bgpd')
-rw-r--r--bgpd/bgp_nht.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/bgpd/bgp_nht.c b/bgpd/bgp_nht.c
index 164e2300c0..2ef7ec97e3 100644
--- a/bgpd/bgp_nht.c
+++ b/bgpd/bgp_nht.c
@@ -1278,6 +1278,25 @@ void evaluate_paths(struct bgp_nexthop_cache *bnc)
}
LIST_FOREACH (path, &(bnc->paths), nh_thread) {
+ /*
+ * Currently when a peer goes down, bgp immediately
+ * sees this via the interface events( if it is directly
+ * connected). And in this case it takes and puts on
+ * a special peer queue all path info's associated with
+ * but these items are not yet processed typically when
+ * the nexthop is being handled here. Thus we end
+ * up in a situation where the process Queue for BGP
+ * is being asked to look at the same path info multiple
+ * times. Let's just cut to the chase here and if
+ * the bnc has a peer associated with it and the path info
+ * being looked at uses that peer and the peer is no
+ * longer established we know the path_info is being
+ * handled elsewhere and we do not need to process
+ * it here at all since the pathinfo is going away
+ */
+ if (peer && path->peer == peer && !peer_established(peer->connection))
+ continue;
+
if (path->type == ZEBRA_ROUTE_BGP &&
(path->sub_type == BGP_ROUTE_NORMAL ||
path->sub_type == BGP_ROUTE_STATIC ||