summaryrefslogtreecommitdiff
path: root/src/nm-active-connection.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nm-active-connection.c')
-rw-r--r--src/nm-active-connection.c24
1 files changed, 5 insertions, 19 deletions
diff --git a/src/nm-active-connection.c b/src/nm-active-connection.c
index e6fe7cd01b..e8d07dd23a 100644
--- a/src/nm-active-connection.c
+++ b/src/nm-active-connection.c
@@ -325,28 +325,12 @@ device_state_changed (NMDevice *device,
NMActiveConnection *self = NM_ACTIVE_CONNECTION (user_data);
NMActiveConnectionPrivate *priv = NM_ACTIVE_CONNECTION_GET_PRIVATE (self);
+ /* When already deactivated or before activation, device state changes are useless */
+ if (priv->state >= NM_ACTIVE_CONNECTION_STATE_DEACTIVATED)
+ return;
if (old_state < NM_DEVICE_STATE_DISCONNECTED)
return;
- if (old_state > NM_DEVICE_STATE_DISCONNECTED) {
- /* Ignore disconnects if this ActiveConnection has not yet started
- * activating. This is caused by activating a device when it's
- * already activated, which causes a deactivating of the device before
- * activating the new connection.
- */
- if (new_state == NM_DEVICE_STATE_DISCONNECTED &&
- old_state > NM_DEVICE_STATE_DISCONNECTED &&
- priv->state == NM_ACTIVE_CONNECTION_STATE_UNKNOWN) {
- return;
- }
-
- /* If the device used to be active, but now is disconnected/failed, we
- * no longer care about its state.
- */
- if (new_state <= NM_DEVICE_STATE_DISCONNECTED || new_state == NM_DEVICE_STATE_FAILED)
- g_signal_handlers_disconnect_by_func (device, G_CALLBACK (device_state_changed), self);
- }
-
/* Let subclasses handle the state change */
if (NM_ACTIVE_CONNECTION_GET_CLASS (self)->device_state_changed)
NM_ACTIVE_CONNECTION_GET_CLASS (self)->device_state_changed (self, device, new_state, old_state);
@@ -362,6 +346,8 @@ device_master_changed (GObject *object,
NMActiveConnection *master;
NMActiveConnectionState master_state;
+ if (NM_ACTIVE_CONNECTION (nm_device_get_act_request (device)) != self)
+ return;
if (!nm_device_get_master (device))
return;
g_signal_handlers_disconnect_by_func (device, G_CALLBACK (device_master_changed), self);