mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-25 01:20:07 +01:00
device: schedule an idle commit when setting device's sys-iface-state
When assuming a device, the NMActiveConnection switches the sys-iface-state from "assume" to "managed" when the device reaches the activated state. <debug> [1679353062.8884] active-connection[000055bd310b92e0]: set state activated (was activating) <debug> [1679353062.8885] active-connection[000055bd310b92e0]: update activation type from assume to managed Note that the "assume" state is probably a misfeature, and should be dropped in favor of more appropriate flags. Meaning, "assume" state for the most part is very similar to sys-iface-state "managed", and the cases where (during activation) we need to be graceful, may be better covered with other (more specialized) state flags. Regardless, for most practical purposes, sys-iface-state "assume" should be treated similar to "managed" state. When we fully activated, we should be sure to do yet another idle commit. Note that scheduling an idle-commit is something that must always be allowed to any users of NML3Cfg. The users have no knowledge about each other and coordinate by registering their commit type handles. Issuing an idle "auto" commit must be therefore allowed to them at any time. If that were not the case, then there would be a bug to fix. The only reason to maybe not do it, is when we are sure there is nothing to commit and we would want to avoid unnecessary work. You can easily reproduce this and see that we don't in fact schedule a commit after becoming managed. A commit usually only happens later, for example when we receive an autoconf6 update. This affects for example setting the MTU. Currently, _commit_mtu() bails out for nm_device_sys_iface_state_is_external_or_assume() and thus during activation the MTU will not be set. Later, once we reach activated state, due to this it still is not set right away. This patch fixes that, although we should also change _commit_mtu() to not bail out for sys-iface-state "assume".
This commit is contained in:
parent
1395cc09bd
commit
e773559d9d
1 changed files with 1 additions and 0 deletions
|
|
@ -3043,6 +3043,7 @@ nm_device_sys_iface_state_set(NMDevice *self, NMDeviceSysIfaceState sys_iface_st
|
|||
nm_device_sys_iface_state_to_string(sys_iface_state));
|
||||
priv->sys_iface_state_ = sys_iface_state;
|
||||
_dev_l3_cfg_commit_type_reset(self);
|
||||
nm_device_l3cfg_commit(self, NM_L3_CFG_COMMIT_TYPE_AUTO, FALSE);
|
||||
}
|
||||
|
||||
/* this function only sets a flag, no immediate actions are initiated.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue