Repository navigation
Description
Part of #14.
Netlink has only the family NETLINK_ROUTE. Other protocols give EPROTONOSUPPORT (net/rk-net/src/netlink/mod.rs). rtnetlink has the links (new, get, set and delete, with the kinds veth and dummy), the IPv4 and IPv6 addresses and routes, the neighbours, the netconf get, the namespace IDs, and the multicast groups for links, addresses, routes, neighbours and namespace IDs. SIOCETHTOOL exists as an ioctl. There are no rules, no nexthop objects, no generic netlink and no ethtool netlink family. LTP net now: 117 pass of 356 (tools/ltp/net.md).
Scope
- Routing rules:
RTM_NEWRULE,RTM_DELRULEandRTM_GETRULEfor IPv4 and IPv6, the three default rules, and a rule lookup before the route lookup. Test: a new part of thenetcfgboot test withip rule addandip route getfor a policy route. Exit: theip ruleoutput is the same as on the reference, and the policy route works. net: routing rules for IPv4 and IPv6, and the extended ack #550: the rules, the rule lookup and the extended ack;netcfgpasses. - Nexthop objects:
RTM_NEWNEXTHOP,RTM_DELNEXTHOPandRTM_GETNEXTHOP, and routes that use a nexthop ID. networkd probes for them at start. Test:netcfgwithip nexthop addand a route withnhid. Exit: the output is the same as on the reference. net: nexthop objects and routes with nhid #554: nexthop objects and RTA_NH_ID routes; a group route uses its first member;netcfgpasses. - Generic netlink: the protocol
NETLINK_GENERICand thenlctrlfamily, withCTRL_CMD_GETFAMILYfor one family and for a dump, and the multicast groups of each family. Test:netcfgwithgenl ctrl list. Exit: the message layout is the same as on the reference for the families that rukernel has. net: generic netlink and nlctrl #559: NETLINK_GENERIC and nlctrl with GETFAMILY by name, by ID and as a dump; no GETPOLICY yet. - The ethtool netlink family:
ETHTOOL_MSG_LINKINFO_GET,LINKMODES_GETandSET,FEATURES_GETandSET,CHANNELS_GET,RINGS_GETandWOL_GET. Also theSIOCETHTOOLcommands that udevd uses for.linkfiles:ETHTOOL_GDRVINFO,ETHTOOL_GLINKSETTINGSandETHTOOL_GPERMADDR. Test:netcfgwithethtool eth0,ethtool -i eth0andethtool -k eth0. Exit: the output is the same as on the reference for virtio-net. net: ethtool netlink family and SIOCETHTOOL #564: ethtool netlink family and SIOCETHTOOL; 29 inet checks pass on both architectures. - Link properties:
RTM_NEWLINKPROPandRTM_DELLINKPROPfor alternative names, a rename of a link withIFLA_IFNAME, and theRTM_NEWLINKnotices for a rename. udevd uses these to name devices. Test:netcfgwithip link property add dev eth0 altnameandip link set eth0 name. Exit: the notices onip monitor linkare the same as on the reference. net: alternative names of links and live renames #570: altnames with RTM_NEWLINKPROP and RTM_DELLINKPROP, renames while up, with notices; 27 inet checks pass on both architectures. - A
networkdboot test: the Debian 13 image of thesystemdboot test (see R5 systemd as PID 1: cgroup v2 controllers, namespaces and pidfds #536) with systemd-networkd and systemd-resolved. It gets an IPv4 address with DHCP from the QEMU user network, sets a static IPv6 address, and resolves a name withresolvectl query. Exit:networkctl status eth0givesroutable, and the query gives an address. Then run systemd test/test-network/systemd-networkd-tests.py and the TEST-75-RESOLVED integration test, and write a report. Exit: they reach the pass set of the reference, apart from the listed exceptions. Add the networkd boot test, with the socket options of systemd-networkd and systemd-resolved #668 (first part): thenetworkdboot test passes on x86_64 and arm64; systemd-networkd-tests.py and TEST-75 remain. tmpfs: a size in percent of the memory, as Linux #724: tmpfssize=N%, sodaemon-reloadworks and the tests run. net: set the hardware address with IFLA_ADDRESS and SIOCSIFHWADDR #733:IFLA_ADDRESSandSIOCSIFHWADDRset the hardware address, so theMACAddress=tests pass. sysfs: queues/rx-0/rps_cpus of a network interface, as Linux (#538) #738: sysfsrps_cpus, sotest_rps_cpupasses. unix: a message before the accept gets the credentials of the sender #743: unix credentials before the accept, soudevadm control --reloadworks. - udevd names the network devices. With the uevents of R5 uevents, the keyring, fanotify and inotify #539 and the PCI tree in
/sysof R5 the remaining /sys and /proc files that the images read #543, udevd renameseth0to its predictable name, as on the reference (for exampleenp0s2on x86_64). Test: theudevdboot test. Exit: the name is the same as on the reference on both architectures. Add name_assign_type of a network interface, check its udev name #654: name_assign_type in sysfs; udevd gives enp0s3 on x86_64, and enp0s1 (PCI) and eth0 (MMIO) on arm64, as on Linux. - Multipath routes:
RTA_MULTIPATHinRTM_NEWROUTE,RTM_DELROUTEand the route dump for IPv4 and IPv6, with a weight for each path, IPv6 ECMP siblings, and a check of the device and gateway of each path. networkd sendsMultiPathRoute=withRTA_MULTIPATH, also for one IPv6 path with a weight. Test:NetworkdNetworkTests.test_route_staticof the networkd test suite, andip route add ... nexthop via ... weight ...in thenetcfgboot test. net: multipath routes, RTA_MULTIPATH for IPv4 and IPv6 (#538) #826:test_route_staticpasses on x86_64 and arm64, andip route showgives the paths, weights and order of Linux 6.8. BusyBoxipofnetcfgcannot sendRTA_MULTIPATH, so the unit tests and the networkd tests are the tests.
Done when
networkd configures the network and udevd names the devices. This is the exit of the third item of #14.
Test each task on x86_64 and on arm64. Give the result of both in the PR body.
Linux reference: net/core/rtnetlink.c, net/core/fib_rules.c, net/ipv4/nexthop.c, net/netlink/genetlink.c, net/ethtool/netlink.c, net/ethtool/ioctl.c.
Activity
tamnd commentedon Nov 2, 2026
#550 is merged. It adds the routing rules of IPv4 and IPv6 with
RTM_NEWRULE,RTM_DELRULEandRTM_GETRULE, the default rules of Linux, the rule lookup before the route lookup, and the extended ack. x86_64:netandnetcfgpass (load average 10 to 17). arm64:initandinetpass (load average 6 to 11). x86_64initandinettime out at a load average near 20, andineton main also times out at that load. Limits: nosuppress_ifgroup, l3mdev ortun_idmatches.tamnd commentedon Nov 3, 2026
Nexthop objects are done in #554. RTM_NEWNEXTHOP, RTM_DELNEXTHOP and RTM_GETNEXTHOP work for single nexthops and groups, and IPv4 and IPv6 routes can use RTA_NH_ID. A route that uses a group sends on the first member of the group. The netcfg boot test passes on x86_64, and the init and inet boot tests pass on arm64.
tamnd commentedon Nov 3, 2026
Item 3 (generic netlink) is done in #559. A
NETLINK_GENERICsocket works, andnlctrlanswersCTRL_CMD_GETFAMILYby name, by ID and as a dump, with the same checks and errors as Linux. The 12 new checks of theinetboot test pass on arm64. On x86_64 theinettest did not reach the network part because of the load on server2 (load average 22 to 25).CTRL_CMD_GETPOLICYand theNEWFAMILYandDELFAMILYevents are not there yet.tamnd commentedon Nov 3, 2026
Item 4 (ethtool netlink) is done in #564. The family
ethtoolhasSTRSET_GET,LINKINFO_GETandSET,LINKMODES_GETandSET,LINKSTATE_GET,DEBUG_GETandSET,WOL_GETandSET,FEATURES_GETandSET,RINGS_GETandCHANNELS_GET, with the compact and verbose bitsets, the dumps, the extended ack and the notices of the groupmonitor.SIOCETHTOOLhasETHTOOL_GDRVINFO,ETHTOOL_GLINK,ETHTOOL_GPERMADDRandETHTOOL_GLINKSETTINGS. The 29 new checks of theinetboot test pass on arm64 (MMIO, virtio-pci, and virtio-pci behind a bridge) and on x86_64 (with a longer local timeout, load average 26 to 35). The images have noethtooltool, so the checks are C code in tests/user/init.c.RINGS_SET,CHANNELS_SET, statistics and the other commands of the family are not there yet.tamnd commentedon Nov 4, 2026
Item 5 (link properties) is done in #570.
RTM_NEWLINKPROPandRTM_DELLINKPROPadd and remove the alternative names of a link, with the checks and the extended ack of net/core/rtnetlink.c. A lookup by name also finds an alternative name, andRTM_GETLINKgives them inIFLA_PROP_LIST. A link that is up can now change its name, a name with%dtakes the first free unit, and the rename sendsRTM_NEWLINKtoRTMGRP_LINKand the ueventmoveof #562. The 27 new checks of theinetboot test pass on x86_64 and arm64. The images have noiptool, so the checks are C code in tests/user/init.c. Items 6 (networkd) and 7 (udevd) remain. They need thenetworkdandudevdboot tests.tamnd commentedon Nov 7, 2026
#654 merged. It adds
name_assign_typeof a network interface in sysfs, as on Linux: 2 for lo, 1 foreth%d, 3 for a name from the user, and 4 after a rename. Theudevdboot test now checks that each interface with a name fromnet_idhas that name andname_assign_type4.Results, with the same QEMU command for rukernel and for Linux:
enp0s3: name_assign_type 4, net_id name enp0s3on both, and the test passes.enp0s1: name_assign_type 4, net_id name enp0s1andeth0: name_assign_type 1, net_id name noneon both, and the check passes. The virtio-mmio interface has no name fromnet_id, so it keeps eth0, also on Linux.The item is done. What remains in this issue is the
networkditem. systemd-resolved still stops withENOPROTOOPT(socket options on TCP andIP_UNICAST_IF), so these runs masked it. The next change fixes this.tamnd commentedon Nov 8, 2026
#668 merged. It adds the
networkdboot test. systemd-networkd gets 10.0.2.15 with DHCP from the user network of QEMU and sets the static address fec0::10. systemd-resolved runs,networkctlgivesroutable, andresolvectl query debian.orggives 151.101.2.132.The fixes in rukernel:
IP_UNICAST_IF, the receive options of IPv4 and IPv6 on TCP sockets,IP_FREEBIND,IP_MTU_DISCOVERandTCP_FASTOPEN.IP_FREEBINDwith a bind to an address that is not local, andPACKET_AUXDATAon packet sockets.NETLINK_PKTINFOcontrol message. Without it, sd-netlink dropped each notification of the kernel, and systemd-networkd stayed inconfiguring.Results:
enp0s3: routableand pass. Linux with the same image and QEMU command: the same.eth0: routableand pass.udevdboot test passes on x86_64 without a mask for systemd-resolved.The item stays open. What remains: test/test-network/systemd-networkd-tests.py and the TEST-75-RESOLVED integration test did not run, and there is no report yet. systemd-networkd cannot write the net sysctls
accept_raandpromote_secondaries(EPERM). It ignores the error, but this is a difference from Linux, in the /proc area of #543.tmpfs: a size in percent of the memory, as Linux (#724)
tamnd commentedon Nov 13, 2026
#724 fixes the tmpfs option
size=N%: the limit is now N percent of the memory, as Linux. Before, a size in percent had no limit,statfsgave 0 free blocks on /run, and systemd refuseddaemon-reload, which systemd-networkd-tests.py calls for each test. With the fix the tests run on x86_64 and arm64. The item stays open: the runs found more kernel causes (the hardware address of a new link, rps_cpus in sysfs), and the report is not done.net: set the hardware address with IFLA_ADDRESS and SIOCSIFHWADDR (#538…
tamnd commentedon Nov 14, 2026
#733 merged:
RTM_NEWLINKandRTM_SETLINKwithIFLA_ADDRESS, andSIOCSIFHWADDR, set the hardware address of a device, asdev_set_mac_addressof Linux. networkd needs this forMACAddress=in .netdev and .link files. Next: the other fixes for systemd-networkd-tests.py, one PR each.41 remaining items
tamnd commentedon Nov 17, 2026
#796 merged: a UDP, raw or ping socket of IPv6 sends through the interface of
IPV6_MULTICAST_IForIPV6_UNICAST_IF, asudpv6_sendmsgof Linux. Before, the router advertisements of dnsmasq onveth-peerwent out onveth99whenveth99went up last,veth-peerlearned a wrong link address forveth99, and the DHCPv6 replies did not get toveth99(#538).net: IP_PKTOPTIONS and IPV6_2292PKTOPTIONS on a TCP socket, as Linux (#…
tamnd commentedon Nov 20, 2026
#806 merged:
getsockoptofIP_PKTOPTIONSandIPV6_2292PKTOPTIONSon a TCP socket gives the interface and the TTL of the SYN, as Linux. Before, systemd-resolved closed each TCP connection to its stub resolver at 127.0.0.53, sodig +tcpanddig AXFRgot "connection reset" and TEST-75-RESOLVED stopped at testcase_08_resolved (#538).tamnd commentedon Nov 20, 2026
TEST-75-RESOLVED
testcase_11_nftfails on rukernel (x86_64, main with #806). Two runs on server1 gave the same result: pk1, and the rerun pk2 at load average 2.What the test does, and what it gets:
The set
cstays empty, so the test stops at this first check. It does not get to the setsuandg. Testcases 01 to 10 pass.Facts from the code (not yet confirmed with a log of PID 1, because the run keeps only the journal of networkd, udevd and resolved):
NFTSet=cgroup:. The element is the 64-bit cgroup ID of the unit. systemd gets the ID withname_to_handle_aton the cgroup directory in cgroupfs (cg_path_get_cgroupid).file_handle. Soname_to_handle_aton cgroupfs givesEOPNOTSUPP(core/rk-syscall/src/fhandle.rs). Linux gives aFILEID_KERNFShandle with the kernfs ID.nft list setshows acgroupsv2element as a path. To find the path from the ID, nft also usesname_to_handle_aton cgroupfs. So the check needs these handles too.addr4,network4,addr6,network6andifindexsets ofsd_test("Added NFT set entry"). So the add of a set element in nf_tables works.Next step: run the test again with the journal of PID 1, or run
name_to_handle_aton /sys/fs/cgroup/system.slice in the VM.net: IFLA_INET6_ADDR_GEN_MODE in RTM_SETLINK and IN6_ADDR_GEN_MODE_NO…
tamnd commentedon Nov 20, 2026
#808 merged:
RTM_SETLINKtakesIFLA_INET6_ADDR_GEN_MODEinIFLA_AF_SPEC, each link has itsAF_INET6attributes inIFLA_AF_SPEC, and a device withIN6_ADDR_GEN_MODE_NONEgets no link local address, as Linux. Before, systemd-networkd could not stop or start the link local address of a link (#538).Run agm1 on server1 (x86_64, load average 0.8 at the start, kernel of main f68a676 with #808 and the IPv6 gateway change of the next PR):
NetworkdNetworkTests.test_link_local_addressing_ipv6llpasses.test_link_local_addressingnow stops at/proc/sys/net/ipv6/conf/test1/stable_secret, which rukernel does not have. NetworkdNetworkTests has 3 failures and 8 errors (before: 4 and 8). NetworkctlTests and NetworkdMTUTests pass.net: an IPv6 gateway on the link of a tentative address is good for a…
tamnd commentedon Nov 20, 2026
#809 merged: the IPv6 gateway of a new nexthop or route is on the link while each address of the interface is tentative, as
ip6_route_check_nhof Linux. Before, systemd-networkd got "No route to host" for the nexthopid 2 via 2001:1234:5:8f63::2 dev veth99in test_nexthop and failed the link (#538).Run agm1 on server1 (x86_64, load average 0.8 at the start, kernel of main f68a676 with #808 and #809): the log has no "No route to host" and no "Failed to set static nexthop" (before: 2 of each).
test_nexthopstill gives an error at the next step: the route10.10.10.11/32through nexthop 2 gives "IPv4 routes through IPv6 gateways are not supported" (RTA_VIA), as intest_route_via_ipv6. RTA_VIA is not done yet.tools/systemd: the network tests of systemd on rukernel and on Linux,…
tamnd commentedon Nov 20, 2026
#810: tools/systemd/networkd.md and nettest.py tell how to run systemd-networkd-tests.py and TEST-75-RESOLVED on rukernel and on Linux under QEMU, and give the results of each test class on x86_64, the kernel fixes, and the causes of the tests that do not pass yet (#538).
net: an IPv4 route through an IPv6 gateway, RTA_VIA (#538) (#816)
cgroup: file handles of cgroup2, as kernfs, with the path in the moun…
tamnd commentedon Nov 21, 2026
A check of #817 (file handles of cgroup2) on main 4d97cdc, x86_64 release kernel:
--t75on server1, alone under the VM lock:testokandexit 0, in 520 s of wall time (load 2.1 at the start, 5.2 at the end). The run with the kernel of the cgroup: file handles of cgroup2, as kernfs, with the path in the mount of mount_fd #817 branch took 492 s. As in that run, the runner givesexit 1after the test, when the VM stops.RK_RELEASE=1 cargo xtask boot-test systemdon server2:boot test systemd: pass, in about 8.5 min of wall time (load 6 to 8).So #817 works on main, and no change is necessary.
net: multipath routes, RTA_MULTIPATH for IPv4 and IPv6 (#538) (#826)
tamnd commentedon Nov 23, 2026
#826 merged: multipath routes (
RTA_MULTIPATH) for IPv4 and IPv6, as Linux. Each path has a weight, IPv6 multipath routes are siblings, and the kernel checks the device and the gateway of each path. Before, networkd failed dummy98 intest_route_staticwith "Could not set static route: No such device".test_route_staticpasses. No other test of the class changed.ip route showgives the same paths, weights and order as Linux 6.8.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 (bond devices), the same as on x86_64.NetworkdDHCPPDTests.test_dhcp4_6rdgave an error once on Linux.BusyBox
ipcannot sendRTA_MULTIPATH, so thenetcfgboot test has no multipath route. Thenetworkdboot test item stays open: the rest of systemd-networkd-tests.py and TEST-75 remain.