diff options
author | Eric Dumazet <edumazet@google.com> | 2013-01-16 00:14:21 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-01-16 00:41:19 -0500 |
commit | 757b8b1d2bfa1210592bfd2984852b155eb58746 (patch) | |
tree | 39db2219a523ec8a99951b09eb7794e2e8c09317 /net | |
parent | 247fa82be1301e4f89eaa5dc10be62a9cc84e8c5 (diff) |
net_sched: fix qdisc_pkt_len_init()
commit 1def9238d4aa2 (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>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/dev.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 862eaa744a54..b6d2b32933ba 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -2776,8 +2776,12 @@ static void qdisc_pkt_len_init(struct sk_buff *skb) | |||
2776 | * we add to pkt_len the headers size of all segments | 2776 | * we add to pkt_len the headers size of all segments |
2777 | */ | 2777 | */ |
2778 | if (shinfo->gso_size) { | 2778 | if (shinfo->gso_size) { |
2779 | unsigned int hdr_len = skb_transport_offset(skb); | 2779 | unsigned int hdr_len; |
2780 | 2780 | ||
2781 | /* mac layer + network layer */ | ||
2782 | hdr_len = skb_transport_header(skb) - skb_mac_header(skb); | ||
2783 | |||
2784 | /* + transport layer */ | ||
2781 | if (likely(shinfo->gso_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6))) | 2785 | if (likely(shinfo->gso_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6))) |
2782 | hdr_len += tcp_hdrlen(skb); | 2786 | hdr_len += tcp_hdrlen(skb); |
2783 | else | 2787 | else |