wifi: terminate autoscan stop if autoscan is not active
authorGrant Erickson <marathon96@gmail.com>
Mon, 25 Mar 2013 16:20:38 +0000 (09:20 -0700)
committerPatrik Flykt <patrik.flykt@linux.intel.com>
Wed, 27 Mar 2013 13:39:37 +0000 (15:39 +0200)
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.

plugins/wifi.c

index dd79cd3..a0cb966 100644 (file)
@@ -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);