summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_route.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2024-11-07 17:29:51 +0100
committerDonald Sharp <sharpd@nvidia.com>2024-11-07 17:57:34 +0100
commit16bb31595793c0d6dd81ff104932d52c4411f7d8 (patch)
tree34d0b6bcf31bdc93be467a841b980dc92e1686b3 /bgpd/bgp_route.c
parentMerge pull request #17376 from opensourcerouting/fix/stale_routes_with_addpath (diff)
downloadfrr-16bb31595793c0d6dd81ff104932d52c4411f7d8.tar.xz
frr-16bb31595793c0d6dd81ff104932d52c4411f7d8.zip
bgpd: Pass in the prefix instead of looking it up again
In an attempt to make the code faster let's just pass in the prefix instead of having to do a lookup a majillion times again after we already have it. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to '')
-rw-r--r--bgpd/bgp_route.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index 74b227f97..5b9b9e3db 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -4388,12 +4388,9 @@ void bgp_rib_remove(struct bgp_dest *dest, struct bgp_path_info *pi,
bgp_process(peer->bgp, dest, pi, afi, safi);
}
-static void bgp_rib_withdraw(struct bgp_dest *dest, struct bgp_path_info *pi,
- struct peer *peer, afi_t afi, safi_t safi,
- struct prefix_rd *prd)
+static void bgp_rib_withdraw(const struct prefix *p, struct bgp_dest *dest, struct bgp_path_info *pi,
+ struct peer *peer, afi_t afi, safi_t safi, struct prefix_rd *prd)
{
- const struct prefix *p = bgp_dest_get_prefix(dest);
-
/* apply dampening, if result is suppressed, we'll be retaining
* the bgp_path_info in the RIB for historical reference.
*/
@@ -5568,7 +5565,7 @@ void bgp_withdraw(struct peer *peer, const struct prefix *p,
/* Withdraw specified route from routing table. */
if (pi && !CHECK_FLAG(pi->flags, BGP_PATH_HISTORY)) {
- bgp_rib_withdraw(dest, pi, peer, afi, safi, prd);
+ bgp_rib_withdraw(p, dest, pi, peer, afi, safi, prd);
if (SAFI_UNICAST == safi
&& (bgp->inst_type == BGP_INSTANCE_TYPE_VRF
|| bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT)) {