From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from xc.sipsolutions.net ([83.246.72.84]:35814 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752250AbZDTXhd (ORCPT ); Mon, 20 Apr 2009 19:37:33 -0400 Subject: [PATCH 2.6.30] mac80211: fix alignment calculation bug From: Johannes Berg To: John Linville Cc: linux-wireless Content-Type: text/plain Date: Tue, 21 Apr 2009 01:36:59 +0200 Message-Id: <1240270619.17388.2.camel@johannes.local> (sfid-20090421_013736_637428_564412CA) Mime-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org List-ID: 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 --- net/mac80211/rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- wireless-testing.orig/net/mac80211/rx.c 2009-04-21 01:32:59.000000000 +0200 +++ wireless-testing/net/mac80211/rx.c 2009-04-21 01:33:22.000000000 +0200 @@ -1397,7 +1397,7 @@ ieee80211_deliver_skb(struct ieee80211_r * mac80211. That also explains the __skb_push() * below. */ - align = (unsigned long)skb->data & 4; + align = (unsigned long)skb->data & 3; if (align) { if (WARN_ON(skb_headroom(skb) < 3)) { dev_kfree_skb(skb);