Skip to contentSkip to conversation

cfg80211: fix disassociation warning due to misuse of wdev->current_bss

PATCH In review Pavel Roskin 2 participants 5 messages Aug 6, 2009 802.11 (including cfg80211/NL80211)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cfg80211: fix disassociation warning due to misuse of wdev->current_bss

WARN_ON was triggered at mlme.c:213 when dissociating from an AP.

wdev->current_bss->pub.bssid should be used in place of wdev->current_bss for BSSID comparison.

---
 net/wireless/mlme.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/wireless/mlme.c +1 -1
index 525e8e2..b44b6c0 100644
@@ -198,7 +198,7 @@ static void __cfg80211_send_disassoc(struct net_device *dev,
 		return;
 
 	if (wdev->current_bss &&
-	    memcmp(wdev->current_bss, bssid, ETH_ALEN) == 0) {
+	    memcmp(wdev->current_bss->pub.bssid, bssid, ETH_ALEN) == 0) {
 		for (i = 0; i < MAX_AUTH_BSSES; i++) {
 			if (wdev->authtry_bsses[i] || wdev->auth_bsses[i])
 				continue;
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Pavel Roskin

WARN_ON was triggered at mlme.c:213 when dissociating from an AP.

wdev->current_bss->pub.bssid should be used in place of wdev->current_bss for BSSID comparison.

Oh wow, good catch, thanks.

Quoted 19 lines
---
 net/wireless/mlme.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/wireless/mlme.c +1 -1
index 525e8e2..b44b6c0 100644
@@ -198,7 +198,7 @@ static void __cfg80211_send_disassoc(struct net_device *dev,
 		return;
 
 	if (wdev->current_bss &&
-	    memcmp(wdev->current_bss, bssid, ETH_ALEN) == 0) {
+	    memcmp(wdev->current_bss->pub.bssid, bssid, ETH_ALEN) == 0) {
 		for (i = 0; i < MAX_AUTH_BSSES; i++) {
 			if (wdev->authtry_bsses[i] || wdev->auth_bsses[i])
 				continue;
#2 lore raw
Quoted 7 lines · Johannes Berg
Quoted 4 lines · Pavel Roskin

WARN_ON was triggered at mlme.c:213 when dissociating from an AP.

wdev->current_bss->pub.bssid should be used in place of wdev->current_bss for BSSID comparison.

Oh wow, good catch, thanks.

Now that the check is fixed, it turn out there is a related problem in the same function. If the device is in the managed mode and disconnects from an AP due to a low signal, attempts to reassociate by setting the same ESSID fail:

Error for wireless request "Set ESSID" (8B1A) :
SET failed on device wlan0 ; Operation already in progress.

It happens because wdev->auth_bsses[i] is not set to NULL. cfg80211_sme_disassoc() can do it, but not if wdev->conn->state is CFG80211_CONN_IDLE.

Either cfg80211_sme_disassoc() or __cfg80211_send_disassoc() should unset wdev->auth_bsses[i] for the management mode.

Signature · 2 lines
Regards,
Pavel Roskin
maintainer
#3 lore raw
Quoted 3 lines · Pavel Roskin

Now that the check is fixed, it turn out there is a related problem in the same function. If the device is in the managed mode and disconnects from an AP due to a low signal,

Who decides to disconnect?

This isn't making any sense to me. Once you're connected, wdev->auth_bsses[i] shouldn't be set any more.

johannes

#4 lore raw
Quoted 7 lines · Johannes Berg
Quoted 3 lines · Pavel Roskin

Now that the check is fixed, it turn out there is a related problem in the same function. If the device is in the managed mode and disconnects from an AP due to a low signal,

Who decides to disconnect?

I was unscrewing the antenna from the AP, and the AP wasn't visible in the scan results without an antenna, so I assume that the station was deciding to disconnect on its own.

Quoted 2 lines

This isn't making any sense to me. Once you're connected, wdev->auth_bsses[i] shouldn't be set any more.

I see that you have posted several patches for the issue. I'll test them on the same hardware tomorrow to avoid introducing extra variables.

Signature · 2 lines
Regards,
Pavel Roskin