diff options
author | Purushottam Kushwaha <pkushwah@qti.qualcomm.com> | 2016-08-11 11:44:02 +0200 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2016-08-11 20:00:36 +0200 |
commit | 12d20fc9186a742d40e824f575df5aa62be31d69 (patch) | |
tree | 1bfd787bfc2d85e6739541e76bbedafdfe2a6e7a /net/wireless/nl80211.c | |
parent | cfg80211: always notify userspace when wireless netdev is removed (diff) | |
download | linux-12d20fc9186a742d40e824f575df5aa62be31d69.tar.xz linux-12d20fc9186a742d40e824f575df5aa62be31d69.zip |
cfg80211: identically validate beacon interval for AP/MESH/IBSS
Beacon interval interface combinations validation was missing
for MESH/IBSS join, add those.
Johannes: also move the beacon interval check disallowing really
tiny and really big intervals into the common function, which
adds it for AP mode.
Signed-off-by: Purushottam Kushwaha <pkushwah@qti.qualcomm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/nl80211.c')
-rw-r--r-- | net/wireless/nl80211.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 0560870fc69d..d36c40a4d832 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -7752,12 +7752,13 @@ static int nl80211_join_ibss(struct sk_buff *skb, struct genl_info *info) ibss.beacon_interval = 100; - if (info->attrs[NL80211_ATTR_BEACON_INTERVAL]) { + if (info->attrs[NL80211_ATTR_BEACON_INTERVAL]) ibss.beacon_interval = nla_get_u32(info->attrs[NL80211_ATTR_BEACON_INTERVAL]); - if (ibss.beacon_interval < 1 || ibss.beacon_interval > 10000) - return -EINVAL; - } + + err = cfg80211_validate_beacon_int(rdev, ibss.beacon_interval); + if (err) + return err; if (!rdev->ops->join_ibss) return -EOPNOTSUPP; @@ -9231,9 +9232,10 @@ static int nl80211_join_mesh(struct sk_buff *skb, struct genl_info *info) if (info->attrs[NL80211_ATTR_BEACON_INTERVAL]) { setup.beacon_interval = nla_get_u32(info->attrs[NL80211_ATTR_BEACON_INTERVAL]); - if (setup.beacon_interval < 10 || - setup.beacon_interval > 10000) - return -EINVAL; + + err = cfg80211_validate_beacon_int(rdev, setup.beacon_interval); + if (err) + return err; } if (info->attrs[NL80211_ATTR_DTIM_PERIOD]) { |