summaryrefslogtreecommitdiffstats
path: root/src/libnftables.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libnftables.c')
-rw-r--r--src/libnftables.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libnftables.c b/src/libnftables.c
index f459ecd5..4bb770c0 100644
--- a/src/libnftables.c
+++ b/src/libnftables.c
@@ -381,8 +381,13 @@ 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;
struct cmd *cmd;
+ completeness = cache_evaluate(nft, cmds);
+ if (cache_update(nft, completeness, msgs) < 0)
+ return -1;
+
list_for_each_entry(cmd, cmds, list) {
struct eval_ctx ectx = {
.nft = nft,
@@ -454,10 +459,6 @@ int nft_run_cmd_from_filename(struct nft_ctx *nft, const char *filename)
LIST_HEAD(msgs);
LIST_HEAD(cmds);
- rc = cache_update(nft, CMD_INVALID, &msgs);
- if (rc < 0)
- return -1;
-
if (!strcmp(filename, "-"))
filename = "/dev/stdin";