summaryrefslogtreecommitdiff
path: root/net/ipv6/ip6_gre.c
diff options
context:
space:
mode:
authorWilliam Tu <u9012063@gmail.com>2018-03-09 18:34:42 +0300
committerDavid S. Miller <davem@davemloft.net>2018-03-09 21:03:57 +0300
commite41c7c68ea771683cae5a7f81c268f38d7912ecb (patch)
tree8746c5484cf7d7974183b3694f9f9376772faf86 /net/ipv6/ip6_gre.c
parentd6aa71197ffcb68850bfebfc3fc160abe41df53b (diff)
downloadlinux-e41c7c68ea771683cae5a7f81c268f38d7912ecb.tar.xz
ip6erspan: make sure enough headroom at xmit.
The patch adds skb_cow_header() to ensure enough headroom at ip6erspan_tunnel_xmit before pushing the erspan header to the skb. Signed-off-by: William Tu <u9012063@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/ip6_gre.c')
-rw-r--r--net/ipv6/ip6_gre.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
index a299f5424e16..1bbd0930063e 100644
--- a/net/ipv6/ip6_gre.c
+++ b/net/ipv6/ip6_gre.c
@@ -903,6 +903,9 @@ static netdev_tx_t ip6erspan_tunnel_xmit(struct sk_buff *skb,
truncate = true;
}
+ if (skb_cow_head(skb, dev->needed_headroom))
+ goto tx_err;
+
t->parms.o_flags &= ~TUNNEL_KEY;
IPCB(skb)->flags = 0;