diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-01-21 09:13:48 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-01-29 16:01:09 -0500 |
commit | 881d948c23442173a011f1adcfe4c95bf7f27515 (patch) | |
tree | 3d7e6a4bf23b960cf45a4d2c5734578168ce0424 /net/mac80211/mlme.c | |
parent | 369391db1aabd089cefaadaabb6d9fc82e78b0a7 (diff) |
wireless: restrict to 32 legacy rates
Since the standards only define 12 legacy rates, 32 is certainly
a sane upper limit and we don't need to use u64 everywhere. Add
sanity checking that no more than 32 rates are registered and
change the variables to u32 throughout.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r-- | net/mac80211/mlme.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index b9e4b93089c4..9852da54f5e7 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -73,7 +73,7 @@ static u8 *ieee80211_bss_get_ie(struct ieee80211_bss *bss, u8 ie) | |||
73 | 73 | ||
74 | static int ieee80211_compatible_rates(struct ieee80211_bss *bss, | 74 | static int ieee80211_compatible_rates(struct ieee80211_bss *bss, |
75 | struct ieee80211_supported_band *sband, | 75 | struct ieee80211_supported_band *sband, |
76 | u64 *rates) | 76 | u32 *rates) |
77 | { | 77 | { |
78 | int i, j, count; | 78 | int i, j, count; |
79 | *rates = 0; | 79 | *rates = 0; |
@@ -93,14 +93,14 @@ static int ieee80211_compatible_rates(struct ieee80211_bss *bss, | |||
93 | } | 93 | } |
94 | 94 | ||
95 | /* also used by mesh code */ | 95 | /* also used by mesh code */ |
96 | u64 ieee80211_sta_get_rates(struct ieee80211_local *local, | 96 | u32 ieee80211_sta_get_rates(struct ieee80211_local *local, |
97 | struct ieee802_11_elems *elems, | 97 | struct ieee802_11_elems *elems, |
98 | enum ieee80211_band band) | 98 | enum ieee80211_band band) |
99 | { | 99 | { |
100 | struct ieee80211_supported_band *sband; | 100 | struct ieee80211_supported_band *sband; |
101 | struct ieee80211_rate *bitrates; | 101 | struct ieee80211_rate *bitrates; |
102 | size_t num_rates; | 102 | size_t num_rates; |
103 | u64 supp_rates; | 103 | u32 supp_rates; |
104 | int i, j; | 104 | int i, j; |
105 | sband = local->hw.wiphy->bands[band]; | 105 | sband = local->hw.wiphy->bands[band]; |
106 | 106 | ||
@@ -253,7 +253,7 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata, | |||
253 | struct ieee80211_bss *bss; | 253 | struct ieee80211_bss *bss; |
254 | int wmm = 0; | 254 | int wmm = 0; |
255 | struct ieee80211_supported_band *sband; | 255 | struct ieee80211_supported_band *sband; |
256 | u64 rates = 0; | 256 | u32 rates = 0; |
257 | size_t e_ies_len; | 257 | size_t e_ies_len; |
258 | 258 | ||
259 | if (ifsta->flags & IEEE80211_STA_PREV_BSSID_SET) { | 259 | if (ifsta->flags & IEEE80211_STA_PREV_BSSID_SET) { |
@@ -1282,7 +1282,7 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata, | |||
1282 | struct ieee80211_local *local = sdata->local; | 1282 | struct ieee80211_local *local = sdata->local; |
1283 | struct ieee80211_supported_band *sband; | 1283 | struct ieee80211_supported_band *sband; |
1284 | struct sta_info *sta; | 1284 | struct sta_info *sta; |
1285 | u64 rates, basic_rates; | 1285 | u32 rates, basic_rates; |
1286 | u16 capab_info, status_code, aid; | 1286 | u16 capab_info, status_code, aid; |
1287 | struct ieee802_11_elems elems; | 1287 | struct ieee802_11_elems elems; |
1288 | struct ieee80211_bss_conf *bss_conf = &sdata->vif.bss_conf; | 1288 | struct ieee80211_bss_conf *bss_conf = &sdata->vif.bss_conf; |
@@ -1639,7 +1639,7 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata, | |||
1639 | struct sta_info *sta; | 1639 | struct sta_info *sta; |
1640 | struct ieee80211_channel *channel; | 1640 | struct ieee80211_channel *channel; |
1641 | u64 beacon_timestamp, rx_timestamp; | 1641 | u64 beacon_timestamp, rx_timestamp; |
1642 | u64 supp_rates = 0; | 1642 | u32 supp_rates = 0; |
1643 | enum ieee80211_band band = rx_status->band; | 1643 | enum ieee80211_band band = rx_status->band; |
1644 | 1644 | ||
1645 | if (elems->ds_params && elems->ds_params_len == 1) | 1645 | if (elems->ds_params && elems->ds_params_len == 1) |
@@ -1660,7 +1660,7 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata, | |||
1660 | 1660 | ||
1661 | sta = sta_info_get(local, mgmt->sa); | 1661 | sta = sta_info_get(local, mgmt->sa); |
1662 | if (sta) { | 1662 | if (sta) { |
1663 | u64 prev_rates; | 1663 | u32 prev_rates; |
1664 | 1664 | ||
1665 | prev_rates = sta->sta.supp_rates[band]; | 1665 | prev_rates = sta->sta.supp_rates[band]; |
1666 | /* make sure mandatory rates are always added */ | 1666 | /* make sure mandatory rates are always added */ |
@@ -2526,7 +2526,7 @@ void ieee80211_sta_setup_sdata(struct ieee80211_sub_if_data *sdata) | |||
2526 | * must be callable in atomic context. | 2526 | * must be callable in atomic context. |
2527 | */ | 2527 | */ |
2528 | struct sta_info *ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata, | 2528 | struct sta_info *ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata, |
2529 | u8 *bssid,u8 *addr, u64 supp_rates) | 2529 | u8 *bssid,u8 *addr, u32 supp_rates) |
2530 | { | 2530 | { |
2531 | struct ieee80211_local *local = sdata->local; | 2531 | struct ieee80211_local *local = sdata->local; |
2532 | struct sta_info *sta; | 2532 | struct sta_info *sta; |