diff options
author | Simon Wunderlich <simon.wunderlich@s2003.tu-chemnitz.de> | 2013-07-08 10:55:57 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-07-16 02:58:10 -0400 |
commit | 4b42aab1e8fcac2e9b835a7d93bf30dc9a032faa (patch) | |
tree | d725ba14d8bc8a4498ee71054e0d03163dcae2e9 /net/mac80211 | |
parent | 7ca15a0ae865067aac8d36e27e0acbe4a8f1e70a (diff) |
mac80211: return if IBSS chandef can not be used
This was originally designed to fail when a 40+/40- mode can not be
used, but basic modes (such as 5/10/20 MHz) must be handled
with an error.
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/ibss.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c index 8fa1c27bdfe3..449702df24ab 100644 --- a/net/mac80211/ibss.c +++ b/net/mac80211/ibss.c | |||
@@ -85,6 +85,14 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata, | |||
85 | 85 | ||
86 | chandef = ifibss->chandef; | 86 | chandef = ifibss->chandef; |
87 | if (!cfg80211_reg_can_beacon(local->hw.wiphy, &chandef)) { | 87 | if (!cfg80211_reg_can_beacon(local->hw.wiphy, &chandef)) { |
88 | if (chandef.width == NL80211_CHAN_WIDTH_5 || | ||
89 | chandef.width == NL80211_CHAN_WIDTH_10 || | ||
90 | chandef.width == NL80211_CHAN_WIDTH_20_NOHT || | ||
91 | chandef.width == NL80211_CHAN_WIDTH_20) { | ||
92 | sdata_info(sdata, | ||
93 | "Failed to join IBSS, beacons forbidden\n"); | ||
94 | return; | ||
95 | } | ||
88 | chandef.width = NL80211_CHAN_WIDTH_20; | 96 | chandef.width = NL80211_CHAN_WIDTH_20; |
89 | chandef.center_freq1 = chan->center_freq; | 97 | chandef.center_freq1 = chan->center_freq; |
90 | } | 98 | } |