diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2020-03-11 15:30:12 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2020-03-15 15:27:47 +0100 |
commit | a7fc936804084145e2a6374e23744defdc948e09 (patch) | |
tree | 2d662a29358d8f25d6ddc512f45eca07f250e60a /net/netfilter/nft_dynset.c | |
parent | eb16933aa5beb252e839032452ce893051a1222c (diff) | |
download | linux-a7fc936804084145e2a6374e23744defdc948e09.tar.gz linux-a7fc936804084145e2a6374e23744defdc948e09.tar.bz2 linux-a7fc936804084145e2a6374e23744defdc948e09.zip |
netfilter: nf_tables: add nft_set_elem_expr_alloc()
Add helper function to create stateful expression.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter/nft_dynset.c')
-rw-r--r-- | net/netfilter/nft_dynset.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/net/netfilter/nft_dynset.c b/net/netfilter/nft_dynset.c index 683785225a3e..e106cf1c5b8b 100644 --- a/net/netfilter/nft_dynset.c +++ b/net/netfilter/nft_dynset.c @@ -206,21 +206,10 @@ static int nft_dynset_init(const struct nft_ctx *ctx, if (!(set->flags & NFT_SET_EVAL)) return -EINVAL; - priv->expr = nft_expr_init(ctx, tb[NFTA_DYNSET_EXPR]); + priv->expr = nft_set_elem_expr_alloc(ctx, set, + tb[NFTA_DYNSET_EXPR]); if (IS_ERR(priv->expr)) return PTR_ERR(priv->expr); - - err = -EOPNOTSUPP; - if (!(priv->expr->ops->type->flags & NFT_EXPR_STATEFUL)) - goto err1; - - if (priv->expr->ops->type->flags & NFT_EXPR_GC) { - if (set->flags & NFT_SET_TIMEOUT) - goto err1; - if (!set->ops->gc_init) - goto err1; - set->ops->gc_init(set); - } } nft_set_ext_prepare(&priv->tmpl); |