linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cfg80211: fix disassociation warning due to misuse of wdev->current_bss
@ 2009-08-06  8:52 Pavel Roskin
  2009-08-06  9:06 ` Johannes Berg
  0 siblings, 1 reply; 5+ messages in thread
From: Pavel Roskin @ 2009-08-06  8:52 UTC (permalink / raw)
  To: Johannes Berg, linux-wireless, John Linville

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.

Signed-off-by: Pavel Roskin <proski@gnu.org>
---
 net/wireless/mlme.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
index 525e8e2..b44b6c0 100644
--- a/net/wireless/mlme.c
+++ b/net/wireless/mlme.c
@@ -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;

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

* Re: [PATCH] cfg80211: fix disassociation warning due to misuse of wdev->current_bss
  2009-08-06  8:52 [PATCH] cfg80211: fix disassociation warning due to misuse of wdev->current_bss Pavel Roskin
@ 2009-08-06  9:06 ` Johannes Berg
  2009-08-06 12:55   ` Pavel Roskin
  0 siblings, 1 reply; 5+ messages in thread
From: Johannes Berg @ 2009-08-06  9:06 UTC (permalink / raw)
  To: Pavel Roskin; +Cc: linux-wireless, John Linville

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

On Thu, 2009-08-06 at 04:52 -0400, Pavel Roskin wrote:
> 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.

Reviewed-by: Johannes Berg <johannes@sipsolutions.net>

> Signed-off-by: Pavel Roskin <proski@gnu.org>
> ---
>  net/wireless/mlme.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
> index 525e8e2..b44b6c0 100644
> --- a/net/wireless/mlme.c
> +++ b/net/wireless/mlme.c
> @@ -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;
> 


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

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

* Re: [PATCH] cfg80211: fix disassociation warning due to misuse of wdev->current_bss
  2009-08-06  9:06 ` Johannes Berg
@ 2009-08-06 12:55   ` Pavel Roskin
  2009-08-06 13:09     ` Johannes Berg
  0 siblings, 1 reply; 5+ messages in thread
From: Pavel Roskin @ 2009-08-06 12:55 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, John Linville

On Thu, 2009-08-06 at 11:06 +0200, Johannes Berg wrote:
> On Thu, 2009-08-06 at 04:52 -0400, Pavel Roskin wrote:
> > 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.

-- 
Regards,
Pavel Roskin

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

* Re: [PATCH] cfg80211: fix disassociation warning due to misuse of wdev->current_bss
  2009-08-06 12:55   ` Pavel Roskin
@ 2009-08-06 13:09     ` Johannes Berg
  2009-08-06 20:39       ` Pavel Roskin
  0 siblings, 1 reply; 5+ messages in thread
From: Johannes Berg @ 2009-08-06 13:09 UTC (permalink / raw)
  To: Pavel Roskin; +Cc: linux-wireless, John Linville

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

On Thu, 2009-08-06 at 08:55 -0400, Pavel Roskin wrote:

> 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


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

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

* Re: [PATCH] cfg80211: fix disassociation warning due to misuse of wdev->current_bss
  2009-08-06 13:09     ` Johannes Berg
@ 2009-08-06 20:39       ` Pavel Roskin
  0 siblings, 0 replies; 5+ messages in thread
From: Pavel Roskin @ 2009-08-06 20:39 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, John Linville

On Thu, 2009-08-06 at 15:09 +0200, Johannes Berg wrote:
> On Thu, 2009-08-06 at 08:55 -0400, Pavel Roskin wrote:
> 
> > 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.

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

-- 
Regards,
Pavel Roskin

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

end of thread, other threads:[~2009-08-06 20:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-06  8:52 [PATCH] cfg80211: fix disassociation warning due to misuse of wdev->current_bss Pavel Roskin
2009-08-06  9:06 ` Johannes Berg
2009-08-06 12:55   ` Pavel Roskin
2009-08-06 13:09     ` Johannes Berg
2009-08-06 20:39       ` Pavel Roskin

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