mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-04-17 13:50:41 +02:00
iwd: Don't call IWD methods when device unmanaged
When using IWD-side autoconnect mode (current default), in .deactivate()
and .deactivate_async() refrain from commanding IWD to actually
disconnect until the device is managed. Likely the device is already
disconnected but in any case it's up to IWD to decide in this mode.
Calling IWD device's .Disconnect() D-Bus method has the side effect of
disabling autoconnect and doing this while NM is still in platform-init
was unexpectedly leaving the device without autoconnect after
platform-init was done, according to user reports.
Fixes: dc0e31fb70 ('iwd: Add the wifi.iwd.autoconnect setting')
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/786
This commit is contained in:
parent
758fbd7aac
commit
1708e9a3cc
1 changed files with 13 additions and 2 deletions
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue