diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2022-12-10 23:36:39 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2022-12-12 10:33:39 +0100 |
commit | 6c0853b770a449103878a9fd32373e90fa5c6be2 (patch) | |
tree | 66f6ec4554c6b36e3d79ba7c8ebc9ecc1fa910e7 /src/scanner.l | |
parent | 9582a075ce9f387faf56edad688f26a322310019 (diff) |
scanner: match full comment line in case of tie
add element ip filter public_services {
# comment 1
tcp . 80 : jump log_accept,
# comment 2
tcp . 443 : jump log_accept,
}
still fails with the error message:
# nft -f filter_sets.ip
In file included from filter_sets.ip:63:1-42:
filter_sets.ip:4:12-12: Error: syntax error,
unexpected newline, expecting comma or '}'
# comment 2
^
flex honors the first rule found in case of tie, place comment_line
before comment rule.
Fixes: 931737a17198 ("scanner: munch full comment lines")
Reported-by: Jozsef Kadlecsik <kadlec@netfilter.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/scanner.l')
-rw-r--r-- | src/scanner.l | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/scanner.l b/src/scanner.l index e72a427a..7e8748f5 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -858,10 +858,10 @@ addrstring ({macaddr}|{ip4addr}|{ip6addr}) {tab}+ {space}+ -{comment} {comment_line} { reset_pos(yyget_extra(yyscanner), yylloc); } +{comment} <<EOF>> { update_pos(yyget_extra(yyscanner), yylloc, 1); |