From 3ecbaecf60a2b39d2cfc20c8b1bd8b368e601029 Mon Sep 17 00:00:00 2001 From: benoit Date: Fri, 13 Jun 2008 15:09:58 +0000 Subject: [PATCH] Fix needed for wpa_supplicant. It might not be the best fix. git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3724 0192ed92-7a03-0410-a25b-9323aeb14dbd --- net80211/ieee80211_scan.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/net80211/ieee80211_scan.c b/net80211/ieee80211_scan.c index 8d9aca4..c3d6418 100644 --- a/net80211/ieee80211_scan.c +++ b/net80211/ieee80211_scan.c @@ -430,6 +430,19 @@ ieee80211_start_scan(struct ieee80211vap *vap, int flags, u_int duration, IEEE80211_DPRINTF(vap, IEEE80211_MSG_SCAN, "%s: %s scan already in progress\n", __func__, ss->ss_flags & IEEE80211_SCAN_ACTIVE ? "active" : "passive"); + + /* If the running scanning has the flag SCAN_NOPICK set, but + * the requested scan has not, then we update the running scan + * flag. This is needed when wpa_supplicant is used with + * ap_scan=1. Without it, the driver will never associate. */ + + if (((flags & IEEE80211_SCAN_NOPICK) == 0) + && (ss->ss_flags & IEEE80211_SCAN_NOPICK)) { + IEEE80211_DPRINTF(vap, IEEE80211_MSG_SCAN, + "%s: clearing SCAN_NOPICK flag\n", + __func__); + ss->ss_flags &= ~IEEE80211_SCAN_NOPICK; + } } scanning = (ic->ic_flags & IEEE80211_F_SCAN);