Hi Jason,

I did not check thoroughly but I think it's the right place to fix this is
line 1842:
instead of: } else { try a: } else if (!wifi->connected) {

That should do the trick I believe.
I tried something like your suggestion and
g_supplicant_interface_scan() does not actually trigger a scan when
scan_params is allocated, but not filled in, so I did something like
this:

diff --git a/plugins/wifi.c b/plugins/wifi.c
index 5ef4520..6b70f0e 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -1842,6 +1842,9 @@ static int wifi_scan(enum connman_service_type type,

                         return 0;
                 }
+       } else if (wifi->connected) {
+               g_supplicant_free_scan_params(scan_params);
+               return wifi_scan_simple(device);
         } else {
                 ret = get_latest_connections(driver_max_ssids, scan_params);
                 if (ret <= 0) {

and that does make the dbus requested scans cover all channels when connected.

Sounds proper to me, indeed I overlooked this scan_params issue.

However, when not connected, a dbus scan request will return after
scanning only the known networks, and then autoscan will handle
scanning all channels.  I would have expected that scans requested via
dbus would scan all channels before returning.

No because the autoscan is not a user triggered scan, the fact it's reset after a user triggered scan is nominal, but we don't want to relate the DBus pending call to it. The end result is that he will get all the results properly through Manager.ServicesChanged() signal, after his scan and after all autoscan events
if those brings updates.

I agree that scanning known networks first is a good feature, so I am
a bit concerned that sending a patch like the hunk above will make
finding known networks slower.

Known networks will be eventually found in such full scan so no worry.
When connected, there won't be any scan ran unless the user asks for one.
At this point doing only a full scan is the best imo.

And you patch does not affect the nominal behavior when not connected
(first a known networks scan, then a full scan via autoscan, etc...)

Your patch is good to go, send it.

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

Reply via email to