[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20140114.150124.1400867442411259232.davem@davemloft.net>
Date: Tue, 14 Jan 2014 15:01:24 -0800 (PST)
From: David Miller <davem@...emloft.net>
To: stephen@...workplumber.org
Cc: netdev@...r.kernel.org
Subject: Re: [Bug 68501] New: llc_fixup_skb considers PDU len including
ETH_HLEN
From: Stephen Hemminger <stephen@...workplumber.org>
Date: Fri, 10 Jan 2014 15:11:56 -0800
> In below snip of code in llc_fixup_skb we calculate pdulen from
> eth_hdr(skb)->h_proto which contains total length of packet include ETH_HLEN.
>
> <snip>
> 119 if (skb->protocol == htons(ETH_P_802_2)) {
> 120 __be16 pdulen = eth_hdr(skb)->h_proto;
> 121 s32 data_size = ntohs(pdulen) - llc_len;
> 122
> 123 if (data_size < 0 ||
> 124 !pskb_may_pull(skb, data_size))
> 125 return 0;
>
> </snip>
>
>
> Line 121 should be changed to
>
> 121 s32 data_size = ntohs(pdulen) - llc_len - ETH_HLEN;
This can't be right, everything I can find says that the length here is:
the 802.2 packet length - the number of bytes of the 802.2
(LLC and data) portion of the frame, excluding padding
Which imples that the ethernet header length is not included.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists