All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] mac80211: Fix [re]association power saving issue on AP side
@ 2009-09-21 20:25 Igor Perminov
  2009-09-21 23:36 ` Johannes Berg
  2009-09-26 18:34 ` Jouni Malinen
  0 siblings, 2 replies; 4+ messages in thread
From: Igor Perminov @ 2009-09-21 20:25 UTC (permalink / raw)
  To: John W. Linville; +Cc: Johannes Berg, Jouni Malinen, linux-wireless

Consider the following step-by step:
1. A STA authenticates and associates with the AP and exchanges
traffic.
2. The STA reports to the AP that it is going to PS state.
3. Some time later the STA device goes to the stand-by mode (not only
its wi-fi card, but the device itself) and drops the association state
without sending a disassociation frame.
4. The STA device wakes up and begins authentication with an
Auth frame as it hasn't been authenticated/associated previously.
 
At the step 4 the AP "remembers" the STA and considers it is still in
the PS state, so the AP buffers frames, which it has to send to the STA.
But the STA isn't actually in the PS state and so it neither checks
TIM bits nor reports to the AP that it isn't power saving.
Because of that authentication/[re]association fails.

To fix authentication/[re]association stage of this issue, Auth, Assoc
Resp and Reassoc Resp frames are transmitted disregarding of STA's power
saving state.

N.B. This patch doesn't fix further data frame exchange after
authentication/[re]association. A patch in hostapd is required to fix
that.

Signed-off-by: Igor Perminov <igor.perminov@inbox.ru>
---
 net/mac80211/tx.c       |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 10a1099..4d981e7 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -367,7 +367,10 @@ ieee80211_tx_h_unicast_ps_buf(struct ieee80211_tx_data *tx)
 	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx->skb->data;
 	u32 staflags;
 
-	if (unlikely(!sta || ieee80211_is_probe_resp(hdr->frame_control)))
+	if (unlikely(!sta || ieee80211_is_probe_resp(hdr->frame_control)
+			|| ieee80211_is_auth(hdr->frame_control)
+			|| ieee80211_is_assoc_resp(hdr->frame_control)
+			|| ieee80211_is_reassoc_resp(hdr->frame_control)))
 		return TX_CONTINUE;
 
 	staflags = get_sta_flags(sta);



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

* Re: [PATCH v2] mac80211: Fix [re]association power saving issue on AP side
  2009-09-21 20:25 [PATCH v2] mac80211: Fix [re]association power saving issue on AP side Igor Perminov
@ 2009-09-21 23:36 ` Johannes Berg
  2009-09-26 18:34 ` Jouni Malinen
  1 sibling, 0 replies; 4+ messages in thread
From: Johannes Berg @ 2009-09-21 23:36 UTC (permalink / raw)
  To: Igor Perminov; +Cc: John W. Linville, Jouni Malinen, linux-wireless

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

On Tue, 2009-09-22 at 00:25 +0400, Igor Perminov wrote:
> Consider the following step-by step:

NACK this, we'll take care of it properly with the required cleanup as
mentioned.

johannes

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

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

* Re: [PATCH v2] mac80211: Fix [re]association power saving issue on AP side
  2009-09-21 20:25 [PATCH v2] mac80211: Fix [re]association power saving issue on AP side Igor Perminov
  2009-09-21 23:36 ` Johannes Berg
@ 2009-09-26 18:34 ` Jouni Malinen
  2009-09-27 13:07   ` Johannes Berg
  1 sibling, 1 reply; 4+ messages in thread
From: Jouni Malinen @ 2009-09-26 18:34 UTC (permalink / raw)
  To: Igor Perminov; +Cc: John W. Linville, Johannes Berg, linux-wireless

On Tue, Sep 22, 2009 at 12:25:44AM +0400, Igor Perminov wrote:

> At the step 4 the AP "remembers" the STA and considers it is still in
> the PS state, so the AP buffers frames, which it has to send to the STA.
> But the STA isn't actually in the PS state and so it neither checks
> TIM bits nor reports to the AP that it isn't power saving.
> Because of that authentication/[re]association fails.
> 
> To fix authentication/[re]association stage of this issue, Auth, Assoc
> Resp and Reassoc Resp frames are transmitted disregarding of STA's power
> saving state.

That looks fine to me and should be applied.

> N.B. This patch doesn't fix further data frame exchange after
> authentication/[re]association. A patch in hostapd is required to fix
> that.

Git snapshot of hostapd is now removing the STA entry (if one exists)
when processing reassociation. The combination of these two changes
allows the reassociation back to the same AP to be completed even if the
STA was in PS mode.

-- 
Jouni Malinen                                            PGP id EFC895FA

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

* Re: [PATCH v2] mac80211: Fix [re]association power saving issue on AP side
  2009-09-26 18:34 ` Jouni Malinen
@ 2009-09-27 13:07   ` Johannes Berg
  0 siblings, 0 replies; 4+ messages in thread
From: Johannes Berg @ 2009-09-27 13:07 UTC (permalink / raw)
  To: Jouni Malinen; +Cc: Igor Perminov, John W. Linville, linux-wireless

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

On Sat, 2009-09-26 at 21:34 +0300, Jouni Malinen wrote:
> On Tue, Sep 22, 2009 at 12:25:44AM +0400, Igor Perminov wrote:
> 
> > At the step 4 the AP "remembers" the STA and considers it is still in
> > the PS state, so the AP buffers frames, which it has to send to the STA.
> > But the STA isn't actually in the PS state and so it neither checks
> > TIM bits nor reports to the AP that it isn't power saving.
> > Because of that authentication/[re]association fails.
> > 
> > To fix authentication/[re]association stage of this issue, Auth, Assoc
> > Resp and Reassoc Resp frames are transmitted disregarding of STA's power
> > saving state.
> 
> That looks fine to me and should be applied.

Alright, I'll take back my NACK then, just thought it'd be easier to do
the cleanup in the same patch but I can also do it separately.

johannes

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

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

end of thread, other threads:[~2009-09-27 18:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-21 20:25 [PATCH v2] mac80211: Fix [re]association power saving issue on AP side Igor Perminov
2009-09-21 23:36 ` Johannes Berg
2009-09-26 18:34 ` Jouni Malinen
2009-09-27 13:07   ` Johannes Berg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.