]> git.ipfire.org Git - thirdparty/nftables.git/commit
src: allow for variables in the log prefix string
authorPablo Neira Ayuso <pablo@netfilter.org>
Tue, 7 Jul 2020 15:42:37 +0000 (17:42 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 8 Jul 2020 09:25:25 +0000 (11:25 +0200)
commite76bb379401816bbea773e73b524cd747324760a
tree226b13363d4c3ecc36919645cf94c82e16733661
parent8f56db64be3f2c57a196a5eaef0286ec71782950
src: allow for variables in the log prefix string

For example:

 define test = "state"
 define foo = "match"

 table x {
        chain y {
                ct state invalid log prefix "invalid $test $foo:"
        }
 }

This patch scans for variables in the log prefix string. The log prefix
expression is a list of constant and variable expression that are
converted into a constant expression from the evaluation phase.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/evaluate.c
src/parser_bison.y
tests/shell/testcases/optionals/dumps/log_prefix_0.nft [new file with mode: 0644]
tests/shell/testcases/optionals/log_prefix_0 [new file with mode: 0755]