]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests: check ifname use in concatenated sets
authorFlorian Westphal <fw@strlen.de>
Thu, 28 Jun 2018 00:16:38 +0000 (02:16 +0200)
committerFlorian Westphal <fw@strlen.de>
Sat, 7 Jul 2018 19:22:37 +0000 (21:22 +0200)
error was:
 nft create set inet filter keepalived_ranges4 { type inet_service . ifname \; }
 Error: Empty string is not allowed

This was fixed in
6b00b9537e181 ("evaluate: skip evaluation of datatype concatenations").

Signed-off-by: Florian Westphal <fw@strlen.de>
tests/shell/testcases/sets/0029named_ifname_dtype_0
tests/shell/testcases/sets/dumps/0029named_ifname_dtype_0.nft

index 532d892739f4d852f287e0ac13afb5f58df437ca..724f16676c2e9f5cb80dd81014ddbdf4304798c6 100755 (executable)
@@ -8,9 +8,15 @@ EXPECTED="table inet t {
                elements = { \"eth0\" }
        }
 
+       set sc {
+               type inet_service . ifname
+               elements = { \"ssh\" . \"eth0\" }
+       }
+
        chain c {
                iifname @s accept
                oifname @s accept
+               tcp dport . meta iifname @sc accept
        }
 }"
 
index 2c82e57d48e8119bba7f4f3a376a591cb3137011..23ff89bb90e4567f08ec5d412abca0c5a59b31a3 100644 (file)
@@ -4,8 +4,14 @@ table inet t {
                elements = { "eth0" }
        }
 
+       set sc {
+               type inet_service . ifname
+               elements = { 22 . "eth0" }
+       }
+
        chain c {
                iifname @s accept
                oifname @s accept
+               tcp dport . iifname @sc accept
        }
 }