From: Jo-Philipp Wich Date: Sun, 22 Sep 2019 16:28:40 +0000 (+0200) Subject: nl80211: keep awaiting wpa_supplicant scan results on busy response X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=313e82709ba90f3a966f0dd348bcad007ca316be;p=oweals%2Fiwinfo.git 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 --- diff --git a/iwinfo_nl80211.c b/iwinfo_nl80211.c index 5af3f9f..0e58d43 100644 --- a/iwinfo_nl80211.c +++ b/iwinfo_nl80211.c @@ -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; }