-
Notifications
You must be signed in to change notification settings - Fork 114
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
default RA lifetime not set in route #428
Comments
Found it, in if-linux and ipv6. I'll create a patch to send it to netlink. |
Sends route lifetime to NETLINK RTA_EXPIRES Partially addresses NetworkConfiguration#428
ISC dhclient doesn't set any routes, just addresses. dhcpcd will expire the routes anyway, so any fix we do is purely cosmetic (unless of course dhcpcd has stopped for whatever reason) |
Yes, I agree it's purely cosmetic. I have some other code that reports the current route lifetime from nl, so this is why I'm adding it for informational purposes.
I found that out once I started looking deeper. :) |
If it helps, hop limit is defined here in the kernel: https://elixir.bootlin.com/linux/v6.12.6/source/include/uapi/linux/rtnetlink.h#L485 So it's a property of RTA_METRICS. Good luck! |
Unfortunately the change to add the lifetime to the route is not only cosmetic. It seems, that the lifetime does not get updated once a new RA is received and hence the route will expire, removed and only then re-added once a new RA is received. While before this did not happen. |
That's no good. I suspect what was happening before was it was effectively setting "infinite" lifetime for default route. I can replicate this. I think it needs a couple of fixes
|
We need to adjust the logic in route.c to always change the route if we have rt_expires set. |
RA spec doesn't define anything about refresh time, the standard is to remove the default route when it expires, and the kernel handles this correctly. What we're missing is dhcpcd does not send an RS to renew it. |
An issue that is probably related: dhcpcd assigns the same value to valid_lft and preferred_lft, which makes IPv6 completely drop out when they reach zero. This shouldn't happen if preferred_lft remains at around 80% of valid_lft and a RS is sent as soon as preferred_lft reaches zero. |
I see the issue. We copy the existing route from NL, including the expiry. We only update the expiry when we're writing out a new route. When we're adding an existing route, we should update the expiry to our new internal value rather than re-use the NL value. |
Ok, maybe not, we're loading up the old route to see if it exists, and then copying the route record from internal and back out to NL. So I think we just need to fix the route lifetime logic? |
I think I may have found it. We don't check acquired time when determining if a route has changed, and since the MTU is the same, we skip updating the route. Having it record and check the acquired time for a route should allow us to determine it's been updated and the new expiry can be pushed out to netlink. |
the default route is being sent by the router via RA, and they are setting a lifetime of 1800s and a hop limit of 64. However this is not showing up in the ip -6 route show.
dhcpcd 10.1.0 linux
here's what it looks like if I use ISC's dhclient 4.4.3
Any ideas where to start looking?
The text was updated successfully, but these errors were encountered: