aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/wext-compat.c
diff options
context:
space:
mode:
authorGábor Stefanik <netrolller.3d@gmail.com>2009-07-11 20:03:48 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-07-24 15:05:12 -0400
commit323d566eae1ace41bc674863b58fcc474501a2db (patch)
treeecdaa6b134ed95896033b818120e5dcf628bd3ca /net/wireless/wext-compat.c
parent4b9631a4734e25e37c83e72c3e0ffcbb08de5791 (diff)
cfg80211: fix disabling WPA via wext (SIOCSIWAUTH)
cfg80211_set_wpa_version completely missed the use case when disabling WPA, considering IW_AUTH_WPA_VERSION_DISABLED an invalid argument. This caused weird error messages in wpa_supplicant. Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/wext-compat.c')
-rw-r--r--net/wireless/wext-compat.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/net/wireless/wext-compat.c b/net/wireless/wext-compat.c
index aa80c0c4efd4..e6731bf55062 100644
--- a/net/wireless/wext-compat.c
+++ b/net/wireless/wext-compat.c
@@ -880,9 +880,19 @@ static int cfg80211_set_wpa_version(struct wireless_dev *wdev, u32 wpa_versions)
880 wdev->wext.connect.crypto.wpa_versions = 0; 880 wdev->wext.connect.crypto.wpa_versions = 0;
881 881
882 if (wpa_versions & ~(IW_AUTH_WPA_VERSION_WPA | 882 if (wpa_versions & ~(IW_AUTH_WPA_VERSION_WPA |
883 IW_AUTH_WPA_VERSION_WPA2)) 883 IW_AUTH_WPA_VERSION_WPA2|
884 IW_AUTH_WPA_VERSION_DISABLED))
884 return -EINVAL; 885 return -EINVAL;
885 886
887 if ((wpa_versions & IW_AUTH_WPA_VERSION_DISABLED) &&
888 (wpa_versions & (IW_AUTH_WPA_VERSION_WPA|
889 IW_AUTH_WPA_VERSION_WPA2)))
890 return -EINVAL;
891
892 if (wpa_versions & IW_AUTH_WPA_VERSION_DISABLED)
893 wdev->wext.connect.crypto.wpa_versions &=
894 ~(NL80211_WPA_VERSION_1|NL80211_WPA_VERSION_2);
895
886 if (wpa_versions & IW_AUTH_WPA_VERSION_WPA) 896 if (wpa_versions & IW_AUTH_WPA_VERSION_WPA)
887 wdev->wext.connect.crypto.wpa_versions |= 897 wdev->wext.connect.crypto.wpa_versions |=
888 NL80211_WPA_VERSION_1; 898 NL80211_WPA_VERSION_1;