Association broken with wpa_supplicant
Hi John,
Association is broken in latest wireless-testing when using wpa_supplicant. It tells me
Trying to associate with REAL_BSSID...
Authentication with 00:00:00:00:00:00 timed out.
The commit responsible for the breakage is
Author: Abhijeet Kolekar <[email protected]> 2008-05-09 18:35:41
Committer: John W. Linville <[email protected]> 2008-05-15 22:11:19
Parent: 6d7ef8714c227884346aebd9f4e5eea302db6d22 (hostap: fix "registers" registration in procfs)
Child: d67ec7fb2b8ce69709def2421ab893517b101591 (libertas: fix command timeout after firmware failure)
Branches: master, remotes/origin/master
Follows: master-2008-05-14
Precedes: master-2008-05-15
mac80211 : Association with 11n hidden ssid ap.
This patch fixes the association problem with 11n hidden ssid ap. Patch fixes the problem of associating with hidden ssid when all three parameters ap,essid and channel are given to iwconfig. This patch removes the condition of checking three parameters and always checks for bss in bss list while associating.
----------------------------- net/mac80211/mlme.c ----------------------------- index 7877d3b..508f675 100644
@@ -3434,13 +3434,6 @@ static int ieee80211_sta_config_auth(struct net_device *dev,
struct ieee80211_sta_bss *bss, *selected = NULL;
int top_rssi = 0, freq;
- if (!(ifsta->flags & (IEEE80211_STA_AUTO_SSID_SEL |
- IEEE80211_STA_AUTO_BSSID_SEL | IEEE80211_STA_AUTO_CHANNEL_SEL))) {
- ifsta->state = IEEE80211_AUTHENTICATE;
- ieee80211_sta_reset_auth(dev, ifsta);
- return 0;
- }
-
spin_lock_bh(&local->sta_bss_lock);
freq = local->oper_channel->center_freq; list_for_each_entry(bss, &local->sta_bss_list, list) {
Reverting this fixes the issue for me.
Signature · 1 line
Greetings Michael.
Johannes Berg
maintainerQuoted 18 lines · Michael Buesch
Hi John,
Association is broken in latest wireless-testing when using
wpa_supplicant. It tells meTrying to associate with
REAL_BSSID...
Authentication with 00:00:00:00:00:00 timed out.The commit responsible for the breakage is
Author: Abhijeet Kolekar <[email protected]> 2008-05-09 18:35:41
Committer: John W. Linville <[email protected]> 2008-05-15 22:11:19
Parent:6d7ef8714c227884346aebd9f4e5eea302db6d22(hostap: fix "registers" registration in procfs)
Child:d67ec7fb2b8ce69709def2421ab893517b101591(libertas: fix command timeout after firmware failure)
Branches: master, remotes/origin/master
Follows: master-2008-05-14
Precedes: master-2008-05-15
Quoted 1 line
mac80211 : Association with 11n hidden ssid ap.
Ok, so after knowing what breaks, I can tell you why :)
The original code looks like this:
- if (!(ifsta->flags & (IEEE80211_STA_AUTO_SSID_SEL |
- IEEE80211_STA_AUTO_BSSID_SEL | IEEE80211_STA_AUTO_CHANNEL_SEL))) {
- ifsta->state = IEEE80211_AUTHENTICATE; - ieee80211_sta_reset_auth(dev, ifsta); - return 0;
- }
spin_lock_bh(&local->sta_bss_lock);
freq = local->oper_channel->center_freq;
list_for_each_entry(bss, &local->sta_bss_list, list) {
if (!(bss->capability & WLAN_CAPABILITY_ESS))
continue;
if (!!(bss->capability & WLAN_CAPABILITY_PRIVACY) ^
!!sdata->default_key)
continue;[...]
Now, with the marked code removed, observe what will happen with the last if statement here when wpa supplicant sets all parameters (i.e. none of the auto flags are set): It will continue the loop because wpa_supplicant hasn't yet set a key, which of course, it cannot.
We cannot remove that test either because that would break regular WEP operation; we could "enhance" the test with a huge check for all the flags but I think that's stretching it.
Let's work on making cfg80211 work for this instead where we can add any number of flags for these things.
johannes
Quoted 18 lines · Michael Buesch
Hi John,
Association is broken in latest wireless-testing when using
wpa_supplicant. It tells meTrying to associate with
REAL_BSSID...
Authentication with 00:00:00:00:00:00 timed out.The commit responsible for the breakage is
Author: Abhijeet Kolekar <[email protected]> 2008-05-09 18:35:41
Committer: John W. Linville <[email protected]> 2008-05-15 22:11:19
Parent:6d7ef8714c227884346aebd9f4e5eea302db6d22(hostap: fix "registers" registration in procfs)
Child:d67ec7fb2b8ce69709def2421ab893517b101591(libertas: fix command timeout after firmware failure)
Branches: master, remotes/origin/master
Follows: master-2008-05-14
Precedes: master-2008-05-15
Quoted 1 line
mac80211 : Association with 11n hidden ssid ap.
Instead of reverting it, could you try applying this one on top of it?
net/mac80211/mlme.c +5 -2
@@ -3440,8 +3440,11 @@ static int ieee80211_sta_config_auth(struct net_device *dev,if (!(bss->capability &WLAN_CAPABILITY_ESS ))continue ; -if (!!(bss->capability &WLAN_CAPABILITY_PRIVACY ) ^ - !!sdata->default_key) +if ((ifsta->flags & (IEEE80211_STA_AUTO_SSID_SEL | +IEEE80211_STA_AUTO_BSSID_SEL | +IEEE80211_STA_AUTO_CHANNEL_SEL )) && + (!!(bss->capability &WLAN_CAPABILITY_PRIVACY ) ^ + !!sdata->default_key))continue ; if (!(ifsta->flags & IEEE80211_STA_AUTO_CHANNEL_SEL) &&
Signature · 2 lines
John W. Linville [email protected]
Quoted 10 lines · On Friday 16 May 2008 16:58:32 John W. Linville wrote:
Instead of reverting it, could you try applying this one on top of it?
net/mac80211/mlme.c +0
-0@@ -3440,8 +3440,11 @@ static int ieee80211_sta_config_auth(struct net_device *dev,if (!(bss->capability &WLAN_CAPABILITY_ESS ))continue ;
net/mac80211/mlme.c static int ieee80211_sta_config_auth(struct net_device *dev, · line 3450
Quoted 10 lines
net/mac80211/mlme.c +5
-2-if (!!(bss->capability &WLAN_CAPABILITY_PRIVACY ) ^ - !!sdata->default_key) +if ((ifsta->flags & (IEEE80211_STA_AUTO_SSID_SEL | +IEEE80211_STA_AUTO_BSSID_SEL | +IEEE80211_STA_AUTO_CHANNEL_SEL )) && + (!!(bss->capability &WLAN_CAPABILITY_PRIVACY ) ^ + !!sdata->default_key))continue ; if (!(ifsta->flags & IEEE80211_STA_AUTO_CHANNEL_SEL) &&
This patch fixes the bug for me.
Signature · 1 line
Greetings Michael.
This patch fixes the problem for me too.
Abhi
-----Original Message-----
From: Michael Buesch [mailto:[email protected]]
Sent: Friday, May 16, 2008 11:16 AM
To: John W. Linville
Cc: Kolekar, Abhijeet; [email protected]; Johannes Berg
Subject: Re: Association broken with wpa_supplicant
net/mac80211/mlme.c static int ieee80211_sta_config_auth(struct
Quoted 7 lines · On Friday 16 May 2008 16:58:32 John W. Linville wrote:
Instead of reverting it, could you try applying this one on top of it?
net/mac80211/mlme.c +0
-0@@ -3440,8 +3440,11 @@ static int ieee80211_sta_config_auth(struct
net_device *dev,
net/mac80211/mlme.c static int ieee80211_sta_config_auth(struct net_device *dev, · line 3450
Quoted 13 lines
net/mac80211/mlme.c +5
-2if (!(bss->capability &WLAN_CAPABILITY_ESS ))continue ; -if (!!(bss->capability &WLAN_CAPABILITY_PRIVACY ) ^ - !!sdata->default_key) +if ((ifsta->flags & (IEEE80211_STA_AUTO_SSID_SEL | +IEEE80211_STA_AUTO_BSSID_SEL | +IEEE80211_STA_AUTO_CHANNEL_SEL )) && + (!!(bss->capability &WLAN_CAPABILITY_PRIVACY ) ^ + !!sdata->default_key))continue ; if (!(ifsta->flags & IEEE80211_STA_AUTO_CHANNEL_SEL) &&
This patch fixes the bug for me.
Signature · 1 line
Greetings Michael.