cfg80211: set_default_key only for WEP
authorZhu Yi <yi.zhu@intel.com>
Mon, 20 Jul 2009 03:47:43 +0000 (11:47 +0800)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 24 Jul 2009 19:05:27 +0000 (15:05 -0400)
We invoke the cfg80211 set_default_key callback only for WEP key
configuring.

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/wireless/wext-compat.c

index e6731bf..c7351a9 100644 (file)
@@ -531,7 +531,8 @@ static int __cfg80211_set_encryption(struct cfg80211_registered_device *rdev,
                        wdev->wext.keys->data[idx];
        }
 
-       if (params->cipher != WLAN_CIPHER_SUITE_AES_CMAC &&
+       if ((params->cipher == WLAN_CIPHER_SUITE_WEP40 ||
+            params->cipher == WLAN_CIPHER_SUITE_WEP104) &&
            (tx_key || (!addr && wdev->wext.default_key == -1))) {
                if (wdev->current_bss)
                        err = rdev->ops->set_default_key(&rdev->wiphy,