From: Donatas Abraitis Date: Fri, 18 Oct 2024 19:35:28 +0000 (+0300) Subject: bgpd: Do not filter no-export community for BGP OAD (one administration domain) X-Git-Tag: base_10.3~319^2~1 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=e63b1520f1ad1036455c1626a388ac3afb7f9d6d;p=matthieu%2Ffrr.git 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 --- diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 9f44e7913a..4374a1a4c2 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -1779,14 +1779,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;