Browse Source

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>
William Tu 7 years ago
parent
commit
e41c7c68ea
1 changed files with 3 additions and 0 deletions
  1. 3 0
      net/ipv6/ip6_gre.c

+ 3 - 0
net/ipv6/ip6_gre.c

@@ -903,6 +903,9 @@ static netdev_tx_t ip6erspan_tunnel_xmit(struct sk_buff *skb,
 		truncate = true;
 		truncate = true;
 	}
 	}
 
 
+	if (skb_cow_head(skb, dev->needed_headroom))
+		goto tx_err;
+
 	t->parms.o_flags &= ~TUNNEL_KEY;
 	t->parms.o_flags &= ~TUNNEL_KEY;
 	IPCB(skb)->flags = 0;
 	IPCB(skb)->flags = 0;