summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2016-10-21 14:25:12 +0200
committerJohannes Berg <johannes.berg@intel.com>2016-10-27 09:08:45 +0200
commit56271da29c52adb67a9e59117cfdc5a2c4902a07 (patch)
tree30657b66739efee77c3c303e8b5d5dce589fe913 /net
parent275fcf62c289d52f0fc14d774ab176c0d6196171 (diff)
downloadop-kernel-dev-56271da29c52adb67a9e59117cfdc5a2c4902a07.zip
op-kernel-dev-56271da29c52adb67a9e59117cfdc5a2c4902a07.tar.gz
cfg80211: disallow beacon_int_min_gcd with IBSS
This can't really be supported right now, because the IBSS interface may change its beacon interval at any time due to joining another network; thus, there's already "support" for different beacon intervals here, implicitly. Until we figure out how we should handle this case (continue to allow it to arbitrarily join? Join only if compatible?) disallow advertising that different beacon intervals are supported if IBSS is allowed. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net')
-rw-r--r--net/wireless/core.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/net/wireless/core.c b/net/wireless/core.c
index 725adff..158c59e 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -562,6 +562,21 @@ static int wiphy_verify_combinations(struct wiphy *wiphy)
c->limits[j].max > 1))
return -EINVAL;
+ /*
+ * This isn't well-defined right now. If you have an
+ * IBSS interface, then its beacon interval may change
+ * by joining other networks, and nothing prevents it
+ * from doing that.
+ * So technically we probably shouldn't even allow AP
+ * and IBSS in the same interface, but it seems that
+ * some drivers support that, possibly only with fixed
+ * beacon intervals for IBSS.
+ */
+ if (WARN_ON(types & BIT(NL80211_IFTYPE_ADHOC) &&
+ c->beacon_int_min_gcd)) {
+ return -EINVAL;
+ }
+
cnt += c->limits[j].max;
/*
* Don't advertise an unsupported type
OpenPOWER on IntegriCloud