2009-05-19 14:02:47

by Jouni Malinen

[permalink] [raw]
Subject: [PATCH 7/7] mac80211: Do not override AID in the duration field

When updating the duration field for TX frames, skip the update for
PS-Poll frames that use this field for other purposes (AID).

Signed-off-by: Jouni Malinen <[email protected]>

---
net/mac80211/tx.c | 2 ++
1 file changed, 2 insertions(+)

--- wireless-testing.orig/net/mac80211/tx.c 2009-05-19 16:32:25.000000000 +0300
+++ wireless-testing/net/mac80211/tx.c 2009-05-19 16:32:42.000000000 +0300
@@ -872,6 +872,8 @@ ieee80211_tx_h_calculate_duration(struct

do {
hdr = (void *) skb->data;
+ if (ieee80211_is_pspoll(hdr->frame_control))
+ continue; /* must not overwrite AID */
next_len = skb->next ? skb->next->len : 0;
group_addr = is_multicast_ether_addr(hdr->addr1);


--

--
Jouni Malinen PGP id EFC895FA


2009-05-19 16:26:12

by Jouni Malinen

[permalink] [raw]
Subject: [PATCH v2 7/7] mac80211: Do not override AID in the duration field

When updating the duration field for TX frames, skip the update for
PS-Poll frames that use this field for other purposes (AID).

Signed-off-by: Jouni Malinen <[email protected]>

---
net/mac80211/tx.c | 2 ++
1 file changed, 2 insertions(+)

v2: add unlikely() and change continue to break to avoid unnecessary
check for a fragment of PS-Poll frame

--- wireless-testing.orig/net/mac80211/tx.c 2009-05-14 21:03:49.000000000 +0300
+++ wireless-testing/net/mac80211/tx.c 2009-05-19 19:20:57.000000000 +0300
@@ -872,6 +872,8 @@ ieee80211_tx_h_calculate_duration(struct

do {
hdr = (void *) skb->data;
+ if (unlikely(ieee80211_is_pspoll(hdr->frame_control)))
+ break; /* must not overwrite AID */
next_len = skb->next ? skb->next->len : 0;
group_addr = is_multicast_ether_addr(hdr->addr1);

--
Jouni Malinen PGP id EFC895FA

2009-05-19 14:53:27

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH 7/7] mac80211: Do not override AID in the duration field

On Tue, 2009-05-19 at 17:01 +0300, Jouni Malinen wrote:
> plain text document attachment (mac80211-pspoll-aid.patch)
> When updating the duration field for TX frames, skip the update for
> PS-Poll frames that use this field for other purposes (AID).
>
> Signed-off-by: Jouni Malinen <[email protected]>
>
> ---
> net/mac80211/tx.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> --- wireless-testing.orig/net/mac80211/tx.c 2009-05-19 16:32:25.000000000 +0300
> +++ wireless-testing/net/mac80211/tx.c 2009-05-19 16:32:42.000000000 +0300
> @@ -872,6 +872,8 @@ ieee80211_tx_h_calculate_duration(struct
>
> do {
> hdr = (void *) skb->data;
> + if (ieee80211_is_pspoll(hdr->frame_control))
> + continue; /* must not overwrite AID */

unlikely()? Also, you can 'break' instead of 'continue' or actually put
this in front of the loop since the frame cannot be fragmented.

johannes


Attachments:
signature.asc (801.00 B)
This is a digitally signed message part