]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd, tests: don't send local nexthop from rr client 17073/head
authorLouis Scalbert <louis.scalbert@6wind.com>
Fri, 11 Oct 2024 04:59:16 +0000 (06:59 +0200)
committerLouis Scalbert <louis.scalbert@6wind.com>
Mon, 14 Oct 2024 08:06:35 +0000 (10:06 +0200)
AS 65000  | AS 65001
          |
      RR  |
       |  |
R1 --- | --- R2
          |

When r1 peer is an iBGP route reflector client of rr and r2 peer is a
eBGP neighbor of rr, and all three routers shares the same network, r2
receives announcements coming from r1 with a IPv6 link-local nexthop
from rr. This is incorrect as r2 should send traffic to r1 without
involving rr.

Do not send an IPv6 link-local nexthop if the originating peer is a
route-reflector client.

Link: https://github.com/FRRouting/frr/pull/16219#issuecomment-2397425505
Link: https://github.com/FRRouting/frr/pull/17037#discussion_r1792529683
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
bgpd/bgp_route.c
tests/topotests/bgp_nexthop_ipv6/r4/show_bgp_ipv6_step2.json
tests/topotests/bgp_nexthop_ipv6/r5/show_bgp_ipv6_step2.json

index d69c263196c3863743e7261264d78967c1ad334c..5fd058b6b597b04464f78155e3b36ac2cde9013f 100644 (file)
@@ -2472,6 +2472,7 @@ bool subgroup_announce_check(struct bgp_dest *dest, struct bgp_path_info *pi,
                        if (IN6_IS_ADDR_LINKLOCAL(&attr->mp_nexthop_local))
                                global_and_ll = true;
                } else if (!ibgp_to_ibgp && !transparent &&
+                          !CHECK_FLAG(from->af_flags[afi][safi], PEER_FLAG_REFLECTOR_CLIENT) &&
                           IN6_IS_ADDR_LINKLOCAL(&peer->nexthop.v6_local) && peer->shared_network &&
                           (from == bgp->peer_self || peer->sort == BGP_PEER_EBGP))
                        global_and_ll = true;
index 35a31e63f92103303878a51778643e8ed477075b..5506f07f29c6f004e90c5a67c55d7a2567bfbca8 100644 (file)
@@ -9,13 +9,7 @@
             "ip": "fd00:0:2::1",
             "hostname": "rr",
             "afi": "ipv6",
-            "scope": "global"
-          },
-          {
-            "ip": "link-local:rr:eth-sw",
-            "hostname": "rr",
-            "afi": "ipv6",
-            "scope": "link-local",
+            "scope": "global",
             "used": true
           }
         ]
             "ip": "fd00:0:2::2",
             "hostname": "rr",
             "afi": "ipv6",
-            "scope": "global"
-          },
-          {
-            "ip": "link-local:rr:eth-sw",
-            "hostname": "rr",
-            "afi": "ipv6",
-            "scope": "link-local",
+            "scope": "global",
             "used": true
           }
         ]
             "ip": "fd00:0:2::3",
             "hostname": "rr",
             "afi": "ipv6",
-            "scope": "global"
-          },
-          {
-            "ip": "link-local:rr:eth-sw",
-            "hostname": "rr",
-            "afi": "ipv6",
-            "scope": "link-local",
+            "scope": "global",
             "used": true
           }
         ]
             "ip": "fd00:0:2::1",
             "hostname": "rr",
             "afi": "ipv6",
-            "scope": "global"
-          },
-          {
-            "ip": "link-local:rr:eth-sw",
-            "hostname": "rr",
-            "afi": "ipv6",
-            "scope": "link-local",
+            "scope": "global",
             "used": true
           }
         ]
             "ip": "fd00:0:2::2",
             "hostname": "rr",
             "afi": "ipv6",
-            "scope": "global"
-          },
-          {
-            "ip": "link-local:rr:eth-sw",
-            "hostname": "rr",
-            "afi": "ipv6",
-            "scope": "link-local",
+            "scope": "global",
             "used": true
           }
         ]
             "ip": "fd00:0:2::3",
             "hostname": "rr",
             "afi": "ipv6",
-            "scope": "global"
-          },
-          {
-            "ip": "link-local:rr:eth-sw",
-            "hostname": "rr",
-            "afi": "ipv6",
-            "scope": "link-local",
+            "scope": "global",
             "used": true
           }
         ]
index d0875474ae94f69d52c7d1a79781b449cb64145e..afcf7c3ffc5a03ef4d146102b83bb2a60e9222f2 100644 (file)
@@ -9,13 +9,7 @@
             "ip": "fd00:0:3::9",
             "hostname": "rr",
             "afi": "ipv6",
-            "scope": "global"
-          },
-          {
-            "ip": "link-local:rr:eth-r5",
-            "hostname": "rr",
-            "afi": "ipv6",
-            "scope": "link-local",
+            "scope": "global",
             "used": true
           }
         ]
             "ip": "fd00:0:3::9",
             "hostname": "rr",
             "afi": "ipv6",
-            "scope": "global"
-          },
-          {
-            "ip": "link-local:rr:eth-r5",
-            "hostname": "rr",
-            "afi": "ipv6",
-            "scope": "link-local",
+            "scope": "global",
             "used": true
           }
         ]
             "ip": "fd00:0:3::9",
             "hostname": "rr",
             "afi": "ipv6",
-            "scope": "global"
-          },
-          {
-            "ip": "link-local:rr:eth-r5",
-            "hostname": "rr",
-            "afi": "ipv6",
-            "scope": "link-local",
+            "scope": "global",
             "used": true
           }
         ]
             "ip": "fd00:0:3::9",
             "hostname": "rr",
             "afi": "ipv6",
-            "scope": "global"
-          },
-          {
-            "ip": "link-local:rr:eth-r5",
-            "hostname": "rr",
-            "afi": "ipv6",
-            "scope": "link-local",
+            "scope": "global",
             "used": true
           }
         ]
             "ip": "fd00:0:3::9",
             "hostname": "rr",
             "afi": "ipv6",
-            "scope": "global"
-          },
-          {
-            "ip": "link-local:rr:eth-r5",
-            "hostname": "rr",
-            "afi": "ipv6",
-            "scope": "link-local",
+            "scope": "global",
             "used": true
           }
         ]
             "ip": "fd00:0:3::9",
             "hostname": "rr",
             "afi": "ipv6",
-            "scope": "global"
-          },
-          {
-            "ip": "link-local:rr:eth-r5",
-            "hostname": "rr",
-            "afi": "ipv6",
-            "scope": "link-local",
+            "scope": "global",
             "used": true
           }
         ]