linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* mac80211 : fix unaligned rx skb
@ 2009-06-04 20:16 matthieu castet
  2009-06-04 20:53 ` Luis R. Rodriguez
  0 siblings, 1 reply; 8+ messages in thread
From: matthieu castet @ 2009-06-04 20:16 UTC (permalink / raw)
  To: linux-wireless

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: mac80211_alignement.diff --]
[-- Type: text/x-diff, Size: 764 bytes --]

mac80211 is checking is the skb is aligned on 32 bit boundary.
But it is checking against ethernet header, whereas Linux expect IP
header aligned.
And ethernet ether size is 6*2+2=14, so aligning ethernet header make IP header unaligned.

Signed-off-by: Matthieu CASTET <castet.matthieu@free.fr>
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 9776f73..0845fb3 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -1397,7 +1397,7 @@ ieee80211_deliver_skb(struct ieee80211_rx_data *rx)
 		 * mac80211. That also explains the __skb_push()
 		 * below.
 		 */
-		align = (unsigned long)skb->data & 3;
+		align = ((unsigned long)(skb->data + sizeof(struct ethhdr))) & 3;
 		if (align) {
 			if (WARN_ON(skb_headroom(skb) < 3)) {
 				dev_kfree_skb(skb);

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-06-07 15:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-04 20:16 mac80211 : fix unaligned rx skb matthieu castet
2009-06-04 20:53 ` Luis R. Rodriguez
2009-06-04 21:16   ` Georgy Berdyshev
2009-06-04 21:40     ` Michael Buesch
2009-06-05  5:57       ` matthieu castet
2009-06-07  9:24         ` matthieu castet
2009-06-07  9:26           ` Michael Buesch
2009-06-07 15:18             ` John W. Linville

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).