Hi
I added Jose to the list. He did some larger work in the recent days and
might have an idea where the problem is.
On 08/08/2017 05:10 PM, Jonah Petri wrote:
Hello,
I want to report an issue with connman. We set BackgroundScanning = false in main.conf.
However, I have found that this also causes connman to give an erroneous empty response to
the Scan() dbus call, potentially permanently disabling the device.
The key preconditions seem to be:
1) wpa_supplicant reports a max_ssids > 1
2) the computer must have been previously associated to a SSID which is no longer visible
'previously asscioated' is from a previous run? ConnMan has been
restarted but not wpa_supplicant? Or the whole box has been restarted?
3) as above, BackgroundScanning must be set to false
This causes the logic of wifi.c:wifi_scan() to fail. In particular:
1) wifi_scan_simple is not used, due to the above preconditions.
2) connman requests an active scan via wpa_supplicant for the ssids returned by
get_latest_connections.
3) connman does not request a followup passive scan, as BackgroundScanning is turned off,
which causes start_autoscan() to exit early.
autoscan is supposed to emulate the background scanning in ConnMan.
According the following comment it should even be removed eventually:
/**
* Used for autoscan "emulation".
* Should be removed when wpa_s autoscan support will be by default.
*/
struct autoscan_params {
int base;
int limit;
int interval;
unsigned int timeout;
};
But it looks like it also used for the active scanning these days. If
this true maybe the following patch might help (shot into the dark):
From 6cff224046d80c71ad65eee3d2aae8cb8c22e4b5 Mon Sep 17 00:00:00 2001
From: Daniel Wagner <wagi(a)monom.org>
Date: Wed, 9 Aug 2017 12:30:08 +0200
Subject: [PATCH] wifi: Setup autoscan independent of BackgroundScanning
The autoscan infrastructre is used to do active scan these
days. Because we don't initialize the default values for the algorithm
when BackgroundScanning is set to false, the autoscan algorithm wont
run at all (start_autoscan() checks for valid parameters).
Reported by Jonah Petri <jonah(a)sense.com>.
---
plugins/wifi.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/plugins/wifi.c b/plugins/wifi.c
index 34c16dfd4486..d351ac0f0c9a 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -1442,8 +1442,6 @@ static void setup_autoscan(struct wifi_data *wifi)
{
if (!wifi->autoscan)
wifi->autoscan = parse_autoscan_params(AUTOSCAN_DEFAULT);
-
- start_autoscan(wifi->device);
}
static void finalize_interface_creation(struct wifi_data *wifi)
@@ -1457,13 +1455,15 @@ static void finalize_interface_creation(struct
wifi_data *wifi)
connman_device_set_powered(wifi->device, true);
+ setup_autoscan(wifi);
+
if (!connman_setting_get_bool("BackgroundScanning"))
return;
if (wifi->p2p_device)
return;
- setup_autoscan(wifi);
+ start_autoscan(wifi->device);
}
static void interface_create_callback(int result,
--
2.9.4