summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Cardace <acardace@redhat.com>2021-01-19 18:42:41 +0100
committerAntonio Cardace <acardace@redhat.com>2021-02-02 09:51:57 +0100
commita4d37612c84de0718fd9629e1a4d06277d149c5a (patch)
tree733d7f5b01677cd502eb2c5d523d8d7e4fc11d6d
parent91766a6910cde49bdcca0bcdc902583b1009378f (diff)
downloadNetworkManager-a4d37612c84de0718fd9629e1a4d06277d149c5a.tar.gz
device: take over unmanaged devices when explicitely deactivated
https://bugzilla.redhat.com/show_bug.cgi?id=1870691 Signed-off-by: Antonio Cardace <acardace@redhat.com>
-rw-r--r--src/devices/nm-device.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 8c5b9c52e6..e3f55240d0 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -13272,6 +13272,12 @@ nm_device_disconnect_active_connection(NMActiveConnection * active,
if (NM_ACTIVE_CONNECTION(priv->act_request.obj) == active) {
if (priv->state < NM_DEVICE_STATE_DEACTIVATING) {
+ /* When the user actively deactivates a profile, we set
+ * the sys-iface-state to managed so that we deconfigure/cleanup the interface.
+ * But for external connections that go down otherwise, we don't want to touch the interface. */
+ if (nm_device_sys_iface_state_is_external(self))
+ nm_device_sys_iface_state_set(self, NM_DEVICE_SYS_IFACE_STATE_MANAGED);
+
nm_device_state_changed(self, NM_DEVICE_STATE_DEACTIVATING, device_reason);
} else {
/* @active is the current ac of @self, but it's going down already.