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>
This commit is contained in:
committed by
John W. Linville
parent
369391db1a
commit
881d948c23
@@ -93,7 +93,7 @@ static inline void mesh_plink_fsm_restart(struct sta_info *sta)
|
||||
* on it in the lifecycle management section!
|
||||
*/
|
||||
static struct sta_info *mesh_plink_alloc(struct ieee80211_sub_if_data *sdata,
|
||||
u8 *hw_addr, u64 rates)
|
||||
u8 *hw_addr, u32 rates)
|
||||
{
|
||||
struct ieee80211_local *local = sdata->local;
|
||||
struct sta_info *sta;
|
||||
@@ -222,7 +222,7 @@ static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata,
|
||||
return 0;
|
||||
}
|
||||
|
||||
void mesh_neighbour_update(u8 *hw_addr, u64 rates, struct ieee80211_sub_if_data *sdata,
|
||||
void mesh_neighbour_update(u8 *hw_addr, u32 rates, struct ieee80211_sub_if_data *sdata,
|
||||
bool peer_accepting_plinks)
|
||||
{
|
||||
struct ieee80211_local *local = sdata->local;
|
||||
@@ -447,7 +447,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
|
||||
spin_lock_bh(&sta->lock);
|
||||
} else if (!sta) {
|
||||
/* ftype == PLINK_OPEN */
|
||||
u64 rates;
|
||||
u32 rates;
|
||||
if (!mesh_plink_free_count(sdata)) {
|
||||
mpl_dbg("Mesh plink error: no more free plinks\n");
|
||||
rcu_read_unlock();
|
||||
|
Reference in New Issue
Block a user