diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2016-10-21 09:28:25 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-10-23 21:38:58 (GMT) |
commit | b678aa578c9e400429e027269e8de2783e5e73ce (patch) | |
tree | c1dd6a3119b327b4cdf94aed4feadee7721d5a79 /net/ipv6 | |
parent | a6e2846cacf97d4c70c5e923325b015cfa1e9053 (diff) | |
download | linux-b678aa578c9e400429e027269e8de2783e5e73ce.tar.xz |
ipv6: do not increment mac header when it's unset
Otherwise we'll overflow the integer. This occurs when layer 3 tunneled
packets are handed off to the IPv6 layer.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/reassembly.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c index 2160d5d..3815e85 100644 --- a/net/ipv6/reassembly.c +++ b/net/ipv6/reassembly.c @@ -456,7 +456,8 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff *prev, skb_network_header(head)[nhoff] = skb_transport_header(head)[0]; memmove(head->head + sizeof(struct frag_hdr), head->head, (head->data - head->head) - sizeof(struct frag_hdr)); - head->mac_header += sizeof(struct frag_hdr); + if (skb_mac_header_was_set(head)) + head->mac_header += sizeof(struct frag_hdr); head->network_header += sizeof(struct frag_hdr); skb_reset_transport_header(head); |