]> git.puffer.fish Git - mirror/frr.git/commit
bgpd: apply route-map for aggregate before attribute comparison
authorEnke Chen <enchen@paloaltonetworks.com>
Thu, 9 Jan 2025 01:34:29 +0000 (17:34 -0800)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Tue, 14 Jan 2025 15:13:36 +0000 (15:13 +0000)
commit159743f24f93539141f1b606ee04a70e19e0589b
tree5b916ab2a8e8713df1db5292100bd310538e493f
parent75e28aeef00a8ef3d90b0b12180f6b068926cb37
bgpd: apply route-map for aggregate before attribute comparison

Currently when re-evaluating an aggregate route, the full attribute of
the aggregate route is not compared with the existing one in the BGP
table. That can result in unnecessary churns (un-install and then
install) of the aggregate route when a more specific route is added or
deleted, or when the route-map for the aggregate changes. The churn
would impact route installation and route advertisement.

The fix is to apply the route-map for the aggregate first and then
compare the attribute.

Here is an example of the churn:

debug bgp aggregate prefix 5.5.5.0/24
!
route-map set-comm permit 10
 set community 65004:200
!
router bgp 65001
 address-family ipv4 unicast
  redistribute static
  aggregate-address 5.5.5.0/24 route-map set-comm
!

Step 1:
  ip route 5.5.5.1/32 Null0

Jan  8 10:28:49 enke-vm1 bgpd[285786]: [J7PXJ-A7YA2] bgp_aggregate_install: aggregate 5.5.5.0/24, count 1
Jan  8 10:28:49 enke-vm1 bgpd[285786]: [Y444T-HEVNG]   aggregate 5.5.5.0/24: installed

Step 2:
  ip route 5.5.5.2/32 Null0

Jan  8 10:29:03 enke-vm1 bgpd[285786]: [J7PXJ-A7YA2] bgp_aggregate_install: aggregate 5.5.5.0/24, count 2
Jan  8 10:29:03 enke-vm1 bgpd[285786]: [S2EH5-EQSX6]   aggregate 5.5.5.0/24: existing, removed
Jan  8 10:29:03 enke-vm1 bgpd[285786]: [Y444T-HEVNG]   aggregate 5.5.5.0/24: installed
---

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
(cherry picked from commit 22d95f4ba8444171944eab29e99dfa6087813d6f)
bgpd/bgp_route.c