This patch series introduces the use of variables in chain priority and policy specification. It also contains tests for invalid cases. Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=1172 Fernando Fernandez Mancera (2): src: allow variables in the chain priority specification src: allow variable in chain policy include/datatype.h | 1 + include/rule.h | 10 +- src/datatype.c | 26 ++++++ src/evaluate.c | 92 +++++++++++++++++-- src/json.c | 5 +- src/mnl.c | 9 +- src/netlink.c | 8 +- src/parser_bison.y | 45 +++++++-- src/parser_json.c | 17 +++- src/rule.c | 17 +++- .../testcases/nft-f/0021priority_variable_0 | 17 ++++ .../testcases/nft-f/0022priority_variable_0 | 17 ++++ .../testcases/nft-f/0023priority_variable_1 | 18 ++++ .../testcases/nft-f/0024priority_variable_1 | 18 ++++ .../testcases/nft-f/0025policy_variable_0 | 17 ++++ .../testcases/nft-f/0026policy_variable_0 | 17 ++++ .../testcases/nft-f/0027policy_variable_1 | 18 ++++ .../testcases/nft-f/0028policy_variable_1 | 18 ++++ .../nft-f/dumps/0021priority_variable_0.nft | 5 + .../nft-f/dumps/0022priority_variable_0.nft | 5 + .../nft-f/dumps/0025policy_variable_0.nft | 5 + .../nft-f/dumps/0026policy_variable_0.nft | 5 + 22 files changed, 350 insertions(+), 40 deletions(-) mode change 100644 => 100755 src/evaluate.c create mode 100755 tests/shell/testcases/nft-f/0021priority_variable_0 create mode 100755 tests/shell/testcases/nft-f/0022priority_variable_0 create mode 100755 tests/shell/testcases/nft-f/0023priority_variable_1 create mode 100755 tests/shell/testcases/nft-f/0024priority_variable_1 create mode 100755 tests/shell/testcases/nft-f/0025policy_variable_0 create mode 100755 tests/shell/testcases/nft-f/0026policy_variable_0 create mode 100755 tests/shell/testcases/nft-f/0027policy_variable_1 create mode 100755 tests/shell/testcases/nft-f/0028policy_variable_1 create mode 100644 tests/shell/testcases/nft-f/dumps/0021priority_variable_0.nft create mode 100644 tests/shell/testcases/nft-f/dumps/0022priority_variable_0.nft create mode 100644 tests/shell/testcases/nft-f/dumps/0025policy_variable_0.nft create mode 100644 tests/shell/testcases/nft-f/dumps/0026policy_variable_0.nft -- 2.20.1