Skip to content

Commit d494470

Browse files
committed
bgpd, tests: don't send local nexthop from rr client
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: #16219 (comment) Link: #17037 (comment) Signed-off-by: Louis Scalbert <[email protected]>
1 parent e40dd02 commit d494470

File tree

3 files changed

+13
-84
lines changed

3 files changed

+13
-84
lines changed

bgpd/bgp_route.c

+1
Original file line numberDiff line numberDiff line change
@@ -2472,6 +2472,7 @@ bool subgroup_announce_check(struct bgp_dest *dest, struct bgp_path_info *pi,
24722472
if (IN6_IS_ADDR_LINKLOCAL(&attr->mp_nexthop_local))
24732473
global_and_ll = true;
24742474
} else if (!ibgp_to_ibgp && !transparent &&
2475+
!CHECK_FLAG(from->af_flags[afi][safi], PEER_FLAG_REFLECTOR_CLIENT) &&
24752476
IN6_IS_ADDR_LINKLOCAL(&peer->nexthop.v6_local) && peer->shared_network &&
24762477
(from == bgp->peer_self || peer->sort == BGP_PEER_EBGP))
24772478
global_and_ll = true;

tests/topotests/bgp_nexthop_ipv6/r4/show_bgp_ipv6_step2.json

+6-42
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,7 @@
99
"ip": "fd00:0:2::1",
1010
"hostname": "rr",
1111
"afi": "ipv6",
12-
"scope": "global"
13-
},
14-
{
15-
"ip": "link-local:rr:eth-sw",
16-
"hostname": "rr",
17-
"afi": "ipv6",
18-
"scope": "link-local",
12+
"scope": "global",
1913
"used": true
2014
}
2115
]
@@ -28,13 +22,7 @@
2822
"ip": "fd00:0:2::2",
2923
"hostname": "rr",
3024
"afi": "ipv6",
31-
"scope": "global"
32-
},
33-
{
34-
"ip": "link-local:rr:eth-sw",
35-
"hostname": "rr",
36-
"afi": "ipv6",
37-
"scope": "link-local",
25+
"scope": "global",
3826
"used": true
3927
}
4028
]
@@ -47,13 +35,7 @@
4735
"ip": "fd00:0:2::3",
4836
"hostname": "rr",
4937
"afi": "ipv6",
50-
"scope": "global"
51-
},
52-
{
53-
"ip": "link-local:rr:eth-sw",
54-
"hostname": "rr",
55-
"afi": "ipv6",
56-
"scope": "link-local",
38+
"scope": "global",
5739
"used": true
5840
}
5941
]
@@ -117,13 +99,7 @@
11799
"ip": "fd00:0:2::1",
118100
"hostname": "rr",
119101
"afi": "ipv6",
120-
"scope": "global"
121-
},
122-
{
123-
"ip": "link-local:rr:eth-sw",
124-
"hostname": "rr",
125-
"afi": "ipv6",
126-
"scope": "link-local",
102+
"scope": "global",
127103
"used": true
128104
}
129105
]
@@ -136,13 +112,7 @@
136112
"ip": "fd00:0:2::2",
137113
"hostname": "rr",
138114
"afi": "ipv6",
139-
"scope": "global"
140-
},
141-
{
142-
"ip": "link-local:rr:eth-sw",
143-
"hostname": "rr",
144-
"afi": "ipv6",
145-
"scope": "link-local",
115+
"scope": "global",
146116
"used": true
147117
}
148118
]
@@ -155,13 +125,7 @@
155125
"ip": "fd00:0:2::3",
156126
"hostname": "rr",
157127
"afi": "ipv6",
158-
"scope": "global"
159-
},
160-
{
161-
"ip": "link-local:rr:eth-sw",
162-
"hostname": "rr",
163-
"afi": "ipv6",
164-
"scope": "link-local",
128+
"scope": "global",
165129
"used": true
166130
}
167131
]

tests/topotests/bgp_nexthop_ipv6/r5/show_bgp_ipv6_step2.json

+6-42
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,7 @@
99
"ip": "fd00:0:3::9",
1010
"hostname": "rr",
1111
"afi": "ipv6",
12-
"scope": "global"
13-
},
14-
{
15-
"ip": "link-local:rr:eth-r5",
16-
"hostname": "rr",
17-
"afi": "ipv6",
18-
"scope": "link-local",
12+
"scope": "global",
1913
"used": true
2014
}
2115
]
@@ -28,13 +22,7 @@
2822
"ip": "fd00:0:3::9",
2923
"hostname": "rr",
3024
"afi": "ipv6",
31-
"scope": "global"
32-
},
33-
{
34-
"ip": "link-local:rr:eth-r5",
35-
"hostname": "rr",
36-
"afi": "ipv6",
37-
"scope": "link-local",
25+
"scope": "global",
3826
"used": true
3927
}
4028
]
@@ -47,13 +35,7 @@
4735
"ip": "fd00:0:3::9",
4836
"hostname": "rr",
4937
"afi": "ipv6",
50-
"scope": "global"
51-
},
52-
{
53-
"ip": "link-local:rr:eth-r5",
54-
"hostname": "rr",
55-
"afi": "ipv6",
56-
"scope": "link-local",
38+
"scope": "global",
5739
"used": true
5840
}
5941
]
@@ -117,13 +99,7 @@
11799
"ip": "fd00:0:3::9",
118100
"hostname": "rr",
119101
"afi": "ipv6",
120-
"scope": "global"
121-
},
122-
{
123-
"ip": "link-local:rr:eth-r5",
124-
"hostname": "rr",
125-
"afi": "ipv6",
126-
"scope": "link-local",
102+
"scope": "global",
127103
"used": true
128104
}
129105
]
@@ -136,13 +112,7 @@
136112
"ip": "fd00:0:3::9",
137113
"hostname": "rr",
138114
"afi": "ipv6",
139-
"scope": "global"
140-
},
141-
{
142-
"ip": "link-local:rr:eth-r5",
143-
"hostname": "rr",
144-
"afi": "ipv6",
145-
"scope": "link-local",
115+
"scope": "global",
146116
"used": true
147117
}
148118
]
@@ -155,13 +125,7 @@
155125
"ip": "fd00:0:3::9",
156126
"hostname": "rr",
157127
"afi": "ipv6",
158-
"scope": "global"
159-
},
160-
{
161-
"ip": "link-local:rr:eth-r5",
162-
"hostname": "rr",
163-
"afi": "ipv6",
164-
"scope": "link-local",
128+
"scope": "global",
165129
"used": true
166130
}
167131
]

0 commit comments

Comments
 (0)