diff options
author | Johannes Berg <johannes.berg@intel.com> | 2016-09-13 16:11:32 +0200 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2016-09-13 20:20:52 +0200 |
commit | 9381e267b69acfea96c8429dc99da3e78835cef1 (patch) | |
tree | ad1fc4dc1f1b284a760d906316e718f8ac7f54b9 /net/wireless/wext-compat.c | |
parent | nl80211: only allow WEP keys during connect command (diff) | |
download | linux-9381e267b69acfea96c8429dc99da3e78835cef1.tar.xz linux-9381e267b69acfea96c8429dc99da3e78835cef1.zip |
cfg80211: wext: only allow WEP keys to be configured before connected
When not connected, anything but WEP keys shouldn't be allowed to be
configured for later - only static WEP keys make sense at this point.
Change wext to reject anything else just like nl80211 does.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/wext-compat.c')
-rw-r--r-- | net/wireless/wext-compat.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/wireless/wext-compat.c b/net/wireless/wext-compat.c index 9f27221c8913..e45a76449b43 100644 --- a/net/wireless/wext-compat.c +++ b/net/wireless/wext-compat.c @@ -487,6 +487,9 @@ static int __cfg80211_set_encryption(struct cfg80211_registered_device *rdev, err = 0; if (wdev->current_bss) err = rdev_add_key(rdev, dev, idx, pairwise, addr, params); + else if (params->cipher != WLAN_CIPHER_SUITE_WEP40 && + params->cipher != WLAN_CIPHER_SUITE_WEP104) + return -EINVAL; if (err) return err; |