mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-01-13 03:42:36 +01:00
device: Handle disconnect calls while connecting
If Disconnect is called during an ongoing connection attempt send a CMD_DEAUTHENTICATE command same as when we're already connected, and send a reply to potential dbus Connect call.
This commit is contained in:
parent
8b20019ded
commit
f468fceb02
14
src/device.c
14
src/device.c
@ -555,7 +555,9 @@ static void device_connect_cb(struct netdev *netdev, enum netdev_result result,
|
||||
dbus_pending_reply(&device->connect_pending,
|
||||
dbus_error_failed(device->connect_pending));
|
||||
|
||||
device_disassociated(device);
|
||||
if (device->state == DEVICE_STATE_CONNECTING)
|
||||
device_disassociated(device);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@ -744,10 +746,9 @@ static struct l_dbus_message *device_disconnect(struct l_dbus *dbus,
|
||||
void *user_data)
|
||||
{
|
||||
struct device *device = user_data;
|
||||
struct network *network;
|
||||
struct network *network = device->connected_network;
|
||||
|
||||
if (device->state == DEVICE_STATE_CONNECTING ||
|
||||
device->state == DEVICE_STATE_DISCONNECTING)
|
||||
if (device->state == DEVICE_STATE_DISCONNECTING)
|
||||
return dbus_error_busy(message);
|
||||
|
||||
if (!device->connected_bss)
|
||||
@ -756,7 +757,10 @@ static struct l_dbus_message *device_disconnect(struct l_dbus *dbus,
|
||||
if (netdev_disconnect(device->netdev, device_disconnect_cb, device) < 0)
|
||||
return dbus_error_failed(message);
|
||||
|
||||
network = device->connected_network;
|
||||
if (device->state == DEVICE_STATE_CONNECTING)
|
||||
if (device->connect_pending)
|
||||
dbus_pending_reply(&device->connect_pending,
|
||||
dbus_error_aborted(device->connect_pending));
|
||||
|
||||
/*
|
||||
* If the disconnect somehow fails we won't know if we're still
|
||||
|
Loading…
Reference in New Issue
Block a user