Search Linux Wireless

Re: mac80211 : fix unaligned rx skb

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxx>
> 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.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux