From e17337df677b1c90c4cbcc3c1576f0cbf13d5e9f Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Wed, 29 Jun 2022 18:40:00 +0200 Subject: evaluate: report missing interval flag when using prefix/range in concatenation If set declaration is missing the interval flag, and user specifies an element with either prefix or range, then bail out. Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=1592 Signed-off-by: Pablo Neira Ayuso --- tests/shell/testcases/sets/errors_0 | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests') diff --git a/tests/shell/testcases/sets/errors_0 b/tests/shell/testcases/sets/errors_0 index 569f4ab8..f2da43a0 100755 --- a/tests/shell/testcases/sets/errors_0 +++ b/tests/shell/testcases/sets/errors_0 @@ -38,4 +38,20 @@ create table inet filter set inet filter foo {} add element inet filter foo { foobar }" +$NFT -f - <<< $RULESET +if [ $? -eq 0 ] +then + exit 1 +fi + +RULESET="table ip x { + map x { + type ifname . ipv4_addr : verdict + elements = { if2 . 10.0.0.2 : jump chain2, + if2 . 192.168.0.0/24 : jump chain2 } + } + + chain chain2 {} +}" + $NFT -f - <<< $RULESET || exit 0 -- cgit v1.2.3