summaryrefslogtreecommitdiff
path: root/net/wireless
diff options
context:
space:
mode:
authorArik Nemtsov <arik@wizery.com>2014-12-03 18:08:17 +0200
committerJohannes Berg <johannes.berg@intel.com>2014-12-12 13:40:38 +0100
commit185076d6db7b0320fd7669732923179f9a4d068b (patch)
tree9d2dfdae41a585d8b9f7bbe9b91ac3ae1d8f0bc3 /net/wireless
parent70dcec5a488a7b81779190ac8089475fe4b8b962 (diff)
cfg80211: correctly check ad-hoc channels
Ad-hoc requires beaconing for regulatory purposes. Validate that the channel is valid for beaconing, and not only enabled. Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com> Reviewed-by: Luis R. Rodriguez <mcgrof@suse.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless')
-rw-r--r--net/wireless/reg.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index c9f5ad5d5d94..7b8309840d4e 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -1549,9 +1549,15 @@ static bool reg_wdev_chan_valid(struct wiphy *wiphy, struct wireless_dev *wdev)
ret = cfg80211_reg_can_beacon(wiphy,
&wdev->chandef, wdev->iftype);
break;
+ case NL80211_IFTYPE_ADHOC:
+ if (!wdev->ssid_len)
+ goto out;
+
+ ret = cfg80211_reg_can_beacon(wiphy,
+ &wdev->chandef, wdev->iftype);
+ break;
case NL80211_IFTYPE_STATION:
case NL80211_IFTYPE_P2P_CLIENT:
- case NL80211_IFTYPE_ADHOC:
if (!wdev->current_bss ||
!wdev->current_bss->pub.channel)
goto out;