Skip to contentSkip to conversation

cfg80211: don't set privacy w/o key

PATCH In review Johannes Berg 3 participants 3 messages Sep 24, 2009 802.11 (including cfg80211/NL80211)

lore
Share & tools
lore

Johannes Berg

author maintainer
#0 lore raw

PATCH 1/1 cfg80211: don't set privacy w/o key

When wpa_supplicant is used to connect to open networks, it causes the wdev->wext.keys to point to key memory, but that key memory is all empty. Only use privacy when there is a default key to be used.

---
Never happened of course with iw ...

 net/wireless/wext-sme.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
net/wireless/wext-sme.c +2 -1
@@ -30,7 +30,8 @@ int cfg80211_mgd_wext_connect(struct cfg
 	if (wdev->wext.keys) {
 		wdev->wext.keys->def = wdev->wext.default_key;
 		wdev->wext.keys->defmgmt = wdev->wext.default_mgmt_key;
-		wdev->wext.connect.privacy = true;
+		if (wdev->wext.default_key != -1)
+			wdev->wext.connect.privacy = true;
 	}
 
 	if (!wdev->wext.connect.ssid_len)
Tested-by on v1 1/1
#2 lore raw
In reply to Johannes Berg
Quoted 6 lines · Johannes Berg

When wpa_supplicant is used to connect to open networks, it causes the wdev->wext.keys to point to key memory, but that key memory is all empty. Only use privacy when there is a default key to be used.

Thanks, this fixes the issue I reported yesterday evening.

Quoted 1 line

Never happened of course with iw ...

This is just the reason why I still use stock wpa_supplicant from debian :)

Kalle