From: Jason Abele <[email protected]>
When wifi is connected, requesting a scan via dbus causes autoscan
to start. This is undesired during a connection as it may cause service
interruptions while the wifi device is off-channel.
Fix this by only starting autoscan when wifi is not connected.
---
plugins/wifi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Note: I expected a call to net.connman.Technology.Scan would give one scan of
all channels, but there does not appear to be an easy to request one scan of
all channels from dbus.
I am willing to implement something like this, but I would like feedback first
on the two options I am considering (please let me know of better methods):
1) Modify the dbus api to pass information that a full scan was
requested and then use that information to call wifi_scan_simple() from
within wifi_scan()
2) Allow autoscan to run once and then reset_autoscan() the second time through
autoscan_timeout()
The first option seems fairly invasive, but the second option has the downside
of returning from the dbus scan call before the actual scan of all channels
completes.
Logs with this patch:
# connmanctl connect $SERVICE
# iw event -t &
# connmanctl scan wifi
1414783973.521688: wlan0 (phy #0): scan started
1414783973.614745: wlan0 (phy #0): scan finished: 5540 5180, "RECENT_SSID1"
"RECENT_SSID2"
Scan completed for wifi
Logs without this patch:
# connmanctl connect $SERVICE
# iw event -t &
# journalctl -u connman -f | grep -i autoscan &
# connmanctl scan wifi
1414785276.400245: wlan0 (phy #0): scan started
Oct 31 19:54:36 connmand[547]: plugins/wifi.c:reset_autoscan()
1414785276.492174: wlan0 (phy #0): scan finished: 5540 5180, "RECENT_SSID1"
"RECENT_SSID2"
Scan completed for wifi
Oct 31 19:54:37 connmand[547]: plugins/wifi.c:start_autoscan()
Oct 31 19:54:37 connmand[547]: src/device.c:connman_device_ref_debug() 0x425ad8
ref 4 by plugins/wifi.c:1350:start_autoscan()
Oct 31 19:54:37 connmand[547]: plugins/wifi.c:autoscan_timeout() interval 3
1414785281.194940: wlan0 (phy #0): scan started
Oct 31 19:54:41 connmand[547]: plugins/wifi.c:autoscan_timeout() interval 9
1414785284.159957: wlan0 (phy #0): scan finished: 2412 2417 2422 2427 2432 2437
2442 2447 2452 2457 2462 2467 2472 2484 5040 5060 5080 5170 5190 5210 5230 5180
5200 5220 5240 5260 5280 5300 5320 5500 5520 5540 5560 5580 5600 5620 5640 5660
5680 5700 5745 5765 5785 5805 5825, "RECENT_SSID1" ""
1414785290.199609: wlan0 (phy #0): scan started
Oct 31 19:54:50 connmand[547]: plugins/wifi.c:autoscan_timeout() interval 27
1414785293.161206: wlan0 (phy #0): scan finished: 2412 2417 2422 2427 2432 2437
2442 2447 2452 2457 2462 2467 2472 2484 5040 5060 5080 5170 5190 5210 5230 5180
5200 5220 5240 5260 5280 5300 5320 5500 5520 5540 5560 5580 5600 5620 5640 5660
5680 5700 5745 5765 5785 5805 5825, "RECENT_SSID1" ""
diff --git a/plugins/wifi.c b/plugins/wifi.c
index 5f2ebf1..a87124d 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -1243,7 +1243,7 @@ static void scan_callback(int result,
GSupplicantInterface *interface,
CONNMAN_SERVICE_TYPE_WIFI, false);
}
- if (result != -ENOLINK)
+ if (result != -ENOLINK && !wifi->connected)
start_autoscan(device);
/*
--
1.9.1
_______________________________________________
connman mailing list
[email protected]
https://lists.connman.net/mailman/listinfo/connman