aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/ip6_gre.c
diff options
context:
space:
mode:
authorWilliam Tu <u9012063@gmail.com>2018-03-09 07:34:41 -0800
committerDavid S. Miller <davem@davemloft.net>2018-03-09 13:03:56 -0500
commitd6aa71197ffcb68850bfebfc3fc160abe41df53b (patch)
tree426dd72f36f26419573310a4567c19fa1f29c198 /net/ipv6/ip6_gre.c
parentip6gre: add erspan v2 to tunnel lookup (diff)
downloadlinux-dev-d6aa71197ffcb68850bfebfc3fc160abe41df53b.tar.xz
linux-dev-d6aa71197ffcb68850bfebfc3fc160abe41df53b.zip
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>
Diffstat (limited to 'net/ipv6/ip6_gre.c')
-rw-r--r--net/ipv6/ip6_gre.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
index 83c2fffd40be..a299f5424e16 100644
--- a/net/ipv6/ip6_gre.c
+++ b/net/ipv6/ip6_gre.c
@@ -945,6 +945,8 @@ static netdev_tx_t ip6erspan_tunnel_xmit(struct sk_buff *skb,
md->u.md2.dir,
get_hwid(&md->u.md2),
truncate, false);
+ } else {
+ goto tx_err;
}
} else {
switch (skb->protocol) {