Skip to content

Commit

Permalink
mac80211: check csa wiphy flag in ibss before switching
Browse files Browse the repository at this point in the history
When external CSA IEs are received (beacons or action messages), a
channel switch is triggered as well. This should only be allowed on
devices which actually support channel switches, otherwise disconnect.
(For the corresponding userspace invocation, the wiphy flag is checked
in nl80211).

Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Simon Wunderlich authored and Johannes Berg committed Dec 2, 2013
1 parent dda444d commit 0834ae3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions net/mac80211/ibss.c
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,10 @@ ieee80211_ibss_process_chanswitch(struct ieee80211_sub_if_data *sdata,
if (err)
return false;

/* channel switch is not supported, disconnect */
if (!(sdata->local->hw.wiphy->flags & WIPHY_FLAG_HAS_CHANNEL_SWITCH))
goto disconnect;

params.count = csa_ie.count;
params.chandef = csa_ie.chandef;

Expand Down

0 comments on commit 0834ae3

Please sign in to comment.