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.
---

Changes since RFC:
 * move check for wifi->connected to start_autoscan()

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" ""

 plugins/wifi.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/plugins/wifi.c b/plugins/wifi.c
index 5f2ebf1..187233b 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -1340,6 +1340,9 @@ static void start_autoscan(struct connman_device *device)
        if (wifi->p2p_device)
                return;
 
+       if (wifi->connected)
+               return;
+
        autoscan = wifi->autoscan;
        if (!autoscan)
                return;
-- 
1.9.1

_______________________________________________
connman mailing list
[email protected]
https://lists.connman.net/mailman/listinfo/connman

Reply via email to