From: Yu Watanabe Date: Tue, 27 May 2025 17:09:52 +0000 (+0900) Subject: network/link: update state file when master ifindex is changed X-Git-Tag: v258-rc1~465^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7dde00ca57cf20a5d71e580d0bc6173f454095e5;p=thirdparty%2Fsystemd.git network/link: update state file when master ifindex is changed If master ifindex is non-zero, then the carrier state and operational state of the interface may be the enslaved state. As the operational state is saved in link state file, and read by wait-online, we need to update the state file when the master ifindex is changed. --- diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index ccaaba25d33..65fd8b43e3b 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -2223,6 +2223,9 @@ static int link_update_master(Link *link, sd_netlink_message *message) { link_drop_from_master(link); link->master_ifindex = master_ifindex; + + /* Updating master ifindex may cause operational state change, e.g. carrier <-> enslaved */ + link_dirty(link); } r = link_append_to_master(link);