]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: Send non-transitive extended communities from/to OAD peers
authorDonatas Abraitis <donatas@opensourcerouting.org>
Tue, 21 Jan 2025 19:17:39 +0000 (21:17 +0200)
committerDonatas Abraitis <donatas@opensourcerouting.org>
Tue, 21 Jan 2025 19:17:39 +0000 (21:17 +0200)
draft-uttaro-idr-bgp-oad says:

Extended communities which are non-transitive across an AS boundary MAY be
advertised over an EBGP-OAD session if allowed by explicit policy configuration.
If allowed, all the members of the OAD SHOULD be configured to use the same
criteria.
For example, the Origin Validation State Extended Community, defined as
non-transitive in [RFC8097], can be advertised to peers in the same OAD.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
bgpd/bgp_route.c

index a1b12e5a86699128d83523b2d389a84b783f63b8..ef2d73de4b14ee5f31e6dee45750bdfea9940522 100644 (file)
@@ -2838,8 +2838,17 @@ bool subgroup_announce_check(struct bgp_dest *dest, struct bgp_path_info *pi,
         * If the extended community is non-transitive, strip it off,
         * unless it's a locally originated route (static, aggregate,
         * redistributed, etc.).
+        * draft-uttaro-idr-bgp-oad says:
+        * Extended communities which are non-transitive across an AS
+        * boundary MAY be advertised over an EBGP-OAD session if allowed
+        * by explicit policy configuration. If allowed, all the members
+        * of the OAD SHOULD be configured to use the same criteria.
+        * For example, the Origin Validation State Extended Community,
+        * defined as non-transitive in [RFC8097], can be advertised to
+        * peers in the same OAD.
         */
-       if (from->sort == BGP_PEER_EBGP && peer->sort == BGP_PEER_EBGP &&
+       if (from->sort == BGP_PEER_EBGP && from->sub_sort != BGP_PEER_EBGP_OAD &&
+           peer->sort == BGP_PEER_EBGP && peer->sub_sort != BGP_PEER_EBGP_OAD &&
            pi->sub_type == BGP_ROUTE_NORMAL) {
                struct ecommunity *new_ecomm;
                struct ecommunity *old_ecomm;