summaryrefslogtreecommitdiffstats
path: root/src/evaluate.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2019-06-17 12:03:08 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2019-06-17 19:54:57 +0200
commit01e5c6f0ed0315046537612f5a80e506d37a7f8e (patch)
tree5e6dc94860d876f6851808812c59d83935c6c689 /src/evaluate.c
parenta331eca90d25a1bc519a5a3a53d72a982cedb029 (diff)
src: add cache level flags
The score approach based on command type is confusing. This patch introduces cache level flags, each flag specifies what kind of object type is needed. These flags are set on/off depending on the list of commands coming in this batch. cache_is_complete() now checks if the cache contains the objects that are needed through these new flags. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/evaluate.c')
-rw-r--r--src/evaluate.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/evaluate.c b/src/evaluate.c
index 73a4be33..511f9f14 100644
--- a/src/evaluate.c
+++ b/src/evaluate.c
@@ -29,6 +29,7 @@
#include <netlink.h>
#include <time.h>
#include <rule.h>
+#include <cache.h>
#include <erec.h>
#include <gmputil.h>
#include <utils.h>
@@ -3294,7 +3295,7 @@ static int rule_evaluate(struct eval_ctx *ctx, struct rule *rule,
}
/* add rules to cache only if it is complete enough to contain them */
- if (!cache_is_complete(&ctx->nft->cache, CMD_LIST))
+ if (!cache_is_complete(&ctx->nft->cache, NFT_CACHE_RULE))
return 0;
return rule_cache_update(ctx, op);