diff mbox

cfg80211: clear SSID on disconnect

Message ID 1249311832.4561.2.camel@johannes.local (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Johannes Berg Aug. 3, 2009, 3:03 p.m. UTC
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(+)



--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Joerg Albert Aug. 4, 2009, 6:55 a.m. UTC | #1
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.



--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Johannes Berg Aug. 4, 2009, 7:13 a.m. UTC | #2
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
Joerg Albert Aug. 4, 2009, 8:24 a.m. UTC | #3
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. 



--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Johannes Berg Aug. 4, 2009, 12:26 p.m. UTC | #4
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
Joerg Albert Aug. 4, 2009, 10:29 p.m. UTC | #5
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

--- 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);