From: Jo-Philipp Wich Date: Tue, 16 Jan 2018 12:44:21 +0000 (+0100) Subject: nl80211: skip event notifications in wpa_supplicant scan result reply X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fiwinfo.git;a=commitdiff_plain;h=5a5e21b158ae48b86339d337823a01a0f132b09c nl80211: skip event notifications in wpa_supplicant scan result reply Signed-off-by: Jo-Philipp Wich --- diff --git a/iwinfo_nl80211.c b/iwinfo_nl80211.c index 2776531..9044610 100644 --- a/iwinfo_nl80211.c +++ b/iwinfo_nl80211.c @@ -2209,8 +2209,12 @@ static int nl80211_get_scanlist_wpactl(const char *ifname, char *buf, int *len) } /* receive and parse scan results if the wait above didn't time out */ - if (ready && nl80211_wpactl_recv(sock, reply, sizeof(reply)) > 0) + while (ready && nl80211_wpactl_recv(sock, reply, sizeof(reply)) > 0) { + /* received an event notification, receive again */ + if (reply[0] == '<') + continue; + nl80211_get_quality_max(ifname, &qmax); for (line = strtok_r(reply, "\n", &pos); @@ -2288,6 +2292,7 @@ static int nl80211_get_scanlist_wpactl(const char *ifname, char *buf, int *len) } *len = count * sizeof(struct iwinfo_scanlist_entry); + break; } close(sock);