diff options
author | David S. Miller <davem@davemloft.net> | 2018-01-23 13:49:06 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-01-23 13:51:56 -0500 |
commit | 5ca114400dcd46f19f31573e7c60e638bd8d644b (patch) | |
tree | d78dc56c94548d865e505f022c08006716bdb963 /net/core | |
parent | f53d77e19b6587527a3dd60a0e638f115e5cd7a9 (diff) | |
parent | a84a8ab94ed5cb65a1355fe9e8d1d55283375808 (diff) | |
download | linux-5ca114400dcd46f19f31573e7c60e638bd8d644b.tar.bz2 |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
en_rx_am.c was deleted in 'net-next' but had a bug fixed in it in
'net'.
The esp{4,6}_offload.c conflicts were overlapping changes.
The 'out' label is removed so we just return ERR_PTR(-EINVAL)
directly.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/dev.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 77795f66c246..4670ccabe23a 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -3166,10 +3166,21 @@ static void qdisc_pkt_len_init(struct sk_buff *skb) 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 - hdr_len += sizeof(struct udphdr); + if (likely(shinfo->gso_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6))) { + const struct tcphdr *th; + struct tcphdr _tcphdr; + + th = skb_header_pointer(skb, skb_transport_offset(skb), + sizeof(_tcphdr), &_tcphdr); + if (likely(th)) + hdr_len += __tcp_hdrlen(th); + } else { + struct udphdr _udphdr; + + if (skb_header_pointer(skb, skb_transport_offset(skb), + sizeof(_udphdr), &_udphdr)) + hdr_len += sizeof(struct udphdr); + } if (shinfo->gso_type & SKB_GSO_DODGY) gso_segs = DIV_ROUND_UP(skb->len - hdr_len, |