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

Remove affected routes from cache on interface down? #340

Open
bg1729 opened this issue Mar 18, 2023 · 1 comment
Open

Remove affected routes from cache on interface down? #340

bg1729 opened this issue Mar 18, 2023 · 1 comment

Comments

@bg1729
Copy link

bg1729 commented Mar 18, 2023

Linux does not send RTM_DELROUTE messages when routes are deleted because an interface has gone down (info in [1], for example). It seems this is a kernel design decision (not a bug) to prevent floods of netlink messages being generated when a link with many associated routes goes down.

A libnl user could detect the link down transition and remove routes referencing that link from the route cache but I think it would be helpful if the caching system did this automatically, and fired the route change callback for the associated routes. As things are currently, the route cache loses synchronisation with the actual state of the Linux routing table when a link down event causes routes to be removed by the kernel.

1 https://www.spinics.net/lists/netdev/msg254186.html

@KanjiMonster
Copy link
Contributor

As a related topic, deleting an IPv4 nexthop will also remove all (single nexthop) routes using it without RTM_DELROUTE events. Deleting IPv6 nexthops do trigger RTM_DELROUTE events though (at least as of 6.1).

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

No branches or pull requests

2 participants