aboutsummaryrefslogtreecommitdiffstats
path: root/src/drivers/driver_wext.c
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2008-07-15 17:07:50 (GMT)
committerJouni Malinen <j@w1.fi>2008-07-15 17:07:50 (GMT)
commit93ef879f0fedcaed519345b5181690e6d0993c57 (patch)
treed06eaa136c68bfeb5b84babfc0e6f2af27942731 /src/drivers/driver_wext.c
parent6e33ca4529e7b4eae9a46db224282a116d112ffa (diff)
downloadhostap-93ef879f0fedcaed519345b5181690e6d0993c57.zip
hostap-93ef879f0fedcaed519345b5181690e6d0993c57.tar.gz
hostap-93ef879f0fedcaed519345b5181690e6d0993c57.tar.bz2
wext: fix maxrate calculation
When scan results got moved from wpa_scan_result -> wpa_scan_res, the 'maxrate' member was dropped from wpa_scan_res. The D-Bus interface used 'maxrate', which was replaced with wpa_scan_get_max_rate(). Unfortunately, wpa_scan_get_max_rate() returns 802.11 rate values directly from the IE, where 'maxrate' was the rate in bits/second. The supplicant internally fakes an IE for wpa_scan_res from the value of wpa_scan_result->maxrate, but interprets ->maxrate as an 802.11 rate index. As a side-effect, this fixes a soft-break of the D-Bus control API since the wpa_scan_res change was introduced.
Diffstat (limited to 'src/drivers/driver_wext.c')
-rw-r--r--src/drivers/driver_wext.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/drivers/driver_wext.c b/src/drivers/driver_wext.c
index 4c5ff7b..a7f4ead 100644
--- a/src/drivers/driver_wext.c
+++ b/src/drivers/driver_wext.c
@@ -1364,7 +1364,11 @@ static void wext_get_scan_rate(struct iw_event *iwe,
clen -= sizeof(struct iw_param);
custom += sizeof(struct iw_param);
}
- res->maxrate = maxrate;
+
+ /* Convert the maxrate from WE-style (b/s units) to
+ * 802.11 rates (500000 b/s units).
+ */
+ res->maxrate = maxrate / 500000;
}