nl80211: keep awaiting wpa_supplicant scan results on busy response
authorJo-Philipp Wich <jo@mein.io>
Sun, 22 Sep 2019 16:28:40 +0000 (18:28 +0200)
committerJo-Philipp Wich <jo@mein.io>
Sun, 22 Sep 2019 16:49:26 +0000 (18:49 +0200)
When wpa_supplicant responds with FAIL-BUSY in response to the SCAN
command, a scan process is already in process. Instead of failing in
this case, simply keep awaiting the result list.

This also significantly speeds up the scan operation in many cases.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
iwinfo_nl80211.c

index 5af3f9fa569af094539b79c8b8c3874a784c24a9..0e58d4369a2aeeab384241c449c9e5b04d68f6b2 100644 (file)
@@ -2471,8 +2471,14 @@ static int nl80211_get_scanlist_wpactl(const char *ifname, char *buf, int *len)
                        tries--;
                }
 
-               /* got a failure reply */
+               /* scanning already in progress, keep awaiting results */
                else if (!strcmp(reply, "FAIL-BUSY\n"))
+               {
+                       tries--;
+               }
+
+               /* another failure, abort */
+               else if (!strncmp(reply, "FAIL-", 5))
                {
                        break;
                }