mac80211: Do not override AID in the duration field
authorJouni Malinen <jouni.malinen@atheros.com>
Tue, 19 May 2009 16:25:58 +0000 (19:25 +0300)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 20 May 2009 18:46:34 +0000 (14:46 -0400)
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 <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/tx.c

index 8f68bf9746d0e553b41eb5639a57ea6eee7bba0a..a910148b8228f5ebdd890e5f46aca0e3dbcff724 100644 (file)
@@ -872,6 +872,8 @@ ieee80211_tx_h_calculate_duration(struct ieee80211_tx_data *tx)
 
        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);