aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/mlme.c
diff options
context:
space:
mode:
authorAssaf Krauss <assaf.krauss@intel.com>2008-06-05 12:55:21 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-06-09 15:53:37 -0400
commitbe038b376465953c358d675cb38a611898a49dc2 (patch)
treed635b7db02e40496a582c06e93d319260fe53ed9 /net/mac80211/mlme.c
parent872ba53395b2a8be08c3ea2d39e225e5b4a8cb40 (diff)
mac80211: Checking IBSS support while changing channel in ad-hoc mode
This patch adds a check to the set_channel flow. When attempting to change the channel while in IBSS mode, and the new channel does not support IBSS mode, the flow return with an error value with no consequences on the mac80211 and driver state. Signed-off-by: Assaf Krauss <assaf.krauss@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r--net/mac80211/mlme.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index affe42f8484c..4d2b582dd055 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -2359,13 +2359,10 @@ static int ieee80211_sta_join_ibss(struct net_device *dev,
2359 sdata->drop_unencrypted = bss->capability & 2359 sdata->drop_unencrypted = bss->capability &
2360 WLAN_CAPABILITY_PRIVACY ? 1 : 0; 2360 WLAN_CAPABILITY_PRIVACY ? 1 : 0;
2361 2361
2362 res = ieee80211_set_freq(local, bss->freq); 2362 res = ieee80211_set_freq(dev, bss->freq);
2363 2363
2364 if (local->oper_channel->flags & IEEE80211_CHAN_NO_IBSS) { 2364 if (res)
2365 printk(KERN_DEBUG "%s: IBSS not allowed on frequency " 2365 return res;
2366 "%d MHz\n", dev->name, local->oper_channel->center_freq);
2367 return -1;
2368 }
2369 2366
2370 /* Set beacon template */ 2367 /* Set beacon template */
2371 skb = dev_alloc_skb(local->hw.extra_tx_headroom + 400); 2368 skb = dev_alloc_skb(local->hw.extra_tx_headroom + 400);
@@ -3491,7 +3488,7 @@ static int ieee80211_sta_config_auth(struct net_device *dev,
3491 spin_unlock_bh(&local->sta_bss_lock); 3488 spin_unlock_bh(&local->sta_bss_lock);
3492 3489
3493 if (selected) { 3490 if (selected) {
3494 ieee80211_set_freq(local, selected->freq); 3491 ieee80211_set_freq(dev, selected->freq);
3495 if (!(ifsta->flags & IEEE80211_STA_SSID_SET)) 3492 if (!(ifsta->flags & IEEE80211_STA_SSID_SET))
3496 ieee80211_sta_set_ssid(dev, selected->ssid, 3493 ieee80211_sta_set_ssid(dev, selected->ssid,
3497 selected->ssid_len); 3494 selected->ssid_len);