linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cfg80211: clear SSID on disconnect
@ 2009-08-03 15:03 Johannes Berg
  2009-08-04  6:55 ` Joerg Albert
  2009-08-04  7:32 ` [PATCH v2] cfg80211: clear SSID on disconnect/no connection Johannes Berg
  0 siblings, 2 replies; 7+ messages in thread
From: Johannes Berg @ 2009-08-03 15:03 UTC (permalink / raw)
  To: John Linville; +Cc: Joerg Albert, linux-wireless

The SME state machine in cfg80211 uses the SSID stored
in struct wireless_dev internally, but fails to clear
it when disconnecting. This doesn't matter to the SME
state machine, but does matter for IBSS. Thus, when
disconnecting, clear the SSID to avoid messing up the
IBSS state machine.

Reported-by: Joerg Albert <jal2@gmx.de>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 net/wireless/sme.c |    1 +
 1 file changed, 1 insertion(+)

--- wireless-testing.orig/net/wireless/sme.c	2009-08-03 16:45:01.000000000 +0200
+++ wireless-testing/net/wireless/sme.c	2009-08-03 16:59:02.000000000 +0200
@@ -550,6 +550,7 @@ void __cfg80211_disconnected(struct net_
 
 	wdev->current_bss = NULL;
 	wdev->sme_state = CFG80211_SME_IDLE;
+	wdev->ssid_len = 0;
 
 	if (wdev->conn) {
 		kfree(wdev->conn->ie);



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

* Re: [PATCH] cfg80211: clear SSID on disconnect
  2009-08-03 15:03 [PATCH] cfg80211: clear SSID on disconnect Johannes Berg
@ 2009-08-04  6:55 ` Joerg Albert
  2009-08-04  7:13   ` Johannes Berg
  2009-08-04  7:32 ` [PATCH v2] cfg80211: clear SSID on disconnect/no connection Johannes Berg
  1 sibling, 1 reply; 7+ messages in thread
From: Joerg Albert @ 2009-08-04  6:55 UTC (permalink / raw)
  To: linux-wireless

Johannes Berg <johannes@...> writes:


>  	wdev->current_bss = NULL;
>  	wdev->sme_state = CFG80211_SME_IDLE;
> +	wdev->ssid_len = 0;
> 
>  	if (wdev->conn) {
>  		kfree(wdev->conn->ie);

Sorry, but this didn't help with the ar9170 problem. I still get a call
to  ar9170_op_bss_info_changed() after ifconfig wlan1 down.
I put a printk at your change in sme.c and it's not called.

Please be aware that in managed mode my adapter stays in state SCANNING, 'cause
there is not AP around with essid huhu_m:

ifconfig wlan1 up
iwconfig wlan1 essid huhu_m
ifconfig wlan1 down
iwconfig wlan1 mode ad-hoc essid huhu_a channel 1
/* ar9170_op_bss_info_changed() is called with ar->vif == NULL */

Regards,
Jörg.




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

* Re: [PATCH] cfg80211: clear SSID on disconnect
  2009-08-04  6:55 ` Joerg Albert
@ 2009-08-04  7:13   ` Johannes Berg
  2009-08-04  8:24     ` Joerg Albert
  0 siblings, 1 reply; 7+ messages in thread
From: Johannes Berg @ 2009-08-04  7:13 UTC (permalink / raw)
  To: Joerg Albert; +Cc: linux-wireless

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

On Tue, 2009-08-04 at 06:55 +0000, Joerg Albert wrote:

> Sorry, but this didn't help with the ar9170 problem. I still get a call
> to  ar9170_op_bss_info_changed() after ifconfig wlan1 down.
> I put a printk at your change in sme.c and it's not called.
> 
> Please be aware that in managed mode my adapter stays in state SCANNING, 'cause
> there is not AP around with essid huhu_m:

Aha. yes, the same assignment is _also_ missing in
__cfg80211_connect_result(), can you add it there manually (in the
status != WLAN_STATUS_SUCCESS block at the end) and see what happens?

johannes

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

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

* [PATCH v2] cfg80211: clear SSID on disconnect/no connection
  2009-08-03 15:03 [PATCH] cfg80211: clear SSID on disconnect Johannes Berg
  2009-08-04  6:55 ` Joerg Albert
@ 2009-08-04  7:32 ` Johannes Berg
  1 sibling, 0 replies; 7+ messages in thread
From: Johannes Berg @ 2009-08-04  7:32 UTC (permalink / raw)
  To: John Linville; +Cc: Joerg Albert, linux-wireless

The SME state machine in cfg80211 uses the SSID stored
in struct wireless_dev internally, but fails to clear
it in multiple places (when giving up on a connection
attempt and when disconnecting). This doesn't matter to
the SME state machine, but does matter for IBSS. Thus,
in those cases, clear the SSID to avoid messing up the
IBSS state machine.

Reported-by: Joerg Albert <jal2@gmx.de>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 net/wireless/sme.c |    4 ++++
 1 file changed, 4 insertions(+)

--- wireless-testing.orig/net/wireless/sme.c	2009-08-03 23:12:36.000000000 +0200
+++ wireless-testing/net/wireless/sme.c	2009-08-04 09:28:16.000000000 +0200
@@ -383,6 +383,7 @@ void __cfg80211_connect_result(struct ne
 		wdev->conn = NULL;
 		kfree(wdev->connect_keys);
 		wdev->connect_keys = NULL;
+		wdev->ssid_len = 0;
 		return;
 	}
 
@@ -550,6 +551,7 @@ void __cfg80211_disconnected(struct net_
 
 	wdev->current_bss = NULL;
 	wdev->sme_state = CFG80211_SME_IDLE;
+	wdev->ssid_len = 0;
 
 	if (wdev->conn) {
 		kfree(wdev->conn->ie);
@@ -705,6 +707,7 @@ int __cfg80211_connect(struct cfg80211_r
 			wdev->conn = NULL;
 			wdev->sme_state = CFG80211_SME_IDLE;
 			wdev->connect_keys = NULL;
+			wdev->ssid_len = 0;
 		}
 
 		return err;
@@ -769,6 +772,7 @@ int __cfg80211_disconnect(struct cfg8021
 			wdev->sme_state = CFG80211_SME_IDLE;
 			kfree(wdev->conn);
 			wdev->conn = NULL;
+			wdev->ssid_len = 0;
 			return 0;
 		}
 



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

* Re: [PATCH] cfg80211: clear SSID on disconnect
  2009-08-04  7:13   ` Johannes Berg
@ 2009-08-04  8:24     ` Joerg Albert
  2009-08-04 12:26       ` Johannes Berg
  0 siblings, 1 reply; 7+ messages in thread
From: Joerg Albert @ 2009-08-04  8:24 UTC (permalink / raw)
  To: linux-wireless

Johannes Berg <johannes@...> writes:


 
> Aha. yes, the same assignment is _also_ missing in
> __cfg80211_connect_result(), can you add it there manually (in the
> status != WLAN_STATUS_SUCCESS block at the end) and see what happens?

Yes, that helped in my case.

Thanks,
Jörg. 




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

* Re: [PATCH] cfg80211: clear SSID on disconnect
  2009-08-04  8:24     ` Joerg Albert
@ 2009-08-04 12:26       ` Johannes Berg
  2009-08-04 22:29         ` Joerg Albert
  0 siblings, 1 reply; 7+ messages in thread
From: Johannes Berg @ 2009-08-04 12:26 UTC (permalink / raw)
  To: Joerg Albert; +Cc: linux-wireless

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

On Tue, 2009-08-04 at 08:24 +0000, Joerg Albert wrote:
> Johannes Berg <johannes@...> writes:
> 
> 
>  
> > Aha. yes, the same assignment is _also_ missing in
> > __cfg80211_connect_result(), can you add it there manually (in the
> > status != WLAN_STATUS_SUCCESS block at the end) and see what happens?
> 
> Yes, that helped in my case.

The v2 patch I posted to this thread should fix the issue then, and also
fix two more places where it could occur.

johannes

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

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

* Re: [PATCH] cfg80211: clear SSID on disconnect
  2009-08-04 12:26       ` Johannes Berg
@ 2009-08-04 22:29         ` Joerg Albert
  0 siblings, 0 replies; 7+ messages in thread
From: Joerg Albert @ 2009-08-04 22:29 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless

On 08/04/2009 02:26 PM, Johannes Berg wrote:
> On Tue, 2009-08-04 at 08:24 +0000, Joerg Albert wrote:
>> Johannes Berg <johannes@...> writes:
>>
>>
>>  
>>> Aha. yes, the same assignment is _also_ missing in
>>> __cfg80211_connect_result(), can you add it there manually (in the
>>> status != WLAN_STATUS_SUCCESS block at the end) and see what happens?
>> Yes, that helped in my case.
> 
> The v2 patch I posted to this thread should fix the issue then, and also
> fix two more places where it could occur.

Yes, the v2 patch worked well, too.

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

end of thread, other threads:[~2009-08-04 22:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-03 15:03 [PATCH] cfg80211: clear SSID on disconnect Johannes Berg
2009-08-04  6:55 ` Joerg Albert
2009-08-04  7:13   ` Johannes Berg
2009-08-04  8:24     ` Joerg Albert
2009-08-04 12:26       ` Johannes Berg
2009-08-04 22:29         ` Joerg Albert
2009-08-04  7:32 ` [PATCH v2] cfg80211: clear SSID on disconnect/no connection 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).