From c6e3140b38088c2a0ee9a995cd035fc2adfa8328 Mon Sep 17 00:00:00 2001 From: Andrew Zaborowski Date: Wed, 18 Apr 2018 07:03:21 +0200 Subject: [PATCH] device: Handle disconnect by AP and by SME events same way The difference in the handlers was that in the NETDEV_EVENT_DISCONNECT_BY_AP case we would make sure to reply to a pending dbus Connect call. We also need to do that for NETDEV_EVENT_DISCONNECT_BY_SME. This happens if another process sends an nl80211 disconnect command while we're connecting. --- src/device.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/device.c b/src/device.c index 0de0a0e2..07f6a915 100644 --- a/src/device.c +++ b/src/device.c @@ -588,7 +588,7 @@ static void device_disassociated(struct device *device) device_enter_state(device, DEVICE_STATE_AUTOCONNECT); } -static void device_disconnect_by_ap(struct device *device) +static void device_disconnect_event(struct device *device) { l_debug("%d", device->index); @@ -1603,10 +1603,8 @@ static void device_netdev_event(struct netdev *netdev, enum netdev_event event, device_lost_beacon(device); break; case NETDEV_EVENT_DISCONNECT_BY_AP: - device_disconnect_by_ap(device); - break; case NETDEV_EVENT_DISCONNECT_BY_SME: - device_disassociated(device); + device_disconnect_event(device); break; case NETDEV_EVENT_RSSI_THRESHOLD_LOW: if (device->signal_low)