summaryrefslogtreecommitdiffstats
path: root/tests/shell/testcases/nft-f/0010variable_0
Commit message (Collapse)AuthorAgeFilesLines
* parser_bison: allow to use variable to add/create/delete elementsPablo Neira Ayuso2016-10-211-0/+22
Using variable definitions from element command doesn't work, eg. -test.nft- define whitelist_v4 = { 1.1.1.1 } table inet filter { set whitelist_v4 { type ipv4_addr; } } add element inet filter whitelist_v4 $whitelist_v4 -EOF- # nft -f test.nft test.nft:7:38-38: Error: syntax error, unexpected '$', expecting '{' add element inet filter whitelist_v4 $whitelist_v4 ^ Fix this by using set_block_expr rule for every element command. This patch also comes with a new regression test. Reported-by: Leon Merten Lohse <leon@green-side.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>