wpa_supplicant/wpa_supplicant-0.6.3-wext-dont-overwrite-BSS-frequency.patch
Daniel Williams 3b4d3de16a - Fix 802.11a frequency bug
- Always schedule specific SSID scans to help find hidden APs
- Properly switch between modes on mac80211 drivers
- Give adhoc connections more time to assocate
2008-06-11 11:01:48 +00:00

36 lines
1.4 KiB
Diff

commit 2e5a7b49a0a52ce36033e4839aae90e638746b6a
Author: Dan Williams <dcbw@redhat.com>
Date: Mon Jun 2 20:47:09 2008 +0300
wext: don't overwrite BSS frequency
mac80211 sends _both_ channel and frequency in it's scan results, with
frequency first and channel second (it's since been fixed to send
channel first and frequency second to work around this issue). This
results in wpa_supplicant getting the right value when the frequency
comes, but overwriting the value with '0' when the channel comes because
wpa_supplicant can't handle 5GHz channel numbers. So if a valid
previous SIOCGIWFREQ event came in, don't try to overwrite it.
diff --git a/src/drivers/driver_wext.c b/src/drivers/driver_wext.c
index f9c86bb..efa88a8 100644
--- a/src/drivers/driver_wext.c
+++ b/src/drivers/driver_wext.c
@@ -1294,8 +1294,15 @@ static void wext_get_scan_freq(struct iw_event *iwe,
/*
* Some drivers do not report frequency, but a channel.
* Try to map this to frequency by assuming they are using
- * IEEE 802.11b/g.
+ * IEEE 802.11b/g. But don't overwrite a previously parsed
+ * frequency if the driver sends both frequency and channel,
+ * since the driver may be sending an A-band channel that we
+ * don't handle here.
*/
+
+ if (res->res.freq)
+ return;
+
if (iwe->u.freq.m >= 1 && iwe->u.freq.m <= 13) {
res->res.freq = 2407 + 5 * iwe->u.freq.m;
return;