Fix the 'scan hang' issue.

When requesting a scan and one is already in progess, e.g. while in scan
state, we happily wait for a scan done notification. Though, this
notification might never be sent, e.g. if we are trying to find a network
to associate to and there is none. Instead of always waiting for a
notification just do so if a new scan has been started. For both cases the
scan cache is used to report available networks even if the content might
not be fresh.

MFC after:	1 month
This commit is contained in:
Bernhard Schmidt 2011-01-30 14:22:45 +00:00
parent 7ca7a42ce6
commit 90e0ec14c1
1 changed files with 6 additions and 2 deletions

View File

@ -3230,8 +3230,12 @@ scan_and_wait(int s)
ireq.i_data = &sr;
ireq.i_len = sizeof(sr);
/* NB: only root can trigger a scan so ignore errors */
if (ioctl(s, SIOCS80211, &ireq) >= 0) {
/*
* NB: only root can trigger a scan so ignore errors. Also ignore
* possible errors from net80211, even if no new scan could be
* started there might still be a valid scan cache.
*/
if (ioctl(s, SIOCS80211, &ireq) == 0) {
char buf[2048];
struct if_announcemsghdr *ifan;
struct rt_msghdr *rtm;