]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
rt2x00: Only remove L2 padding in received frames if there is payload.
authorGertjan van Wingerde <gwingerde@gmail.com>
Fri, 4 Dec 2009 22:47:04 +0000 (23:47 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 21 Dec 2009 23:56:36 +0000 (18:56 -0500)
L2 padding will only be present when there is actual payload present.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Ivo van Doorn <ivdoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rt2x00/rt2x00dev.c

index cc6bcc5a20c78bc30e5604b871bed6f652ddbe55..d7711e4d47510943eabc8195652274ea01133467 100644 (file)
@@ -401,7 +401,9 @@ void rt2x00lib_rxdone(struct rt2x00_dev *rt2x00dev,
            (rxdesc.flags & RX_FLAG_IV_STRIPPED))
                rt2x00crypto_rx_insert_iv(entry->skb, header_length,
                                          &rxdesc);
-       else if (rxdesc.dev_flags & RXDONE_L2PAD)
+       else if (header_length &&
+                (rxdesc.size > header_length) &&
+                (rxdesc.dev_flags & RXDONE_L2PAD))
                rt2x00queue_remove_l2pad(entry->skb, header_length);
        else
                rt2x00queue_align_payload(entry->skb, header_length);