}
/* 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);
}
*len = count * sizeof(struct iwinfo_scanlist_entry);
+ break;
}
close(sock);