aboutsummaryrefslogtreecommitdiffstats
path: root/net/netfilter/nft_lookup.c
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2015-04-11 10:46:41 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2015-04-13 20:12:32 +0200
commit7c6c6e95a12e46f499749bdd496e53d03950f377 (patch)
tree40afe68a6cd068af4e5102ec4989e57dbfe3e762 /net/netfilter/nft_lookup.c
parentnetfilter: nf_tables: mark stateful expressions (diff)
downloadlinux-dev-7c6c6e95a12e46f499749bdd496e53d03950f377.tar.xz
linux-dev-7c6c6e95a12e46f499749bdd496e53d03950f377.zip
netfilter: nf_tables: add flag to indicate set contains expressions
Add a set flag to indicate that the set is used as a state table and contains expressions for evaluation. This operation is mutually exclusive with the mapping operation, so sets specifying both are rejected. The lookup expression also rejects binding to state tables since it only deals with loopup and map operations. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter/nft_lookup.c')
-rw-r--r--net/netfilter/nft_lookup.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/netfilter/nft_lookup.c b/net/netfilter/nft_lookup.c
index ba1466209f2a..b3c31ef8015d 100644
--- a/net/netfilter/nft_lookup.c
+++ b/net/netfilter/nft_lookup.c
@@ -71,6 +71,9 @@ static int nft_lookup_init(const struct nft_ctx *ctx,
return PTR_ERR(set);
}
+ if (set->flags & NFT_SET_EVAL)
+ return -EOPNOTSUPP;
+
priv->sreg = nft_parse_register(tb[NFTA_LOOKUP_SREG]);
err = nft_validate_register_load(priv->sreg, set->klen);
if (err < 0)