summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2019-09-22 18:28:40 +0200
committerJo-Philipp Wich <jo@mein.io>2019-09-22 18:49:26 +0200
commit313e82709ba90f3a966f0dd348bcad007ca316be (patch)
tree7012aea97a8b785de20bc4b48e5808391793d764
parenta76675136938c120e55a52c86fd89683486dc78c (diff)
downloadiwinfo-313e82709ba90f3a966f0dd348bcad007ca316be.tar.gz
nl80211: keep awaiting wpa_supplicant scan results on busy response
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>
-rw-r--r--iwinfo_nl80211.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/iwinfo_nl80211.c b/iwinfo_nl80211.c
index 5af3f9f..0e58d43 100644
--- a/iwinfo_nl80211.c
+++ b/iwinfo_nl80211.c
@@ -2471,9 +2471,15 @@ 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;
}
}