summaryrefslogtreecommitdiffstats
path: root/src/libnftables.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/libnftables.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/libnftables.c')
-rw-r--r--src/libnftables.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libnftables.c b/src/libnftables.c
index abd133be..dccb8ab4 100644
--- a/src/libnftables.c
+++ b/src/libnftables.c
@@ -381,11 +381,11 @@ static int nft_parse_bison_filename(struct nft_ctx *nft, const char *filename,
static int nft_evaluate(struct nft_ctx *nft, struct list_head *msgs,
struct list_head *cmds)
{
- unsigned int completeness;
+ unsigned int flags;
struct cmd *cmd;
- completeness = cache_evaluate(nft, cmds);
- if (cache_update(nft, completeness, msgs) < 0)
+ flags = cache_evaluate(nft, cmds);
+ if (cache_update(nft, flags, msgs) < 0)
return -1;
list_for_each_entry(cmd, cmds, list) {