mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-25 21:10:08 +01:00
devices: start using the DEACTIVATING state
When a device is disconnected by the user (as opposed to due to network or hardware error, etc), set it first to DEACTIVATING, which does nothing but queue a transition to disconnected. This lets other parts of NM observe the device when it is about-to-disconnect, but still has an associated connection.
This commit is contained in:
parent
eceb613f4c
commit
c4fc72c795
2 changed files with 5 additions and 3 deletions
|
|
@ -4618,7 +4618,7 @@ disconnect_cb (NMDevice *device,
|
||||||
TRUE);
|
TRUE);
|
||||||
|
|
||||||
nm_device_state_changed (device,
|
nm_device_state_changed (device,
|
||||||
NM_DEVICE_STATE_DISCONNECTED,
|
NM_DEVICE_STATE_DEACTIVATING,
|
||||||
NM_DEVICE_STATE_REASON_USER_REQUESTED);
|
NM_DEVICE_STATE_REASON_USER_REQUESTED);
|
||||||
dbus_g_method_return (context);
|
dbus_g_method_return (context);
|
||||||
}
|
}
|
||||||
|
|
@ -6304,6 +6304,9 @@ nm_device_state_changed (NMDevice *device,
|
||||||
nm_device_queue_state (device, NM_DEVICE_STATE_UNMANAGED, NM_DEVICE_STATE_REASON_NONE);
|
nm_device_queue_state (device, NM_DEVICE_STATE_UNMANAGED, NM_DEVICE_STATE_REASON_NONE);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case NM_DEVICE_STATE_DEACTIVATING:
|
||||||
|
nm_device_queue_state (device, NM_DEVICE_STATE_DISCONNECTED, reason);
|
||||||
|
break;
|
||||||
case NM_DEVICE_STATE_DISCONNECTED:
|
case NM_DEVICE_STATE_DISCONNECTED:
|
||||||
if (old_state > NM_DEVICE_STATE_DISCONNECTED && priv->default_unmanaged)
|
if (old_state > NM_DEVICE_STATE_DISCONNECTED && priv->default_unmanaged)
|
||||||
nm_device_queue_state (device, NM_DEVICE_STATE_UNMANAGED, NM_DEVICE_STATE_REASON_NONE);
|
nm_device_queue_state (device, NM_DEVICE_STATE_UNMANAGED, NM_DEVICE_STATE_REASON_NONE);
|
||||||
|
|
|
||||||
|
|
@ -3489,9 +3489,8 @@ nm_manager_deactivate_connection (NMManager *manager,
|
||||||
"The VPN connection was not active.");
|
"The VPN connection was not active.");
|
||||||
} else {
|
} else {
|
||||||
g_assert (NM_IS_ACT_REQUEST (active));
|
g_assert (NM_IS_ACT_REQUEST (active));
|
||||||
/* FIXME: use DEACTIVATING state */
|
|
||||||
nm_device_state_changed (nm_active_connection_get_device (active),
|
nm_device_state_changed (nm_active_connection_get_device (active),
|
||||||
NM_DEVICE_STATE_DISCONNECTED,
|
NM_DEVICE_STATE_DEACTIVATING,
|
||||||
reason);
|
reason);
|
||||||
success = TRUE;
|
success = TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue