diff options
author | Arik Nemtsov <arik@wizery.com> | 2014-12-03 11:08:17 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2014-12-12 07:40:38 -0500 |
commit | 185076d6db7b0320fd7669732923179f9a4d068b (patch) | |
tree | 9d2dfdae41a585d8b9f7bbe9b91ac3ae1d8f0bc3 /net | |
parent | 70dcec5a488a7b81779190ac8089475fe4b8b962 (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')
-rw-r--r-- | net/wireless/reg.c | 8 |
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) | |||
1549 | ret = cfg80211_reg_can_beacon(wiphy, | 1549 | ret = cfg80211_reg_can_beacon(wiphy, |
1550 | &wdev->chandef, wdev->iftype); | 1550 | &wdev->chandef, wdev->iftype); |
1551 | break; | 1551 | break; |
1552 | case NL80211_IFTYPE_ADHOC: | ||
1553 | if (!wdev->ssid_len) | ||
1554 | goto out; | ||
1555 | |||
1556 | ret = cfg80211_reg_can_beacon(wiphy, | ||
1557 | &wdev->chandef, wdev->iftype); | ||
1558 | break; | ||
1552 | case NL80211_IFTYPE_STATION: | 1559 | case NL80211_IFTYPE_STATION: |
1553 | case NL80211_IFTYPE_P2P_CLIENT: | 1560 | case NL80211_IFTYPE_P2P_CLIENT: |
1554 | case NL80211_IFTYPE_ADHOC: | ||
1555 | if (!wdev->current_bss || | 1561 | if (!wdev->current_bss || |
1556 | !wdev->current_bss->pub.channel) | 1562 | !wdev->current_bss->pub.channel) |
1557 | goto out; | 1563 | goto out; |