]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
netfilter: nft_dynset: do not reject set updates with NFT_SET_EVAL
authorPablo Neira Ayuso <pablo@netfilter.org>
Mon, 11 Jun 2018 15:18:29 +0000 (17:18 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 12 Jun 2018 17:12:48 +0000 (19:12 +0200)
NFT_SET_EVAL is signalling the kernel that this sets can be updated from
the evaluation path, even if there are no expressions attached to the
element. Otherwise, set updates with no expressions fail. Update
description to describe the right semantics.

Fixes: 22fe54d5fefc ("netfilter: nf_tables: add support for dynamic set updates")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/uapi/linux/netfilter/nf_tables.h
net/netfilter/nft_dynset.c

index c9bf74b94f3704ca66791df3564f01569ec4ba30..89438e68dc030fd0ecf579bf5158e1042435a6b7 100644 (file)
@@ -266,7 +266,7 @@ enum nft_rule_compat_attributes {
  * @NFT_SET_INTERVAL: set contains intervals
  * @NFT_SET_MAP: set is used as a dictionary
  * @NFT_SET_TIMEOUT: set uses timeouts
- * @NFT_SET_EVAL: set contains expressions for evaluation
+ * @NFT_SET_EVAL: set can be updated from the evaluation path
  * @NFT_SET_OBJECT: set contains stateful objects
  */
 enum nft_set_flags {
index 4d49529cff615285bd3d1c8d5914e2624ece7da4..27d7e4598ab63c982b034136a3115f710b545679 100644 (file)
@@ -203,9 +203,7 @@ static int nft_dynset_init(const struct nft_ctx *ctx,
                                goto err1;
                        set->ops->gc_init(set);
                }
-
-       } else if (set->flags & NFT_SET_EVAL)
-               return -EINVAL;
+       }
 
        nft_set_ext_prepare(&priv->tmpl);
        nft_set_ext_add_length(&priv->tmpl, NFT_SET_EXT_KEY, set->klen);