2012-01-17 10:19:46

by Pontus Fuchs

[permalink] [raw]
Subject: [PATCH] mac80211: Remove dummy STA on deauth

Under certain conditions a dummy STA entry could be left in the
station list. This causes subsequent connection attempts to fail.

Logs look like this:

authenticate with 00:23:69:aa:dd:7b (try 1)
authenticated
failed to insert Dummy STA entry for the AP (error -17)
deauthenticating from 00:23:69:aa:dd:7b by local choice (reason=2)

Fix this by making sure to remove the dummy STA on deauth.

Signed-off-by: Pontus Fuchs <[email protected]>
---

The problem was introduced by the following commit added in v3.1:
mac80211: fix race condition between assoc_done and first EAP packet

This problem is fixed in the recent patch series from
Johannes Berg: [PATCH 0/8] more station handling refactoring

If you need a smaller fix this might fit you.

net/mac80211/mlme.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index ecb4c84..8bd8d4d 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -2751,6 +2751,7 @@ int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata,
struct ieee80211_local *local = sdata->local;
struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
struct ieee80211_work *wk;
+ struct sta_info *dummy;
u8 bssid[ETH_ALEN];
bool assoc_bss = false;

@@ -2810,6 +2811,11 @@ int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata,
if (assoc_bss)
sta_info_flush(sdata->local, sdata);

+ /* Make sure to remove dummy STA if it's there */
+ dummy = sta_info_get_bss_rx(sdata, req->bss->bssid);
+ if (dummy)
+ sta_info_destroy_addr(sdata, req->bss->bssid);
+
mutex_lock(&sdata->local->mtx);
ieee80211_recalc_idle(sdata->local);
mutex_unlock(&sdata->local->mtx);
--
1.7.5.4



2012-01-18 13:17:57

by Pontus Fuchs

[permalink] [raw]
Subject: Re: [PATCH] mac80211: Remove dummy STA on deauth

On 2012-01-17 14:04, Johannes Berg wrote:
>> If you need a smaller fix this might fit you.
>
> It doesn't fit me :-)
> Could you please make a fix that also fixes the missing
> finish_tx_sync()?

Abandoned. Superseded by this patch:

[PATCH 3.3] mac80211: fix work removal on deauth request

//Pontus

2012-01-17 13:04:35

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] mac80211: Remove dummy STA on deauth

On Tue, 2012-01-17 at 11:19 +0100, Pontus Fuchs wrote:
> Under certain conditions a dummy STA entry could be left in the
> station list.

This happens when a deauth is requested while associating.

> This causes subsequent connection attempts to fail.
>
> Logs look like this:
>
> authenticate with 00:23:69:aa:dd:7b (try 1)
> authenticated
> failed to insert Dummy STA entry for the AP (error -17)
> deauthenticating from 00:23:69:aa:dd:7b by local choice (reason=2)
>
> Fix this by making sure to remove the dummy STA on deauth.
>
> Signed-off-by: Pontus Fuchs <[email protected]>
> ---
>
> The problem was introduced by the following commit added in v3.1:
> mac80211: fix race condition between assoc_done and first EAP packet
>
> This problem is fixed in the recent patch series from
> Johannes Berg: [PATCH 0/8] more station handling refactoring
>
> If you need a smaller fix this might fit you.

It doesn't fit me :-)
Could you please make a fix that also fixes the missing
finish_tx_sync()?

Also, I think the code should be moved to the right place inside the
work cancelling in mgd_deauth().

johannes