diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2020-03-31 13:36:16 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2020-03-31 13:50:59 +0200 |
commit | 673d82af234e24ef841e8409426d5f082f9ea59e (patch) | |
tree | 97c79a625b4302ea89d046eea63c1f42a5ad2366 /src/parser_bison.y | |
parent | d6ac64f92dfca5da4d07989114a4aa46e1322453 (diff) |
rule: add hook_spec
Store location of chain hook definition.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/parser_bison.y')
-rw-r--r-- | src/parser_bison.y | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/parser_bison.y b/src/parser_bison.y index 9976bcaf..ebaef17c 100644 --- a/src/parser_bison.y +++ b/src/parser_bison.y @@ -1877,8 +1877,9 @@ flowtable_block : /* empty */ { $$ = $<flowtable>-1; } | flowtable_block stmt_separator | flowtable_block HOOK STRING prio_spec stmt_separator { - $$->hookstr = chain_hookname_lookup($3); - if ($$->hookstr == NULL) { + $$->hook.loc = @3; + $$->hook.name = chain_hookname_lookup($3); + if ($$->hook.name == NULL) { erec_queue(error(&@3, "unknown chain hook %s", $3), state->msgs); xfree($3); @@ -2056,8 +2057,9 @@ hook_spec : TYPE STRING HOOK STRING dev_spec prio_spec $<chain>0->type = xstrdup(chain_type); xfree($2); - $<chain>0->hookstr = chain_hookname_lookup($4); - if ($<chain>0->hookstr == NULL) { + $<chain>0->hook.loc = @4; + $<chain>0->hook.name = chain_hookname_lookup($4); + if ($<chain>0->hook.name == NULL) { erec_queue(error(&@4, "unknown chain hook %s", $4), state->msgs); xfree($4); |