summaryrefslogtreecommitdiff
path: root/net/netfilter/nft_tunnel.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2020-01-19 22:10:04 +0100
committerDavid S. Miller <davem@davemloft.net>2020-01-19 22:10:04 +0100
commitb3f7e3f23a763ccaae7b52d88d2c91e66c80d406 (patch)
treee00e90eb161305ed9895315ba12e30ac17de9523 /net/netfilter/nft_tunnel.c
parent4ee9e6e027c06eb1dd1cdbe025d461e407ece755 (diff)
parent7008ee121089b8193aea918b98850fe87d996508 (diff)
Merge ra.kernel.org:/pub/scm/linux/kernel/git/netdev/net
Diffstat (limited to 'net/netfilter/nft_tunnel.c')
-rw-r--r--net/netfilter/nft_tunnel.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/netfilter/nft_tunnel.c b/net/netfilter/nft_tunnel.c
index 23cd163689d5..4c3f2e24c7cb 100644
--- a/net/netfilter/nft_tunnel.c
+++ b/net/netfilter/nft_tunnel.c
@@ -76,7 +76,7 @@ static int nft_tunnel_get_init(const struct nft_ctx *ctx,
struct nft_tunnel *priv = nft_expr_priv(expr);
u32 len;
- if (!tb[NFTA_TUNNEL_KEY] &&
+ if (!tb[NFTA_TUNNEL_KEY] ||
!tb[NFTA_TUNNEL_DREG])
return -EINVAL;
@@ -267,6 +267,9 @@ static int nft_tunnel_obj_erspan_init(const struct nlattr *attr,
if (err < 0)
return err;
+ if (!tb[NFTA_TUNNEL_KEY_ERSPAN_VERSION])
+ return -EINVAL;
+
version = ntohl(nla_get_be32(tb[NFTA_TUNNEL_KEY_ERSPAN_VERSION]));
switch (version) {
case ERSPAN_VERSION: