From: Michael Buesch <mb@bu3sch.de>
To: Georgy Berdyshev <codingmaster@gmail.com>
Cc: "Luis R. Rodriguez" <mcgrof@gmail.com>,
matthieu castet <castet.matthieu@free.fr>,
linux-wireless@vger.kernel.org
Subject: Re: mac80211 : fix unaligned rx skb
Date: Thu, 4 Jun 2009 23:40:23 +0200 [thread overview]
Message-ID: <200906042340.23997.mb@bu3sch.de> (raw)
In-Reply-To: <ee8eb53d0906041416q52812277x7061070d1d9a683c@mail.gmail.com>
On Thursday 04 June 2009 23:16:13 Georgy Berdyshev wrote:
> Hi,
>
> that's the inline version:
> -------
> 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);
Uhm, can you give a more verbose explanation? Without that I'd say this patch is plain wrong.
What the hell does struct ethhdr have to do with wireless?
This is not ethernet. It's 802.11. There is no such thing as an ethernet header in a 802.11 packet.
--
Greetings, Michael.
next prev parent reply other threads:[~2009-06-04 21:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200906042340.23997.mb@bu3sch.de \
--to=mb@bu3sch.de \
--cc=castet.matthieu@free.fr \
--cc=codingmaster@gmail.com \
--cc=linux-wireless@vger.kernel.org \
--cc=mcgrof@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).