summaryrefslogtreecommitdiffstats
path: root/src/evaluate.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2020-03-31 13:36:16 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2020-03-31 13:50:59 +0200
commit673d82af234e24ef841e8409426d5f082f9ea59e (patch)
tree97c79a625b4302ea89d046eea63c1f42a5ad2366 /src/evaluate.c
parentd6ac64f92dfca5da4d07989114a4aa46e1322453 (diff)
rule: add hook_spec
Store location of chain hook definition. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/evaluate.c')
-rw-r--r--src/evaluate.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/evaluate.c b/src/evaluate.c
index 8b03e1f3..759cdaaf 100644
--- a/src/evaluate.c
+++ b/src/evaluate.c
@@ -3568,11 +3568,11 @@ static int flowtable_evaluate(struct eval_ctx *ctx, struct flowtable *ft)
if (table == NULL)
return table_not_found(ctx);
- ft->hooknum = str2hooknum(NFPROTO_NETDEV, ft->hookstr);
- if (ft->hooknum == NF_INET_NUMHOOKS)
- return chain_error(ctx, ft, "invalid hook %s", ft->hookstr);
+ ft->hook.num = str2hooknum(NFPROTO_NETDEV, ft->hook.name);
+ if (ft->hook.num == NF_INET_NUMHOOKS)
+ return chain_error(ctx, ft, "invalid hook %s", ft->hook.name);
- if (!evaluate_priority(ctx, &ft->priority, NFPROTO_NETDEV, ft->hooknum))
+ if (!evaluate_priority(ctx, &ft->priority, NFPROTO_NETDEV, ft->hook.num))
return __stmt_binary_error(ctx, &ft->priority.loc, NULL,
"invalid priority expression %s.",
expr_name(ft->priority.expr));
@@ -3783,14 +3783,14 @@ static int chain_evaluate(struct eval_ctx *ctx, struct chain *chain)
}
if (chain->flags & CHAIN_F_BASECHAIN) {
- chain->hooknum = str2hooknum(chain->handle.family,
- chain->hookstr);
- if (chain->hooknum == NF_INET_NUMHOOKS)
+ chain->hook.num = str2hooknum(chain->handle.family,
+ chain->hook.name);
+ if (chain->hook.num == NF_INET_NUMHOOKS)
return chain_error(ctx, chain, "invalid hook %s",
- chain->hookstr);
+ chain->hook.name);
if (!evaluate_priority(ctx, &chain->priority,
- chain->handle.family, chain->hooknum))
+ chain->handle.family, chain->hook.num))
return __stmt_binary_error(ctx, &chain->priority.loc, NULL,
"invalid priority expression %s in this context.",
expr_name(chain->priority.expr));