#1143221 networkd-dispatcher: Race condition with udev on eth0

#1143221#5
Date:
2026-07-30 15:16:38 UTC
From:
To:
Dear Maintainer,

* What led up to the situation?
On Debian Trixie during boot, systemd/udev renames network interfaces from
kernel default names (e.g., 'eth0') to predictable names (e.g., 'enp3s0').
During this transitional window, networkd-dispatcher calls 'networkctl list',
records 'eth0', and stores it in its internal tracking state
(`iface_names_by_idx`).

* What exactly did you do (or not do) that was effective (or ineffective)?
Ineffective: Adding retry logic to 'networkctl' execution did not fix the
issue, because 'eth0' was permanently renamed, leaving a stale reference in
networkd-dispatcher's state.

Effective: Patched `_interface_scan()` in networkd-dispatcher to ignore
temporary kernel names like "eth0" (e.g., `if i.name == "eth0": continue`).

* What was the outcome of this action?
Before the patch, networkd-dispatcher repeatedly failed every time it ran
'networkctl status' against the stale 'eth0' interface, flooding logs with
error:
"networkd-dispatcher: ERROR:Failed to get interface "eth0" status: Command
'['/usr/bin/networkctl', 'status', ..., 'eth0']' returned non-zero exit status
1."

After filtering out 'eth0', networkd-dispatcher correctly registered the
renamed interface on subsequent scans without throwing status errors.

* What outcome did you expect instead?
networkd-dispatcher should handle transient kernel interface names during early
boot without getting stuck attempting to query status for interfaces that have
been renamed by udev.