summaryrefslogtreecommitdiffstats
path: root/bgpd
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2022-01-12 15:49:59 +0100
committerDonald Sharp <sharpd@nvidia.com>2022-01-12 15:53:15 +0100
commit52979c3baa1981c03d312e0944029b32d13ac56a (patch)
treed9b1d9014ab7a0531a978599fb1baaf4f81d6d55 /bgpd
parentMerge pull request #10212 from mobash-rasool/mld-pim6-dev-prefix (diff)
downloadfrr-52979c3baa1981c03d312e0944029b32d13ac56a.tar.xz
frr-52979c3baa1981c03d312e0944029b32d13ac56a.zip
bgpd: Remove unneeded loop over all peers
The bgp_notify_conditional_adv_scanner function was/is looping over all peers. And only matching on the passed in peer, based upon the subgroup. As such we do not need to loop over everything and just cut-to-the chase and just modify the peer structure. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'bgpd')
-rw-r--r--bgpd/bgp_route.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index 3836d5f24..5318ee28e 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -1803,27 +1803,18 @@ void bgp_attr_add_gshut_community(struct attr *attr)
/* Notify BGP Conditional advertisement scanner process. */
void bgp_notify_conditional_adv_scanner(struct update_subgroup *subgrp)
{
- struct peer *temp_peer;
struct peer *peer = SUBGRP_PEER(subgrp);
- struct listnode *temp_node, *temp_nnode = NULL;
afi_t afi = SUBGRP_AFI(subgrp);
safi_t safi = SUBGRP_SAFI(subgrp);
- struct bgp *bgp = SUBGRP_INST(subgrp);
struct bgp_filter *filter = &peer->filter[afi][safi];
if (!ADVERTISE_MAP_NAME(filter))
return;
- for (ALL_LIST_ELEMENTS(bgp->peer, temp_node, temp_nnode, temp_peer)) {
- if (!CHECK_FLAG(peer->flags, PEER_FLAG_CONFIG_NODE))
- continue;
-
- if (peer != temp_peer)
- continue;
+ if (!CHECK_FLAG(peer->flags, PEER_FLAG_CONFIG_NODE))
+ return;
- temp_peer->advmap_table_change = true;
- break;
- }
+ peer->advmap_table_change = true;
}