mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-20 02:34:23 +08:00
netfilter: nft_nat: return EOPNOTSUPP if type or flags are not supported
Instead of EINVAL which should be used for malformed netlink messages.
Fixes: eb31628e37
("netfilter: nf_tables: Add support for IPv6 NAT")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
parent
fdb9c405e3
commit
0d7c83463f
@ -129,7 +129,7 @@ static int nft_nat_init(const struct nft_ctx *ctx, const struct nft_expr *expr,
|
|||||||
priv->type = NF_NAT_MANIP_DST;
|
priv->type = NF_NAT_MANIP_DST;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return -EINVAL;
|
return -EOPNOTSUPP;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tb[NFTA_NAT_FAMILY] == NULL)
|
if (tb[NFTA_NAT_FAMILY] == NULL)
|
||||||
@ -196,7 +196,7 @@ static int nft_nat_init(const struct nft_ctx *ctx, const struct nft_expr *expr,
|
|||||||
if (tb[NFTA_NAT_FLAGS]) {
|
if (tb[NFTA_NAT_FLAGS]) {
|
||||||
priv->flags = ntohl(nla_get_be32(tb[NFTA_NAT_FLAGS]));
|
priv->flags = ntohl(nla_get_be32(tb[NFTA_NAT_FLAGS]));
|
||||||
if (priv->flags & ~NF_NAT_RANGE_MASK)
|
if (priv->flags & ~NF_NAT_RANGE_MASK)
|
||||||
return -EINVAL;
|
return -EOPNOTSUPP;
|
||||||
}
|
}
|
||||||
|
|
||||||
return nf_ct_netns_get(ctx->net, family);
|
return nf_ct_netns_get(ctx->net, family);
|
||||||
|
Loading…
Reference in New Issue
Block a user