-
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
Update route if acquired time changes #441
Update route if acquired time changes #441
Conversation
Records last time route was acquired so we can determine if change needs to be pushed out to network. Allows for route expiry to be updated by RouterAdvertisement for example.
I have tested this fix with a 600s RA renewal with 1800s lifetime. Every 10 minutes or so we see the RA come in, and I see the route lifetime get re-updated to 1800s each time. |
Gate route lifetime to linux only route expiry is calculated when we recieve RA, so when it is updated, and difference between new and old is greater than 30s, push the update to the system.
Everything about IPv6 is lifetime, not expiry. Only linux routes have an expiry.
@ColinMcInnes I've pushed some changes. I finally got around to testing this on a Fedora box and spotted some issues which are now resolved. Please review my changes and comment if you agree or not. This cosmetic change is proving a lot of trouble and has revealed a very poor implementation which I've noted in comments. |
OK, this is not consistent at all! In the kernel RTA_EXPIRES is only set for IPv4 multicast routes when emitting route changes and only read for IPv6 routes when userland makes route changes. We cannot set this for non IPv6 routes currently. To make it worse, we set a UINT32 for IPv6 routes but read a UINT64 for IPv4 multicast routes. To make this even more totally bonkers, the expiry we set for the IPv6 route can be read back via RTA_CACHEINE rta_expires but we need to convert to divide it by hz.
e51efc1
to
a0b96bc
Compare
If a route gets an update (say from an RA), consider it changed so new expiry gets pushed out to system.
Resolves #428