diff options
-rw-r--r-- | src/devices/nm-device.c | 9 | ||||
-rw-r--r-- | src/nm-manager.c | 2 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index d0fc9c55b1..6115942830 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -13866,9 +13866,14 @@ set_property (GObject *object, guint prop_id, NMDeviceStateReason reason; managed = g_value_get_boolean (value); - if (managed) + if (managed) { reason = NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED; - else { + if (NM_IN_SET_TYPED (NMDeviceSysIfaceState, + priv->sys_iface_state, + NM_DEVICE_SYS_IFACE_STATE_EXTERNAL, + NM_DEVICE_SYS_IFACE_STATE_REMOVED)) + nm_device_sys_iface_state_set (self, NM_DEVICE_SYS_IFACE_STATE_ASSUME); + } else { reason = NM_DEVICE_STATE_REASON_REMOVED; nm_device_sys_iface_state_set (self, NM_DEVICE_SYS_IFACE_STATE_REMOVED); } diff --git a/src/nm-manager.c b/src/nm-manager.c index d29b6788b3..97732eebec 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -3138,6 +3138,8 @@ unmanaged_to_disconnected (NMDevice *device) * and force the device to be managed. */ nm_device_set_unmanaged_by_flags (device, NM_UNMANAGED_PLATFORM_INIT, FALSE, NM_DEVICE_STATE_REASON_USER_REQUESTED); + if (nm_device_sys_iface_state_get (device) == NM_DEVICE_SYS_IFACE_STATE_REMOVED) + nm_device_sys_iface_state_set (device, NM_DEVICE_SYS_IFACE_STATE_ASSUME); nm_device_set_unmanaged_by_flags (device, NM_UNMANAGED_USER_EXPLICIT, FALSE, NM_DEVICE_STATE_REASON_USER_REQUESTED); g_return_if_fail (nm_device_get_managed (device, FALSE)); |