aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2018-03-09 13:03:57 -0500
committerDavid S. Miller <davem@davemloft.net>2018-03-09 13:03:57 -0500
commit87de1201ddaa39d4f3fafa9f35ac143e582517e6 (patch)
tree8746c5484cf7d7974183b3694f9f9376772faf86
parent4eb57eccbd43291dfd87c19997ef4a4ea2e04ca8 (diff)
parente41c7c68ea771683cae5a7f81c268f38d7912ecb (diff)
Merge branch 'erspan-fixes'
William Tu says: ==================== a couple of erspan fixes The series fixes a couple of erspan issues. The first patch adds the erspan v2 proto type to the ip6 tunnel lookup. The second patch improves the error handling when users screws the version number in metadata. The final patch makes sure the skb has enough headroom for pushing erspan header when xmit. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/ipv6/ip6_gre.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
index 3c353125546d..1bbd0930063e 100644
--- a/net/ipv6/ip6_gre.c
+++ b/net/ipv6/ip6_gre.c
@@ -126,7 +126,8 @@ static struct ip6_tnl *ip6gre_tunnel_lookup(struct net_device *dev,
126 struct ip6_tnl *t, *cand = NULL; 126 struct ip6_tnl *t, *cand = NULL;
127 struct ip6gre_net *ign = net_generic(net, ip6gre_net_id); 127 struct ip6gre_net *ign = net_generic(net, ip6gre_net_id);
128 int dev_type = (gre_proto == htons(ETH_P_TEB) || 128 int dev_type = (gre_proto == htons(ETH_P_TEB) ||
129 gre_proto == htons(ETH_P_ERSPAN)) ? 129 gre_proto == htons(ETH_P_ERSPAN) ||
130 gre_proto == htons(ETH_P_ERSPAN2)) ?
130 ARPHRD_ETHER : ARPHRD_IP6GRE; 131 ARPHRD_ETHER : ARPHRD_IP6GRE;
131 int score, cand_score = 4; 132 int score, cand_score = 4;
132 133
@@ -902,6 +903,9 @@ static netdev_tx_t ip6erspan_tunnel_xmit(struct sk_buff *skb,
902 truncate = true; 903 truncate = true;
903 } 904 }
904 905
906 if (skb_cow_head(skb, dev->needed_headroom))
907 goto tx_err;
908
905 t->parms.o_flags &= ~TUNNEL_KEY; 909 t->parms.o_flags &= ~TUNNEL_KEY;
906 IPCB(skb)->flags = 0; 910 IPCB(skb)->flags = 0;
907 911
@@ -944,6 +948,8 @@ static netdev_tx_t ip6erspan_tunnel_xmit(struct sk_buff *skb,
944 md->u.md2.dir, 948 md->u.md2.dir,
945 get_hwid(&md->u.md2), 949 get_hwid(&md->u.md2),
946 truncate, false); 950 truncate, false);
951 } else {
952 goto tx_err;
947 } 953 }
948 } else { 954 } else {
949 switch (skb->protocol) { 955 switch (skb->protocol) {