mirror of
https://github.com/systemd/systemd.git
synced 2026-11-06 05:17:24 +00:00
When networkd starts or restarts, links are enumerated in ifindex order. A slave enumerated before its master cannot register itself in link_append_to_master(), as the master Link object does not exist yet. The master then wrongly believes it has no slaves until the next RTM_NEWLINK message for the slave arrives. The stale slaves set affects operational state propagation (degraded-carrier detection) and any code that inspects the slaves of a master. For instance, on restart, when networkd thinks that the master has no slaves yet, we try to set the bond fail-over policy, which the kernel then refuses because in reality the bond does have slaves. To fix the issue, this updates the list of slaves after enumeration. Co-authored-by: Yu Watanabe <watanabe.yu+github@gmail.com>