Skip to content

Commit

Permalink
net_sched: fix qdisc_pkt_len_init()
Browse files Browse the repository at this point in the history
commit 1def923 (net_sched: more precise pkt_len computation)
does a wrong computation of mac + network headers length, as it includes
the padding before the frame.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Jan 16, 2013
1 parent 247fa82 commit 757b8b1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -2776,8 +2776,12 @@ static void qdisc_pkt_len_init(struct sk_buff *skb)
* we add to pkt_len the headers size of all segments
*/
if (shinfo->gso_size) {
unsigned int hdr_len = skb_transport_offset(skb);
unsigned int hdr_len;

/* mac layer + network layer */
hdr_len = skb_transport_header(skb) - skb_mac_header(skb);

/* + transport layer */
if (likely(shinfo->gso_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6)))
hdr_len += tcp_hdrlen(skb);
else
Expand Down

0 comments on commit 757b8b1

Please sign in to comment.