summaryrefslogtreecommitdiffstats
path: root/sbin/ifconfig/ifieee80211.c
diff options
context:
space:
mode:
authorbschmidt <bschmidt@FreeBSD.org>2011-01-30 14:22:45 +0000
committerbschmidt <bschmidt@FreeBSD.org>2011-01-30 14:22:45 +0000
commit71ec4b8793a3cb5044e713945787b810d02f235e (patch)
tree2330e68eabac94e8a1fc02d1c9f2939469fcf821 /sbin/ifconfig/ifieee80211.c
parent14dd7e3bfcdd3effe3dc9cad1db9c8eac5d14547 (diff)
downloadFreeBSD-src-71ec4b8793a3cb5044e713945787b810d02f235e.zip
FreeBSD-src-71ec4b8793a3cb5044e713945787b810d02f235e.tar.gz
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
Diffstat (limited to 'sbin/ifconfig/ifieee80211.c')
-rw-r--r--sbin/ifconfig/ifieee80211.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sbin/ifconfig/ifieee80211.c b/sbin/ifconfig/ifieee80211.c
index 0250f16..2104e0d 100644
--- a/sbin/ifconfig/ifieee80211.c
+++ b/sbin/ifconfig/ifieee80211.c
@@ -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;
OpenPOWER on IntegriCloud