sandlock
sandlock copied to clipboard
netlink: non-dump RTM_GETLINK/RTM_GETADDR is unsupported (ip link show lo fails)
Only the dump forms are synthesized (netlink/synth.rs); a lookup by name or index gets EOPNOTSUPP:
sandlock run -r /usr -r /proc -- ip link show lo -> Device "lo" does not exist.
sandlock run -r /usr -r /proc -- ip addr show dev lo -> Device "lo" does not exist.
ip -br link / ip -br addr -> work (dumps)
iproute2 resolves the name with a non-dump RTM_GETLINK carrying IFLA_IFNAME.
Proposed fix: answer non-dump RTM_GETLINK with the lo message when the request names lo or index 1, and ENODEV otherwise. parse_request needs to keep the ifinfomsg index and the IFLA_IFNAME attribute.