diff options
-rw-r--r-- | src/devices/nm-device.c | 9 | ||||
-rw-r--r-- | src/devices/nm-device.h | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index e995bcac0d..9d70bb54f5 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -15541,6 +15541,12 @@ _set_state_full (NMDevice *self, reason_to_string_a (reason), _sys_iface_state_to_str (priv->sys_iface_state)); + /* in order to prevent triggering any callback caused + * by the device not having any pending action anymore + * we add one here that gets removed at the end of the function */ + nm_device_add_pending_action (self, + NM_PENDING_ACTION_IN_STATE_CHANGE, + TRUE); priv->in_state_changed = TRUE; priv->state = state; @@ -15844,6 +15850,9 @@ _set_state_full (NMDevice *self, concheck_update_interval (self, AF_INET6, concheck_now); priv->in_state_changed = FALSE; + nm_device_remove_pending_action (self, + NM_PENDING_ACTION_IN_STATE_CHANGE, + TRUE); if ((old_state > NM_DEVICE_STATE_UNMANAGED) != (state > NM_DEVICE_STATE_UNMANAGED)) _notify (self, PROP_MANAGED); diff --git a/src/devices/nm-device.h b/src/devices/nm-device.h index 518c66cae2..66f9aa97bd 100644 --- a/src/devices/nm-device.h +++ b/src/devices/nm-device.h @@ -53,6 +53,7 @@ nm_device_state_reason_check (NMDeviceStateReason reason) } #define NM_PENDING_ACTION_AUTOACTIVATE "autoactivate" +#define NM_PENDING_ACTION_IN_STATE_CHANGE "in-state-change" #define NM_PENDING_ACTION_RECHECK_AVAILABLE "recheck-available" #define NM_PENDING_ACTION_CARRIER_WAIT "carrier-wait" #define NM_PENDING_ACTION_WAITING_FOR_SUPPLICANT "waiting-for-supplicant" |