Commit 757b8b1d authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

net_sched: fix qdisc_pkt_len_init()

commit 1def9238 (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: default avatarEric Dumazet <edumazet@google.com>
Cc: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 247fa82b
...@@ -2776,8 +2776,12 @@ static void qdisc_pkt_len_init(struct sk_buff *skb) ...@@ -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 * we add to pkt_len the headers size of all segments
*/ */
if (shinfo->gso_size) { 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))) if (likely(shinfo->gso_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6)))
hdr_len += tcp_hdrlen(skb); hdr_len += tcp_hdrlen(skb);
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment