-
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: fix updating ipv6 global nexthop #17152
base: master
Are you sure you want to change the base?
Conversation
@leonshaw. Here is the fix for the unsent global nexthop that was mentionned here #17073 (comment) Please open an issue or publish a fix for the similar issue with link-local nexthop |
Link-local address is complicated as it affects the number of next-hops. I'd like to have a general discussion on this (#17128) before seeking a fix. |
bgpd/bgp_zebra.c
Outdated
for (ALL_LIST_ELEMENTS(bgp->peer, node, nnode, peer)) { | ||
v6_ll_in_nh_global = false; | ||
|
||
if (IN6_IS_ADDR_LINKLOCAL(&peer->nexthop.v6_global)) { |
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.
If the address is removed and re-added, peer->nexthop.v6_global
may have been zeroed in bgp_interface_address_delete()
. Can we also handle this case?
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.
fixed
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.
I have also fixed the bgp_interface_address_delete() for global
bgpd/bgp_zebra.c
Outdated
if (connected->address->family != AF_INET6) | ||
continue; | ||
if (!IPV6_ADDR_SAME(&connected->address->u.prefix6, | ||
&peer->nexthop.v6_global)) |
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.
Different interfaces may have identical link-local address. How about comparing interface name with peer->nexthop.ifp->name
?
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.
fixed. I now compare nexthop.ifp and ifc->ifp
Move common checks outside of the loop. Signed-off-by: Louis Scalbert <[email protected]>
Reduce bgp_interface_address_add indentation Signed-off-by: Louis Scalbert <[email protected]>
Log new IPv6 global address in bgp_interface_address_add Signed-off-by: Louis Scalbert <[email protected]>
bgpd keeps on advertising IPv6 prefixes with a IPv6 link-local nexthop or a IPv4-mapped IPv6 after a valid IPv6 global appears. For example, at bgpd startup, the IPv6 global is announced by zebra after the link-local. Only the link-local is advertised. Clearing the BGP sessions make the global to to be announced. Update the nexthops with the global IPv6 when available. Do not override any previous global address that is still valid. Signed-off-by: Louis Scalbert <[email protected]>
Add bgp_nexthop_mp_ipv4_6 topotest to test to nexhop value with MP-BGP IPv4 and IPv6 on IPv4 peering. The test has route-reflector, route-server, iBGP and eBGP peers. Signed-off-by: Louis Scalbert <[email protected]>
Move common checks outside of the loop. Signed-off-by: Louis Scalbert <[email protected]>
When the IPv6 global is removed on an interface towards a peer, the IPv6 nexthop global is reset. It should be another global or a link-local. At removal, replace the global by the next global address or the link-local as last resort. Signed-off-by: Louis Scalbert <[email protected]>
Check that we can set back the ipv6 global nexthop. Signed-off-by: Louis Scalbert <[email protected]>
812faf5
to
3f485c7
Compare
Looks good to me. But seems a test case is failing... I'm not sure whether the next-hop should be IPv4-mapped or link-local in the absence of global address. |
bgpd keeps on advertising IPv6 prefixes with a IPv6 link-local nexthop
after a valid IPv6 global appears.
At bgpd startup, the IPv6 global is announced by zebra after the
link-local. Only the link-local is advertised. Clearing the BGP sessions
make the global to to be announced.
Update the nexthops with the global IPv6 when available.