]> git.ipfire.org Git - thirdparty/nftables.git/commit
src: allow variables in the chain priority specification
authorFernando Fernandez Mancera <ffmancera@riseup.net>
Fri, 2 Aug 2019 10:12:08 +0000 (12:12 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 8 Aug 2019 10:32:48 +0000 (12:32 +0200)
commit627c451b2351310da9ad82dbdb64747b1fada8e5
treea049c393ec78296bd014d807943c573c75695e81
parent45cb29a2ada4edfc2b547fe023d923ce0299a61d
src: allow variables in the chain priority specification

This patch allows you to use variables in chain priority definitions,
e.g.

define prio = filter
define prionum = 10
define prioffset = "filter - 150"

add table ip foo
add chain ip foo bar { type filter hook input priority $prio; }
add chain ip foo ber { type filter hook input priority $prionum; }
add chain ip foo bor { type filter hook input priority $prioffset; }

Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
16 files changed:
include/datatype.h
include/rule.h
src/datatype.c
src/evaluate.c [changed mode: 0644->0755]
src/json.c
src/mnl.c
src/netlink.c
src/parser_bison.y
src/parser_json.c
src/rule.c
tests/shell/testcases/nft-f/0021priority_variable_0 [new file with mode: 0755]
tests/shell/testcases/nft-f/0022priority_variable_0 [new file with mode: 0755]
tests/shell/testcases/nft-f/0023priority_variable_1 [new file with mode: 0755]
tests/shell/testcases/nft-f/0024priority_variable_1 [new file with mode: 0755]
tests/shell/testcases/nft-f/dumps/0021priority_variable_0.nft [new file with mode: 0644]
tests/shell/testcases/nft-f/dumps/0022priority_variable_0.nft [new file with mode: 0644]