Skip to content

Commit

Permalink
ip6erspan: make sure enough headroom at xmit.
Browse files Browse the repository at this point in the history
Upstream commit:
    commit e41c7c68ea771683cae5a7f81c268f38d7912ecb
    Author: William Tu <[email protected]>
    Date:   Fri Mar 9 07:34:42 2018 -0800

    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 <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>

Cc: William Tu <[email protected]>
Signed-off-by: Greg Rose <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
Acked-by: William Tu <[email protected]>
  • Loading branch information
williamtu authored and blp committed May 22, 2018
1 parent 8dc47fb commit bf66270
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions datapath/linux/compat/ip6_gre.c
Original file line number Diff line number Diff line change
Expand Up @@ -1094,6 +1094,9 @@ static netdev_tx_t ip6erspan_tunnel_xmit(struct sk_buff *skb,
(ntohs(ip_hdr(skb)->tot_len) > skb->len - nhoff))
truncate = true;

if (skb_cow_head(skb, dev->needed_headroom))
goto tx_err;

t->parms.o_flags &= ~TUNNEL_KEY;
IPCB(skb)->flags = 0;

Expand Down

0 comments on commit bf66270

Please sign in to comment.