vrf: move multipath IPv6 default nexthops into VRF table - #1275
Open
locker95 wants to merge 2 commits into
Open
Conversation
When a secondary interface gets an IPv6 default route while the primary already has ::/0, the kernel merges them into an ECMP multipath route with LinkIndex 0. The VRF plugin previously filtered routes with RT_FILTER_OIF only, which never matches multipath routes, so the net1 nexthop was dropped and never reinstalled into the VRF table. List universe-scope routes without the OIF filter, extract nexthops that belong to the interface being enslaved (including multipath), and reinstall those into the VRF table as before. Fixes containernetworking#1253 Signed-off-by: Dean Chen <862469039@qq.com>
Sequential RouteAdd of two ::/0 with the same metric returns EEXIST on some kernels instead of merging, which broke CI on Linux amd64. Signed-off-by: Dean Chen <862469039@qq.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When IPAM installs an IPv6 default route (
::/0) on a secondary interface while the primary interface already has one, the kernel merges them into a multipath/ECMP route. Those routes haveLinkIndex == 0and put the per-interface nexthops inMultiPath.The VRF plugin was filtering with
RT_FILTER_OIF, which only matchesroute.LinkIndex. Multipath defaults never matched, so the secondary nexthop was never saved and never reinstalled into the VRF table after enslavement.This change:
IPv4 was not reported as affected, but multipath handling is family-agnostic for correctness.
Test plan
routeForInterface/routesForInterfacecovering single-hop, ECMP extract, multi-nexthop-on-same-if, and mixed lists::/0lands in the VRF table aftercmdAddgo test ./plugins/meta/vrf/(needs root/netns; not runnable on the macOS workspace used to develop this)Fixes #1253