From 5a5e21b158ae48b86339d337823a01a0f132b09c Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 16 Jan 2018 13:44:21 +0100 Subject: [PATCH] nl80211: skip event notifications in wpa_supplicant scan result reply Signed-off-by: Jo-Philipp Wich --- iwinfo_nl80211.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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); -- 2.25.1