mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-09 05:58:01 +02:00
device: use the REMOVED only when unmanaging an active device while quitting
For the devices that are not active we still want to run the cleanup path.
Fixes: 3e2fce288a
This commit is contained in:
parent
3e2fce288a
commit
ac457aa322
1 changed files with 5 additions and 2 deletions
|
|
@ -8800,15 +8800,18 @@ void
|
||||||
nm_device_set_unmanaged_quitting (NMDevice *self)
|
nm_device_set_unmanaged_quitting (NMDevice *self)
|
||||||
{
|
{
|
||||||
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
|
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
|
||||||
|
gboolean need_deactivate = nm_device_is_activating (self) ||
|
||||||
|
priv->state == NM_DEVICE_STATE_ACTIVATED;
|
||||||
|
|
||||||
/* It's OK to block here because we're quitting */
|
/* It's OK to block here because we're quitting */
|
||||||
if (nm_device_is_activating (self) || priv->state == NM_DEVICE_STATE_ACTIVATED)
|
if (need_deactivate)
|
||||||
_set_state_full (self, NM_DEVICE_STATE_DEACTIVATING, NM_DEVICE_STATE_REASON_NOW_UNMANAGED, TRUE);
|
_set_state_full (self, NM_DEVICE_STATE_DEACTIVATING, NM_DEVICE_STATE_REASON_NOW_UNMANAGED, TRUE);
|
||||||
|
|
||||||
nm_device_set_unmanaged_flags (self,
|
nm_device_set_unmanaged_flags (self,
|
||||||
NM_UNMANAGED_INTERNAL,
|
NM_UNMANAGED_INTERNAL,
|
||||||
TRUE,
|
TRUE,
|
||||||
NM_DEVICE_STATE_REASON_REMOVED);
|
need_deactivate ? NM_DEVICE_STATE_REASON_REMOVED
|
||||||
|
: NM_DEVICE_STATE_REASON_NOW_UNMANAGED);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue