cfg80211: clear SSID on disconnect
Johannes Berg
maintainerPATCH 1/1 cfg80211: clear SSID on disconnect
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.
--- net/wireless/sme.c | 1 + 1 file changed, 1 insertion(+)
net/wireless/sme.c +1 -0
@@ -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);
net/wireless/sme.c void __cfg80211_disconnected(struct net_ · line 556
Quoted 6 lines · Johannes Berg
net/wireless/sme.c +1
-0wdev->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.
Johannes Berg
maintainerQuoted 6 lines · Joerg Albert
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 insme.cand 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
Quoted 3 lines · Johannes Berg
Aha. yes, the same assignment is _also_ missing in
__cfg80211_connect_result(), can you add it there manually (in the status !=WLAN_STATUS_SUCCESSblock at the end) and see what happens?
Yes, that helped in my case.
Thanks,
Jörg.
Johannes Berg
maintainerQuoted 9 lines · Joerg Albert
Quoted 3 lines · Johannes Berg
Aha. yes, the same assignment is _also_ missing in
__cfg80211_connect_result(), can you add it there manually (in the status !=WLAN_STATUS_SUCCESSblock 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
Quoted 5 lines · Johannes Berg
Quoted 4 lines · Joerg Albert
Johannes Berg <johannes@...> writes:
Quoted 7 lines
Quoted 4 lines
Quoted 3 lines
Aha. yes, the same assignment is _also_ missing in
__cfg80211_connect_result(), can you add it there manually (in the status !=WLAN_STATUS_SUCCESSblock 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.
Johannes Berg
maintainerPATCH v2 1/1 cfg80211: clear SSID on disconnect/no connection
In reply to Johannes BergThe 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.
--- net/wireless/sme.c | 4 ++++ 1 file changed, 4 insertions(+)
net/wireless/sme.c +4 -0
@@ -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 ; }