Date: Sun, 30 Jan 2011 14:22:45 +0000 (UTC) From: Bernhard Schmidt <bschmidt@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r218093 - head/sbin/ifconfig Message-ID: <201101301422.p0UEMjnj074514@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201101301422.p0UEMjnj074514>