Repository navigation
Conversation
An IPv4 route takes the paths of RTA_MULTIPATH with the checks of fib_get_nhs and fib_check_nh, and a weight for each path. The dump shows them, and RTM_DELROUTE matches them as fib_nh_match. A device that goes down marks its paths dead. An IPv6 route with RTA_MULTIPATH makes a route for each path, and these routes are siblings, as ip6_route_multipath_add. The dump and the notifications show the siblings in one RTA_MULTIPATH. An IPv6 path whose device goes down stays, dead, while another path is alive, as fib6_ifdown. A flow takes a path by a hash and the weights.
This was referenced Nov 23, 2026
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.
Multipath routes, as Linux, for #538. systemd-networkd sends
MultiPathRoute=asRTM_NEWROUTEwithRTA_MULTIPATH, also for IPv4 routes with IPv6 gateways (RTA_VIAin eachrtnexthop). Before, the kernel did not useRTA_MULTIPATH, so the route had no device, and networkd failed dummy98 inNetworkdNetworkTests.test_route_staticwith "Could not set static route: No such device".The change, as Linux:
RTM_NEWROUTEwithRTA_MULTIPATHmakes one route with a path for eachrtnexthop, with the checks offib_count_nexthops,fib_get_nhsandfib_check_nhfor the device and the gateway of each path. The weight isrtnh_hopsand one. A request with one path makes a route with one path.RTM_GETROUTEgiveRTA_MULTIPATHwith the weights.RTM_DELROUTEwith paths matches them in order, asfib_nh_match.dead linkdown. The route goes away when all of its paths are dead.RTA_MULTIPATHmakes a route for each path, and these routes are siblings, asip6_route_multipath_add. The dump and the notifications show the siblings in oneRTA_MULTIPATHwith their weights. A delete without a gateway removes the siblings too. An IPv6 path whose device goes down stays, markeddead linkdown, while another path is alive, asfib6_ifdown.BusyBox
ipof the boot tests cannot sendRTA_MULTIPATH, so thenetcfgboot test cannot add a multipath route. The tests of this change are the unit tests and systemd-networkd-tests.py, where networkd sendsRTA_MULTIPATHand iproute2 shows the result.Tests:
multipath_has_the_checks_of_linux,a_multipath_route,ipv6_multipath_routes_are_siblings. clippy of rk-net-inet gives no new warning. rustfmt is clean.test_route_staticnow passes, for bothmanage_foreign_routes=TrueandFalse. Before, with the kernel of net: an IPv4 route through an IPv6 gateway, RTA_VIA (#538) #816 (run via1), 31 of 42 passed. No other test of the class changed. The journal has no "Could not set static route" (12 before).ip route show 192.168.10.1,ip route show 192.168.10.2andip -6 route show 2001:1234:5:bfff:ff:ff:ff:ffgive the same paths, weights and order as Linux 6.8 in the same VM, for example:test_ip_route_ipv6_src_routeneeds a bond device and has no multipath route: networkd says "bond199: Failed to create netdev: Operation not supported", and its journal has no route error.test_route_static,test_route_via_ipv6,test_nexthopandtest_route_static_issue_35047pass.test_ip_route_ipv6_src_routegives an error because bond199 does not come up, the same cause as on x86_64. The journal has no "Could not set static route", andip route showgives the same paths and weights as on x86_64.NetworkdDHCPPDTests.test_dhcp4_6rdgave an error once on Linux. It passed in the earlier Linux run of the table in networkd.md.The full gate did not run.