[PATCH v2 0/7] spectrum-router

Yureka Lilian
2025-11-28T22:31:04Z

Changes since v1 (non-exhaustive):

- Use spectrum-router from pkgsMusl
- Refactor router into smaller modules
- Parse router advertisements from upstream interfaces
- Select active upstream interface based on router advertisements
- Assign guest mac addresses based hash of vm id
- Fix race condition when assigning driver-router interface
- Temporarily disable re-write of mac addresses which would be needed
for wifi. It will be added back inside the xdp-forwarder in a future patch.

and completely new patches:
- Change nameserver & default route in app-vm template
- Fix integration tests
- Leave dbus in net-vm and add iwd for testing

Yureka Lilian (7):
vm/sys/net: remove connman
vm/sys/net: integrate xdp-forwarder
vm/sys/net: add iwd
tools: add spectrum-router
host: integrate router
img/app: change to ipv6 nameserver
checks/integration: Adapt networking test for ipv6

host/rootfs/default.nix | 4 +-
host/rootfs/file-list.mk | 3 +
.../data/service/spectrum-router/down | 0
.../template/data/service/spectrum-router/run | 13 +
.../image/usr/bin/assign-driver-router-iface | 11 +
host/rootfs/image/usr/bin/run-vmm | 12 +-
host/rootfs/image/usr/bin/vm-import | 13 -
img/app/image/etc/mdev/iface | 17 -
img/app/image/etc/resolv.conf | 2 +-
pkgs/default.nix | 2 +
pkgs/overlay.nix | 1 +
release/checks/integration/default.nix | 2 +-
release/checks/integration/networking.c | 32 +-
tools/router/Cargo.lock | 807 ++++++++++++++++++
tools/router/Cargo.lock.license | 2 +
tools/router/Cargo.toml | 21 +
tools/router/default.nix | 18 +
tools/router/src/main.rs | 73 ++
tools/router/src/packet.rs | 187 ++++
tools/router/src/protocol.rs | 65 ++
tools/router/src/router.rs | 133 +++
tools/router/src/upstream.rs | 170 ++++
tools/start-vmm/ch.rs | 38 +-
tools/start-vmm/lib.rs | 76 +-
tools/start-vmm/meson.build | 2 +-
tools/start-vmm/net-util.c | 39 -
tools/start-vmm/net-util.h | 6 -
tools/start-vmm/net.c | 55 --
tools/start-vmm/net.rs | 11 -
tools/start-vmm/tests/meson.build | 5 -
.../start-vmm/tests/tap_open-name-too-long.c | 20 -
tools/start-vmm/tests/tap_open.c | 28 -
vm/sys/net/Makefile | 2 +-
vm/sys/net/default.nix | 15 +-
vm/sys/net/file-list.mk | 3 -
vm/sys/net/image/etc/fstab | 2 +
vm/sys/net/image/etc/mdev/iface | 28 +-
vm/sys/net/image/etc/nftables.conf | 16 +-
vm/sys/net/image/etc/s6-rc/connman/run | 19 -
vm/sys/net/image/etc/s6-rc/connman/type | 1 -
.../net/image/etc/s6-rc/connman/type.license | 2 -
41 files changed, 1627 insertions(+), 329 deletions(-)
rename vm/sys/net/image/etc/s6-rc/connman/dependencies.d/dbus => host/rootfs/image/etc/s6-linux-init/run-image/service/vm-services/template/data/service/spectrum-router/down (100%)
create mode 100755 host/rootfs/image/etc/s6-linux-init/run-image/service/vm-services/template/data/service/spectrum-router/run
create mode 100755 host/rootfs/image/usr/bin/assign-driver-router-iface
create mode 100644 tools/router/Cargo.lock
create mode 100644 tools/router/Cargo.lock.license
create mode 100644 tools/router/Cargo.toml
create mode 100644 tools/router/default.nix
create mode 100644 tools/router/src/main.rs
create mode 100644 tools/router/src/packet.rs
create mode 100644 tools/router/src/protocol.rs
create mode 100644 tools/router/src/router.rs
create mode 100644 tools/router/src/upstream.rs
delete mode 100644 tools/start-vmm/net-util.c
delete mode 100644 tools/start-vmm/net-util.h
delete mode 100644 tools/start-vmm/net.c
delete mode 100644 tools/start-vmm/tests/tap_open-name-too-long.c
delete mode 100644 tools/start-vmm/tests/tap_open.c
delete mode 100644 vm/sys/net/image/etc/s6-rc/connman/run
delete mode 100644 vm/sys/net/image/etc/s6-rc/connman/type
delete mode 100644 vm/sys/net/image/etc/s6-rc/connman/type.license

--
2.51.2