Skip to content

Commit

Permalink
bgpd: Do not filter no-export community for BGP OAD (one administrati…
Browse files Browse the repository at this point in the history
…on 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 <[email protected]>
  • Loading branch information
ton31337 committed Oct 18, 2024
1 parent 75e34c0 commit e63b152
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions bgpd/bgp_route.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e63b152

Please sign in to comment.