From: Luciano Coelho Date: Tue, 28 Oct 2014 11:33:05 +0000 (+0200) Subject: mac80211: schedule the actual switch of the station before CSA count 0 X-Git-Tag: v3.17.4~82 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c6b3055441e548ba1ee761c982c5e60c88cfb486;p=thirdparty%2Fkernel%2Fstable.git mac80211: schedule the actual switch of the station before CSA count 0 commit ff1e417c7c239b7abfe70aa90460a77eaafc7f83 upstream. Due to the time it takes to process the beacon that started the CSA process, we may be late for the switch if we try to reach exactly beacon 0. To avoid that, use count - 1 when calculating the switch time. Reported-by: Jouni Malinen Signed-off-by: Luciano Coelho Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index f77e7c1164789..86d44db5da064 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -1154,7 +1154,8 @@ ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata, ieee80211_queue_work(&local->hw, &ifmgd->chswitch_work); else mod_timer(&ifmgd->chswitch_timer, - TU_TO_EXP_TIME(csa_ie.count * cbss->beacon_interval)); + TU_TO_EXP_TIME((csa_ie.count - 1) * + cbss->beacon_interval)); } static u32 ieee80211_handle_pwr_constr(struct ieee80211_sub_if_data *sdata,