Commit e7480bbb authored by Luis R. Rodriguez's avatar Luis R. Rodriguez Committed by John W. Linville

mac80211: fix channel assumption for association done work

Be consistent and use the wk->chan instead of the
local-> for the association done work.
This prevents any possible races against channel changes
while we run this work.

In the case that the race did happen we would be initializing
the bit rates for the new AP under the assumption of a wrong
channel and in the worst case, wrong band. This could lead
to trying to assuming we could use CCK frames on 5 GHz, for

This patch has a fix for kernels >= v2.6.34

Signed-off-by: default avatarLuis R. Rodriguez <>
Signed-off-by: default avatarJohn W. Linville <>
parent 691895e7
......@@ -1291,7 +1291,7 @@ static bool ieee80211_assoc_success(struct ieee80211_work *wk,
rates = 0;
basic_rates = 0;
sband = local->hw.wiphy->bands[local->>band];
sband = local->hw.wiphy->bands[wk->chan->band];
for (i = 0; i < elems.supp_rates_len; i++) {
int rate = (elems.supp_rates[i] & 0x7f) * 5;
......@@ -1327,11 +1327,11 @@ static bool ieee80211_assoc_success(struct ieee80211_work *wk,
sta->sta.supp_rates[local->>band] = rates;
sta->sta.supp_rates[wk->chan->band] = rates;
sdata->vif.bss_conf.basic_rates = basic_rates;
/* cf. IEEE 802.11 9.2.12 */
if (local->>band == IEEE80211_BAND_2GHZ &&
if (wk->chan->band == IEEE80211_BAND_2GHZ &&
sdata->flags |= IEEE80211_SDATA_OPERATING_GMODE;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment