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)
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);