summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2023-09-14 20:17:07 +0200
committerDonatas Abraitis <donatas@opensourcerouting.org>2023-09-14 20:17:07 +0200
commitdc6fdaa27e62c75ac2a1831633ce6637b9d468fc (patch)
tree91199079cb1a9d505cb398bd8ba4426ece48144d
parentMerge pull request #14383 from donaldsharp/bgp_coverity_cleanup_early_sept (diff)
downloadfrr-dc6fdaa27e62c75ac2a1831633ce6637b9d468fc.tar.xz
frr-dc6fdaa27e62c75ac2a1831633ce6637b9d468fc.zip
bgpd: Remove private ASNs after we modify the as-path with the route-map
If we modify as-path with route-map and prepend with private ASNs, then we advertise a new as-path without stripping private ASNs. Let's fix this, and remove private ASNs despite if they were sent by the origin or prepended locally. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
-rw-r--r--bgpd/bgp_route.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index 227a68ee5..df3397af9 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -2378,9 +2378,6 @@ bool subgroup_announce_check(struct bgp_dest *dest, struct bgp_path_info *pi,
bgp_otc_egress(peer, attr))
return false;
- bgp_peer_remove_private_as(bgp, afi, safi, peer, attr);
- bgp_peer_as_override(bgp, afi, safi, peer, attr);
-
if (filter->advmap.update_type == UPDATE_TYPE_WITHDRAW &&
filter->advmap.aname &&
route_map_lookup_by_name(filter->advmap.aname)) {
@@ -2453,6 +2450,9 @@ bool subgroup_announce_check(struct bgp_dest *dest, struct bgp_path_info *pi,
}
}
+ bgp_peer_remove_private_as(bgp, afi, safi, peer, attr);
+ bgp_peer_as_override(bgp, afi, safi, peer, attr);
+
/* RFC 8212 to prevent route leaks.
* This specification intends to improve this situation by requiring the
* explicit configuration of both BGP Import and Export Policies for any