Skip to content
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

Merged
merged 10 commits into from
Feb 5, 2025

Conversation

ColinMcInnes
Copy link
Contributor

@ColinMcInnes ColinMcInnes commented Jan 24, 2025

If a route gets an update (say from an RA), consider it changed so new expiry gets pushed out to system.

Resolves #428

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.
src/route.c Outdated Show resolved Hide resolved
@ColinMcInnes
Copy link
Contributor Author

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.

src/route.h Outdated Show resolved Hide resolved
src/route.c Outdated Show resolved Hide resolved
src/route.c Outdated Show resolved Hide resolved
ColinMcInnes and others added 3 commits February 2, 2025 17:57
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.
@rsmarples
Copy link
Member

@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.

src/route.c Outdated Show resolved Hide resolved
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.
@rsmarples rsmarples merged commit 46822c2 into NetworkConfiguration:master Feb 5, 2025
2 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

default RA lifetime not set in route
2 participants