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: v256.17~54 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=018e874b84c53ef5b8c2f4835a2f9e554c5fe409;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. (cherry picked from commit 7dde00ca57cf20a5d71e580d0bc6173f454095e5) (cherry picked from commit e9655c7865d632bd05437f8ebd4264a13b8011e4) --- diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index 85bce825604..47145a83447 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -2191,6 +2191,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);