about summary refs log tree commit diff
path: root/src/core/devices/wifi/nm-device-iwd.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2021-08-16 09:51:46 +0200
committerMichael Biebl <biebl@debian.org>2021-08-16 09:51:46 +0200
commitbfe522304da217296e2a61040f58e35ec5d6f3f2 (patch)
tree6c4296644fa59cbfe51d9e8aafebddace5ac6b6f /src/core/devices/wifi/nm-device-iwd.c
parent3a56bce6c0ea7ba0fe269520547740783b342e0d (diff)
New upstream version 1.30.6 upstream/1.30.6
Diffstat (limited to 'src/core/devices/wifi/nm-device-iwd.c')
-rw-r--r--src/core/devices/wifi/nm-device-iwd.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/core/devices/wifi/nm-device-iwd.c b/src/core/devices/wifi/nm-device-iwd.c
index 95ade44b..01f2a303 100644
--- a/src/core/devices/wifi/nm-device-iwd.c
+++ b/src/core/devices/wifi/nm-device-iwd.c
@@ -588,10 +588,16 @@ deactivate(NMDevice *device)
             return;
     }
 
-    cleanup_association_attempt(self, TRUE);
+    cleanup_association_attempt(self, FALSE);
     priv->act_mode_switch = FALSE;
 
-    if (!priv->dbus_station_proxy)
+    /* Don't trigger any actions on the IWD side until the device is managed */
+    if (priv->iwd_autoconnect && nm_device_get_state(device) < NM_DEVICE_STATE_DISCONNECTED)
+        return;
+
+    if (priv->dbus_station_proxy)
+        send_disconnect(self);
+    else
         reset_mode(self, NULL, NULL, NULL);
 }
 
@@ -647,6 +653,11 @@ deactivate_async(NMDevice *                 device,
     cleanup_association_attempt(self, FALSE);
     priv->act_mode_switch = FALSE;
 
+    if (priv->iwd_autoconnect && nm_device_get_state(device) < NM_DEVICE_STATE_DISCONNECTED) {
+        nm_utils_invoke_on_idle(cancellable, disconnect_cb_on_idle, user_data);
+        return;
+    }
+
     if (priv->dbus_station_proxy) {
         g_dbus_proxy_call(priv->dbus_station_proxy,
                           "Disconnect",