Skip to content

Commit 2057199

Browse files
yuwatabluca
authored andcommitted
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) (cherry picked from commit 018e874b84c53ef5b8c2f4835a2f9e554c5fe409)
1 parent a023d22 commit 2057199

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/network/networkd-link.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1995,6 +1995,9 @@ static int link_update_master(Link *link, sd_netlink_message *message) {
19951995

19961996
link_drop_from_master(link);
19971997
link->master_ifindex = master_ifindex;
1998+
1999+
/* Updating master ifindex may cause operational state change, e.g. carrier <-> enslaved */
2000+
link_dirty(link);
19982001
}
19992002

20002003
r = link_append_to_master(link);

0 commit comments

Comments
 (0)