Author: bschmidt
Date: Sun Jan 30 14:22:45 2011
New Revision: 218093
URL: http://svn.freebsd.org/changeset/base/218093

Log:
  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

Modified:
  head/sbin/ifconfig/ifieee80211.c

Modified: head/sbin/ifconfig/ifieee80211.c
==============================================================================
--- head/sbin/ifconfig/ifieee80211.c    Sun Jan 30 14:05:21 2011        
(r218092)
+++ head/sbin/ifconfig/ifieee80211.c    Sun Jan 30 14:22:45 2011        
(r218093)
@@ -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;
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to