summaryrefslogtreecommitdiff
path: root/plugins/wifi.c
diff options
context:
space:
mode:
authorGrant Erickson <marathon96@gmail.com>2013-03-25 09:20:38 -0700
committerPatrik Flykt <patrik.flykt@linux.intel.com>2013-03-27 15:39:37 +0200
commitec3eca317f9431dd394f62942c9a23404b6cecfe (patch)
tree8936fc4800c0a50f3cb4a6ce319ad5f5270afae0 /plugins/wifi.c
parentd7d8f8bdb7c1ddae098893e10608fcb42034a9ff (diff)
downloadconnman-ec3eca317f9431dd394f62942c9a23404b6cecfe.tar.gz
connman-ec3eca317f9431dd394f62942c9a23404b6cecfe.tar.bz2
connman-ec3eca317f9431dd394f62942c9a23404b6cecfe.zip
wifi: terminate autoscan stop if autoscan is not active
This terminates the body of stop_autoscan if autoscan is not active. Per MEEGO-25987 <http://bugs.meego.com/show_bug.cgi?id=25987>, running stop_autoscan when changing connected services can prematurely and incorrectly terminate a new, in-flight service connection and result in a failure of that connection with "net.connman.Error.OperationAborted: Operation aborted". When a scan is started, all networks are marked unavailable. Should the check added in this patch not be present, device scanning is set to false and all not yet found networks are removed. Thus the service will not be able to connect if its network wasn't already found.
Diffstat (limited to 'plugins/wifi.c')
-rw-r--r--plugins/wifi.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/plugins/wifi.c b/plugins/wifi.c
index dd79cd35..a0cb966a 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -233,6 +233,11 @@ static void reset_autoscan(struct connman_device *device)
static void stop_autoscan(struct connman_device *device)
{
+ const struct wifi_data *wifi = connman_device_get_data(device);
+
+ if (wifi == NULL || wifi->autoscan == NULL)
+ return;
+
reset_autoscan(device);
connman_device_set_scanning(device, FALSE);