Skip to content

Commit

Permalink
bgpd, tests: don't send local nexthop from rr client
Browse files Browse the repository at this point in the history
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: FRRouting#16219 (comment)
Link: FRRouting#17037 (comment)
Signed-off-by: Louis Scalbert <[email protected]>
  • Loading branch information
louis-6wind committed Oct 11, 2024
1 parent e40dd02 commit d494470
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 84 deletions.
1 change: 1 addition & 0 deletions bgpd/bgp_route.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
48 changes: 6 additions & 42 deletions tests/topotests/bgp_nexthop_ipv6/r4/show_bgp_ipv6_step2.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
]
Expand All @@ -28,13 +22,7 @@
"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
}
]
Expand All @@ -47,13 +35,7 @@
"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
}
]
Expand Down Expand Up @@ -117,13 +99,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
}
]
Expand All @@ -136,13 +112,7 @@
"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
}
]
Expand All @@ -155,13 +125,7 @@
"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
}
]
Expand Down
48 changes: 6 additions & 42 deletions tests/topotests/bgp_nexthop_ipv6/r5/show_bgp_ipv6_step2.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
]
Expand All @@ -28,13 +22,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
}
]
Expand All @@ -47,13 +35,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
}
]
Expand Down Expand Up @@ -117,13 +99,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
}
]
Expand All @@ -136,13 +112,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
}
]
Expand All @@ -155,13 +125,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
}
]
Expand Down

0 comments on commit d494470

Please sign in to comment.