linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] mwifiex: return success in set_default_key for WPA/WPA2
@ 2011-04-02  1:36 Bing Zhao
  2011-04-02  1:36 ` [PATCH 2/2] mwifiex: remove redundant encryption_mode mapping Bing Zhao
  2011-04-03  8:02 ` [PATCH 1/2] mwifiex: return success in set_default_key for WPA/WPA2 Johannes Berg
  0 siblings, 2 replies; 8+ messages in thread
From: Bing Zhao @ 2011-04-02  1:36 UTC (permalink / raw)
  To: linux-wireless
  Cc: John W. Linville, Johannes Berg, Amitkumar Karwar, Kiran Divekar,
	Yogesh Powar, Marc Yang, Frank Huang, Bing Zhao

From: Amitkumar Karwar <akarwar@marvell.com>

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>
---
 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 2d96800..4ac4f5a 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,
 	struct mwifiex_private *priv = mwifiex_cfg80211_get_priv(wiphy);
 	int ret;
 
+	/* Return if WEP key not configured */
+	if (priv->sec_info.wep_status == MWIFIEX_802_11_WEP_DISABLED)
+		return 0;
+
 	ret = mwifiex_set_encode(priv, NULL, 0, key_index, 0);
 
 	wiphy_dbg(wiphy, "info: set default Tx key index\n");
-- 
1.7.0.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-04-06  7:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-02  1:36 [PATCH 1/2] mwifiex: return success in set_default_key for WPA/WPA2 Bing Zhao
2011-04-02  1:36 ` [PATCH 2/2] mwifiex: remove redundant encryption_mode mapping Bing Zhao
2011-04-03  8:02 ` [PATCH 1/2] mwifiex: return success in set_default_key for WPA/WPA2 Johannes Berg
2011-04-03  8:37   ` Johannes Berg
2011-04-05 18:45     ` Bing Zhao
2011-04-05 18:53       ` Johannes Berg
2011-04-05 23:22         ` Bing Zhao
2011-04-06  7:08           ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).