linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Association broken with wpa_supplicant
@ 2008-05-15 22:30 Michael Buesch
  2008-05-16 14:57 ` Johannes Berg
  2008-05-16 14:58 ` John W. Linville
  0 siblings, 2 replies; 7+ messages in thread
From: Michael Buesch @ 2008-05-15 22:30 UTC (permalink / raw)
  To: John Linville; +Cc: Abhijeet Kolekar, linux-wireless, Johannes Berg

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 <abhijeet.kolekar@intel.com>  2008-05-09 18:35:41
Committer: John W. Linville <linville@tuxdriver.com>  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.
    
    Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
    Signed-off-by: John W. Linville <linville@tuxdriver.com>

----------------------------- 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.

-- 
Greetings Michael.

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

* Association broken with wpa_supplicant
@ 2008-05-16  7:31 Ronald
  2008-05-16  8:19 ` Johannes Berg
  0 siblings, 1 reply; 7+ messages in thread
From: Ronald @ 2008-05-16  7:31 UTC (permalink / raw)
  To: linux-wireless

I'm not using the latest wireless (2.6.25) but I also have trouble using 
wpa_supplicant (same error as you). After *a lot* of trying, I figured 
this out, to associate I do this:

/sbin/wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf.2 -B
/bin/sleep 5
/usr/bin/killall wpa_supplicant
/sbin/wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf -B
/bin/sleep 5
/sbin/ifconfig wlan0 192.168.2.252 netmask 255.255.255.248
/sbin/route add default gw 192.168.2.254

The contents of wpa_supplicant.conf.2 is:

ctrl_interface=/var/run/wpa_supplicant

ap_scan=2
fast_reauth=0

network={
	bssid=00:1B:2F:A9:48:E8
	ssid="Chimera"
	psk="<<scrubbed>>"
	key_mgmt=WPA-PSK
	proto=WPA2
	pairwise=CCMP
}


The contents of wpa_supplicant.conf is:

ctrl_interface=/var/run/wpa_supplicant

ap_scan=1
fast_reauth=0

network={
	bssid=00:1B:2F:A9:48:E8
	ssid="Chimera"
	psk="<<scrubbed>>"
	key_mgmt=WPA-PSK
	proto=WPA2
	pairwise=CCMP
}

Trying to associate directly with only wpa_supplicant.conf won't work, 
*only* after I used wpa_supplicant.conf.2. Furthermore, I never made a 
bugreport as I thought that it would be an error in wpa_supplicant...

I hope this helps you in any way =)

						Ronald

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

* Re: Association broken with wpa_supplicant
  2008-05-16  7:31 Ronald
@ 2008-05-16  8:19 ` Johannes Berg
  0 siblings, 0 replies; 7+ messages in thread
From: Johannes Berg @ 2008-05-16  8:19 UTC (permalink / raw)
  To: ronald645; +Cc: linux-wireless

[-- Attachment #1: Type: text/plain, Size: 719 bytes --]

On Fri, 2008-05-16 at 09:31 +0200, Ronald wrote:
> I'm not using the latest wireless (2.6.25) but I also have trouble using 
> wpa_supplicant (same error as you). After *a lot* of trying, I figured 
> this out, to associate I do this:

> ap_scan=2

> ap_scan=1

> Trying to associate directly with only wpa_supplicant.conf won't work, 
> *only* after I used wpa_supplicant.conf.2. Furthermore, I never made a 
> bugreport as I thought that it would be an error in wpa_supplicant...
> 
> I hope this helps you in any way =)

This is probably the same bug Michael reported already. If it hadn't
been, I most likely would have ignored your email due to lack of kernel
logs and information :)

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

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

* Re: Association broken with wpa_supplicant
  2008-05-15 22:30 Association broken with wpa_supplicant Michael Buesch
@ 2008-05-16 14:57 ` Johannes Berg
  2008-05-16 14:58 ` John W. Linville
  1 sibling, 0 replies; 7+ messages in thread
From: Johannes Berg @ 2008-05-16 14:57 UTC (permalink / raw)
  To: Michael Buesch; +Cc: John Linville, Abhijeet Kolekar, linux-wireless

[-- Attachment #1: Type: text/plain, Size: 2245 bytes --]

On Fri, 2008-05-16 at 00:30 +0200, Michael Buesch wrote:
> 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 <abhijeet.kolekar@intel.com>  2008-05-09 18:35:41
> Committer: John W. Linville <linville@tuxdriver.com>  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.

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

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

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

* Re: Association broken with wpa_supplicant
  2008-05-15 22:30 Association broken with wpa_supplicant Michael Buesch
  2008-05-16 14:57 ` Johannes Berg
@ 2008-05-16 14:58 ` John W. Linville
  2008-05-16 18:16   ` Michael Buesch
  1 sibling, 1 reply; 7+ messages in thread
From: John W. Linville @ 2008-05-16 14:58 UTC (permalink / raw)
  To: Michael Buesch; +Cc: Abhijeet Kolekar, linux-wireless, Johannes Berg

On Fri, May 16, 2008 at 12:30:10AM +0200, Michael Buesch wrote:
> 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 <abhijeet.kolekar@intel.com>  2008-05-09 18:35:41
> Committer: John W. Linville <linville@tuxdriver.com>  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.

Instead of reverting it, could you try applying this one on top of it?

diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 508f675..76ad4ed 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -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) &&
-- 
John W. Linville
linville@tuxdriver.com

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

* Re: Association broken with wpa_supplicant
  2008-05-16 14:58 ` John W. Linville
@ 2008-05-16 18:16   ` Michael Buesch
  2008-05-16 18:19     ` Kolekar, Abhijeet
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Buesch @ 2008-05-16 18:16 UTC (permalink / raw)
  To: John W. Linville; +Cc: Abhijeet Kolekar, linux-wireless, Johannes Berg

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?
> 
> diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
> index 508f675..76ad4ed 100644
> --- a/net/mac80211/mlme.c
> +++ b/net/mac80211/mlme.c
> @@ -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) &&


This patch fixes the bug for me.

-- 
Greetings Michael.

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

* RE: Association broken with wpa_supplicant
  2008-05-16 18:16   ` Michael Buesch
@ 2008-05-16 18:19     ` Kolekar, Abhijeet
  0 siblings, 0 replies; 7+ messages in thread
From: Kolekar, Abhijeet @ 2008-05-16 18:19 UTC (permalink / raw)
  To: Michael Buesch, John W. Linville; +Cc: linux-wireless, Johannes Berg

This patch fixes the problem for me too.
Abhi

-----Original Message-----
From: Michael Buesch [mailto:mb@bu3sch.de] 
Sent: Friday, May 16, 2008 11:16 AM
To: John W. Linville
Cc: Kolekar, Abhijeet; linux-wireless@vger.kernel.org; Johannes Berg
Subject: Re: Association broken with wpa_supplicant

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?
> 
> diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
> index 508f675..76ad4ed 100644
> --- a/net/mac80211/mlme.c
> +++ b/net/mac80211/mlme.c
> @@ -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) &&


This patch fixes the bug for me.

-- 
Greetings Michael.

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

end of thread, other threads:[~2008-05-16 18:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-15 22:30 Association broken with wpa_supplicant Michael Buesch
2008-05-16 14:57 ` Johannes Berg
2008-05-16 14:58 ` John W. Linville
2008-05-16 18:16   ` Michael Buesch
2008-05-16 18:19     ` Kolekar, Abhijeet
  -- strict thread matches above, loose matches on Subject: below --
2008-05-16  7:31 Ronald
2008-05-16  8:19 ` 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).