-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bgpd - Exclude case for remote prefix w/o link-local #16198 #16219
bgpd - Exclude case for remote prefix w/o link-local #16198 #16219
Conversation
How does one include topology tests? |
ff7584d
to
32f263a
Compare
Some topo test are failing and I can see why this would break some other valid scenarios. Maybe the previous proposal to put this check behind |
An alternative potential fix:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good
I dug into the failing test some more and I believe that this code breaks that valid scenario, where the destination_peer is EBGP and we are actually replacing the next-hop with the outgoing interface global IPv6, so adding our own link-link is valid. I am finding it difficult to isolate our specific case which is not represented in these topology tests. In our case the prefix originator is also on the same network as the EBGP peer and so our DUT is NOT replacing the global next-hop, but that decision (not to update the global next-hop) is made in a different part of the code :-/ |
I think the test needs to be modified to support this change ... :-( |
Thanks @riw777 . Do you already ready have an idea how those test changes would look like? Happy to add them to get this PR in but I don’t have the resources to build a test environment currently. |
945f6ef
to
5cdec85
Compare
5cdec85
to
34f3352
Compare
If we expand the truth (A || B) to "(A && B) || (A && !B) || (!A && B)" so that we can isolate the case (!A && B), we then add the additional check (C) to ensure that original route actually has a link-local hext-hop Signed-off-by: Richard Cunningham <[email protected]>
34f3352
to
5f6a61f
Compare
@riw777 - After a rebase to pick up the latest test refactors looks like all tests are now passing. Is this now good to go? |
Hey @riw777 - as the tests are passing now, can we kindly ask you to recheck the code and give us a stamp, please? We have a blocker using FRR w/ IPv6 now for a while that is soon reaching the deadline. So your help would be more than appreciated. Thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good
This PR now removes the link-local in cases it was valid. Why doesn't this pull-request have any topotests? I cannot reproduce the issue that was described in the initial issue. About the change:
is actually:
@cunningr @anaperic could you provide the failing configuration ? And a topotests to check the issue |
If you use a BGPClient other than FRR (ExaBGP, BIRD) and advertise a locally originated IPv6 prefix, it will NOT add the link-local, even though the global NH is on the same network segment. Then FRR, when onward advertising the IPv6 prefix to a peer also on the same network segment, FRR will now insert it's own link-local NH.
So now the "Cisco" router gets a prefix with the Global NH of the BGPClient (OK) but a link-local NH of the FRR (NOK). If the link-local is present the link-local is preferred and connectivity breaks (since our FRR is not forwarding traffic). Since the link-local is not present when advertised by the BGPClient, we expect FRR to NOT insert it's own in this case. |
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]>
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]>
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]>
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]>
This is another potential fix for #16198
(from == bgp->peer_self || peer->sort == BGP_PEER_EBGP)
to an&&
operator.IN6_IS_ADDR_LINKLOCAL(&attr->mp_nexthop_local)
(e.g. link-local nh is actually included by remote peer.In rfc2545 section 3 we have:
The code in FRR assumes that a remote prefix from a device on the same segment as an eBGP peer already has it's link-local next-hop field set and sets
attr->mp_nexthop_len = BGP_ATTR_NHLEN_IPV6_GLOBAL_AND_LL
. If this field is empty our own link-local will be added later in the update formation code HOWEVER the global next-hop is left unchanged.This proposal expands the truth of (A OR B) to "(A AND B) OR (!A AND B) OR (A AND !B)" such that we can isolate (!A AND B) and add an extra test to ensure that original next-hop actually contains a link-local.
Fixes: #16198