Pārlūkot izejas kodu

mac80211: fix alignment calculation bug

When checking whether or not a given frame needs to be
moved to be properly aligned to a 4-byte boundary, we
use & 4 which wasn't intended, this code should check
the lowest two bits.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg 16 gadi atpakaļ
vecāks
revīzija
d1bcb9f127
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      net/mac80211/rx.c

+ 1 - 1
net/mac80211/rx.c

@@ -1397,7 +1397,7 @@ ieee80211_deliver_skb(struct ieee80211_rx_data *rx)
 		 * mac80211. That also explains the __skb_push()
 		 * mac80211. That also explains the __skb_push()
 		 * below.
 		 * below.
 		 */
 		 */
-		align = (unsigned long)skb->data & 4;
+		align = (unsigned long)skb->data & 3;
 		if (align) {
 		if (align) {
 			if (WARN_ON(skb_headroom(skb) < 3)) {
 			if (WARN_ON(skb_headroom(skb) < 3)) {
 				dev_kfree_skb(skb);
 				dev_kfree_skb(skb);