nl80211: really allow client-only BIGTK support
authorJohannes Berg <johannes.berg@intel.com>
Thu, 28 May 2020 19:34:24 +0000 (21:34 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Sun, 31 May 2020 09:26:05 +0000 (11:26 +0200)
My previous commit here was wrong, it didn't check the new
flag in two necessary places, so things didn't work. Fix that.

Fixes: 155d7c733807 ("nl80211: allow client-only BIGTK support")
Link: https://lore.kernel.org/r/20200528213443.993f108e96ca.I0086ae42d672379380d04ac5effb2f3d5135731b@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/sme.c
net/wireless/util.c

index 3554c0d951f4a0ac9ac1b0dc738e2c1f6a4f5ec2..15595cf401de5b02569b01d0906281aa40540faa 100644 (file)
@@ -5,7 +5,7 @@
  * (for nl80211's connect() and wext)
  *
  * Copyright 2009      Johannes Berg <johannes@sipsolutions.net>
- * Copyright (C) 2009   Intel Corporation. All rights reserved.
+ * Copyright (C) 2009, 2020 Intel Corporation. All rights reserved.
  * Copyright 2017      Intel Deutschland GmbH
  */
 
@@ -1118,7 +1118,10 @@ void __cfg80211_disconnected(struct net_device *dev, const u8 *ie,
 
                if (wiphy_ext_feature_isset(
                            wdev->wiphy,
-                           NL80211_EXT_FEATURE_BEACON_PROTECTION))
+                           NL80211_EXT_FEATURE_BEACON_PROTECTION) ||
+                   wiphy_ext_feature_isset(
+                           wdev->wiphy,
+                           NL80211_EXT_FEATURE_BEACON_PROTECTION_CLIENT))
                        max_key_idx = 7;
                for (i = 0; i <= max_key_idx; i++)
                        rdev_del_key(rdev, dev, i, false, NULL);
index a27d4f45fb5f48884a9def3e87e690f194d00dba..4d3b76f94f55ef064ebe3d0d356429a8477c229b 100644 (file)
@@ -242,7 +242,9 @@ int cfg80211_validate_key_settings(struct cfg80211_registered_device *rdev,
        int max_key_idx = 5;
 
        if (wiphy_ext_feature_isset(&rdev->wiphy,
-                                   NL80211_EXT_FEATURE_BEACON_PROTECTION))
+                                   NL80211_EXT_FEATURE_BEACON_PROTECTION) ||
+           wiphy_ext_feature_isset(&rdev->wiphy,
+                                   NL80211_EXT_FEATURE_BEACON_PROTECTION_CLIENT))
                max_key_idx = 7;
        if (key_idx < 0 || key_idx > max_key_idx)
                return -EINVAL;