Quellcode durchsuchen

ip6erspan: improve error handling for erspan version number.

When users fill in incorrect erspan version number through
the struct erspan_metadata uapi, current code skips pushing
the erspan header but continue pushing the gre header, which
is incorrect.  The patch fixes it by returning error.

Signed-off-by: William Tu <u9012063@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
William Tu vor 7 Jahren
Ursprung
Commit
d6aa71197f
1 geänderte Dateien mit 2 neuen und 0 gelöschten Zeilen
  1. 2 0
      net/ipv6/ip6_gre.c

+ 2 - 0
net/ipv6/ip6_gre.c

@@ -945,6 +945,8 @@ static netdev_tx_t ip6erspan_tunnel_xmit(struct sk_buff *skb,
 					       md->u.md2.dir,
 					       md->u.md2.dir,
 					       get_hwid(&md->u.md2),
 					       get_hwid(&md->u.md2),
 					       truncate, false);
 					       truncate, false);
+		} else {
+			goto tx_err;
 		}
 		}
 	} else {
 	} else {
 		switch (skb->protocol) {
 		switch (skb->protocol) {