From: matthieu castet <castet.matthieu@free.fr>
To: Michael Buesch <mb@bu3sch.de>
Cc: Georgy Berdyshev <codingmaster@gmail.com>,
"Luis R. Rodriguez" <mcgrof@gmail.com>,
linux-wireless@vger.kernel.org
Subject: Re: mac80211 : fix unaligned rx skb
Date: Fri, 05 Jun 2009 07:57:36 +0200 [thread overview]
Message-ID: <4A28B3D0.4070201@free.fr> (raw)
In-Reply-To: <200906042340.23997.mb@bu3sch.de>
Michael Buesch wrote:
> 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.
>
Where are in ieee80211_deliver_skb that is called after
ieee80211_data_to_8023. So it is not 802.11.
Matthieu
next prev parent reply other threads:[~2009-06-05 5:57 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
2009-06-05 5:57 ` matthieu castet [this message]
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=4A28B3D0.4070201@free.fr \
--to=castet.matthieu@free.fr \
--cc=codingmaster@gmail.com \
--cc=linux-wireless@vger.kernel.org \
--cc=mb@bu3sch.de \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.