summaryrefslogtreecommitdiff
path: root/bgpd
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2024-10-18 22:35:28 +0300
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2024-10-22 15:07:34 +0000
commitf6e58e0aab9ca3517cc10f21ebdf1fe97f4543f6 (patch)
tree6c13730fed08ffa9a396ae610bb7224633e475c2 /bgpd
parent29ed8be6c00643f421b30b83305f979d9de3ed30 (diff)
bgpd: Do not filter no-export community for BGP OAD (one administration domain)
OAD is treated as an _internal_ BGP peer, and some of the rules (including BGP attributes) can be relaxed. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org> (cherry picked from commit e63b1520f1ad1036455c1626a388ac3afb7f9d6d)
Diffstat (limited to 'bgpd')
-rw-r--r--bgpd/bgp_route.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index 404d7b153c..15e771dffb 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -1690,14 +1690,13 @@ static bool bgp_community_filter(struct peer *peer, struct attr *attr)
return true;
/* NO_EXPORT check. */
- if (peer->sort == BGP_PEER_EBGP &&
- community_include(bgp_attr_get_community(attr),
- COMMUNITY_NO_EXPORT))
+ if (peer->sort == BGP_PEER_EBGP && peer->sub_sort != BGP_PEER_EBGP_OAD &&
+ community_include(bgp_attr_get_community(attr), COMMUNITY_NO_EXPORT))
return true;
/* NO_EXPORT_SUBCONFED check. */
- if (peer->sort == BGP_PEER_EBGP
- || peer->sort == BGP_PEER_CONFED)
+ if ((peer->sort == BGP_PEER_EBGP && peer->sub_sort != BGP_PEER_EBGP_OAD) ||
+ peer->sort == BGP_PEER_CONFED)
if (community_include(bgp_attr_get_community(attr),
COMMUNITY_NO_EXPORT_SUBCONFED))
return true;