]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: Do not filter no-export community for BGP OAD (one administration domain)
authorDonatas Abraitis <donatas@opensourcerouting.org>
Fri, 18 Oct 2024 19:35:28 +0000 (22:35 +0300)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Tue, 22 Oct 2024 15:07:24 +0000 (15:07 +0000)
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)

bgpd/bgp_route.c

index 6ce182cfcd87e93ece4b0be136f04241f09c7c9c..96eabe1f4ecf2b4f49b7f4cb4edabf551b365d11 100644 (file)
@@ -1780,14 +1780,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;