nl80211: back out early when receiving FAIL-BUSY reply
authorJo-Philipp Wich <jo@mein.io>
Thu, 26 Apr 2018 15:12:16 +0000 (17:12 +0200)
committerJo-Philipp Wich <jo@mein.io>
Thu, 26 Apr 2018 15:12:16 +0000 (17:12 +0200)
The wpa_supplicant control socket might reply with "FAIL-BUSY" when
attempting to start a scan while another scanning process is already
running, back out early in this case.

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

index de5d2b4baabb3772d2a0ea70915a33ec667dabb1..ecd2d6ac834a1b1808dca32fa7d3e6ac78023aec 100644 (file)
@@ -2223,6 +2223,12 @@ static int nl80211_get_scanlist_wpactl(const char *ifname, char *buf, int *len)
                        /* is another unrelated event, retry */
                        tries--;
                }
+
+               /* got a failure reply */
+               else if (!strcmp(reply, "FAIL-BUSY\n"))
+               {
+                       break;
+               }
        }
 
        /* receive and parse scan results if the wait above didn't time out */