8000 cnetlink: sync route cache on linkdown events by KanjiMonster · Pull Request #469 · bisdn/basebox · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

cnetlink: sync route cache on linkdown events #469

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

Merged
merged 1 commit into from
Mar 24, 2025

Conversation

KanjiMonster
Copy link
Contributor

Work around missing route removal notifications from kernel on link down with routes targeting nexthops on that link by forcing a cache resync on link down events to catch removed routes.

When a link goes down, the kernel will delete all nexthops on that link without sending out netlink notifications.

When a nexthop gets deleted, the kernel will delete all routes with the nexthop as destination without sending out netlink notifications.

These two combined means that when using nexthop objects, like FRR does by default, deletion of routes on link loss are never seen by libnl, and consequently never seen by baseboxd.

This causes flow table entries for routes to persist even though they were deleted in the kernel.

To work around this, use nl_cache_resync_v2() to trigger a resync of all routes when a link goes down.

Motivation and Context

A customer reported routes still present in flow tables with EIGRP despite missing from kernel.

How Has This Been Tested?

Pipeline run with changes applied (87710 on cel-questone-2a).

@KanjiMonster KanjiMonster marked this pull request as ready for review March 19, 2025 13:26
@KanjiMonster KanjiMonster requested a review from ideaship March 20, 2025 08:23
Work around missing route removal notifications from kernel on link down
with routes targeting nexthops on that link by forcing a cache resync on
link down events to catch removed routes.

When a link goes down, the kernel will delete all nexthops on that link
without sending out netlink notifications.

When a nexthop gets deleted, the kernel will delete all routes with the
nexthop as destination without sending out netlink notifications.

These two combined means that when using nexthop objects, like FRR does
by default, deletion of routes on link loss are never seen by libnl, and
consequently never seen by baseboxd.

This causes flow table entries for routes to persist even though they
were deleted in the kernel.

To work around this, use nl_cache_resync_v2() to trigger a resync of all
routes when a link goes down.

Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
@KanjiMonster KanjiMonster force-pushed the jogo_sync_route_on_linkdown branch from 3acc49c to 9a58b5d Compare March 20, 2025 16:01
@KanjiMonster KanjiMonster requested review from jklare and removed request for ideaship March 24, 2025 09:17
@jklare jklare merged commit 1003556 into main Mar 24, 2025
5 checks passed
@jklare jklare deleted the jogo_sync_route_on_linkdown branch March 24, 2025 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0