diff options
author | Amitkumar Karwar <akarwar@marvell.com> | 2011-04-01 21:36:46 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-04-07 15:34:12 -0400 |
commit | 2d3d0a88bd136f8e6f39bc53242712852e5d0bb2 (patch) | |
tree | 1c7f5b477ccfc20fe8a1e12c8c997a87c2bd0df5 | |
parent | f4263c9857e6411ef2388868cc6c79a1602a654e (diff) |
mwifiex: return success in set_default_key for WPA/WPA2
When testing wpa_supplicant with 'nl80211' driver to connect
to an AP with WPA/WPA2 security, we notice the followings:
1) add_key is called firstly with the key from cfg80211
2) set_defaut_key is called next
set_default_key() is specific to WEP keys and should not be
called in case of WPA/WPA2 security. The set_default_key()
won't be called if wpa_supplicant uses "-Dwext" option,
but it's been called if "-Dnl80211" option is specified.
We can fix this issue by adding a check to return from
set_default_key() if WEP key is not configured.
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Marc Yang <yangyang@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/mwifiex/cfg80211.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c index 2d9680044c12..4ac4f5a0ce61 100644 --- a/drivers/net/wireless/mwifiex/cfg80211.c +++ b/drivers/net/wireless/mwifiex/cfg80211.c | |||
@@ -228,6 +228,10 @@ mwifiex_cfg80211_set_default_key(struct wiphy *wiphy, struct net_device *netdev, | |||
228 | struct mwifiex_private *priv = mwifiex_cfg80211_get_priv(wiphy); | 228 | struct mwifiex_private *priv = mwifiex_cfg80211_get_priv(wiphy); |
229 | int ret; | 229 | int ret; |
230 | 230 | ||
231 | /* Return if WEP key not configured */ | ||
232 | if (priv->sec_info.wep_status == MWIFIEX_802_11_WEP_DISABLED) | ||
233 | return 0; | ||
234 | |||
231 | ret = mwifiex_set_encode(priv, NULL, 0, key_index, 0); | 235 | ret = mwifiex_set_encode(priv, NULL, 0, key_index, 0); |
232 | 236 | ||
233 | wiphy_dbg(wiphy, "info: set default Tx key index\n"); | 237 | wiphy_dbg(wiphy, "info: set default Tx key index\n"); |