Files
RedBear-OS/netstack
Red Bear OS 9d8ad861ce netstack: centralize 'eth0' in DEFAULT_IFACE constant (21 sites)
The netcfg scheme's 'ifaces' subtree had 21 hardcoded 'eth0'
literals — one in the routing tree path and 20 in device
lookups. This made any non-eth0 interface (wlan0, enp3s0, etc.)
invisible to netcfg's ifaces config path.

The 'ifaces' routing tree is statically routed (compile-time key
in the dispatch! macro), so a full schema refactor to runtime-keyed
map is out of scope for this minimal change. Instead, this commit:

1. Introduces DEFAULT_IFACE: &str = 'eth0' const at the top of
   src/scheme/netcfg/mod.rs (with a docstring explaining the
   architectural choice and the follow-up path).

2. Replaces all 21 hardcoded 'eth0' literals with the DEFAULT_IFACE
   constant. The routing tree path uses DEFAULT_IFACE in the
   dispatch! macro expansion; the device lookups use DEFAULT_IFACE
   in devices.borrow().get(DEFAULT_IFACE).

This is a pure refactor — no behavior change for the default
'eth0' case. Future work: convert the routing tree to runtime-keyed
so a system with wlan0 as primary can serve the ifaces subtree at
/ifaces/wlan0/...

Found by the Round 12 audit (local/docs/3D-DESKTOP-COMPREHENSIVE-PLAN.md §10).
2026-07-27 22:55:12 +09:00
..