]> git.ipfire.org Git - thirdparty/nftables.git/commit
Revert "scanner: flags: move to own scope"
authorFlorian Westphal <fw@strlen.de>
Fri, 10 Jun 2022 11:01:46 +0000 (13:01 +0200)
committerFlorian Westphal <fw@strlen.de>
Fri, 10 Jun 2022 11:09:11 +0000 (13:09 +0200)
commit638af0ceb2b22307098bb2730822e148ef0b9424
treeec439ae301850e2f531d5edc7de19872f6921542
parent3eb0da9f47b10d4a98e9150e0fd67d8f616250f9
Revert "scanner: flags: move to own scope"

Excess nesting of scanner scopes is very fragile and error prone:

rule `iif != lo ip daddr 127.0.0.1/8 counter limit rate 1/second log flags all prefix "nft_lo4 " drop`
fails with `Error: No symbol type information` hinting at `prefix`

Problem is that we nest via:
 counter
   limit
     log
    flags

By the time 'prefix' is scanned, state is still stuck in 'counter' due
to this nesting.  Working around "prefix" isn't enough, any other
keyword, e.g. "level" in 'flags all level debug' will be parsed as 'string' too.

So, revert this.

Fixes: a16697097e2b ("scanner: flags: move to own scope")
Reported-by: Christian Göttsche <cgzones@googlemail.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
include/parser.h
src/parser_bison.y
src/scanner.l
tests/shell/testcases/parsing/log [new file with mode: 0755]