Repository navigation
vrf: move multipath IPv6 default nexthops into VRF table - #1275
mlguerrero12 merged 3 commits into
Conversation
|
FYI, sbr has the same issue (details in #1253 (comment)). If this approach is accepted, sbr could follow the same fix. |
|
yeah, sbr hits the same miss. RouteList(link) skips the LinkIndex 0 multipath routes, so they never land in its table. I'll keep this PR to vrf. If this approach sticks I can follow up on sbr separately. |
07fddc1 to
040a108
Compare
mlguerrero12
left a comment
There was a problem hiding this comment.
Looks good overall! Left one inline comment
|
|
||
| r := route | ||
| if len(nhs) == 1 { | ||
| // Prefer a simple single-nexthop form; this is what IPAM originally |
There was a problem hiding this comment.
Please preserve nexthop flags when converting existing multipath routes and add a regression test for this case.
There was a problem hiding this comment.
yeah, collapsing that to one hop dropped onlink. the nexthop flags are copied onto the route now, and there is a regression for this case.
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>
A single remaining nexthop was copied as Gw and LinkIndex only, so onlink never made it onto the route installed in the VRF table. Signed-off-by: Dean Chen <862469039@qq.com>
e903507 to
2fceb2e
Compare
mlguerrero12
left a comment
There was a problem hiding this comment.
LGTM. Thanks for the fix!
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