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.
{
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);