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. - 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.
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.