device: Do not mark connecting networks unavailable
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Mon, 22 Oct 2012 07:07:49 +0000 (10:07 +0300)
committerPatrik Flykt <patrik.flykt@linux.intel.com>
Mon, 22 Oct 2012 12:55:32 +0000 (15:55 +0300)
When autoscan fallback code is started, it sets scanning to true which
in turn marks all networks unavailable except for the ones that are
already connected. When connecting during an ongoing autoscan, the
connection attempt stops autoscan and all unavailable networks are
removed, also the one to be connected.

The fix is to ignore both connected and connecting networks when
marking networks unavailable.

src/device.c

index 9f88dfa..fc374f5 100644 (file)
@@ -660,7 +660,8 @@ static void mark_network_unavailable(gpointer key, gpointer value,
 {
        struct connman_network *network = value;
 
-       if (connman_network_get_connected(network) == TRUE)
+       if (connman_network_get_connected(network) == TRUE ||
+                       connman_network_get_connecting(network) == TRUE)
                return;
 
        connman_network_set_available(network, FALSE);