summaryrefslogtreecommitdiffstats
path: root/tests/py/ip/sets.t
diff options
context:
space:
mode:
authorAnders K. Pedersen <akp@cohaesio.com>2017-10-04 14:27:45 +0000
committerPablo Neira Ayuso <pablo@netfilter.org>2017-10-06 14:57:47 +0200
commit22d2010109193e6ee201d7cd4e8aaf5cda4539a0 (patch)
treedd2ea386adcc05022d7cc5d847225c66106d40e4 /tests/py/ip/sets.t
parent68508628c497be54e935f28fe5b28e87d6d17368 (diff)
netlink_linearize: skip set element expression in set statement key
Before this patch the following fails: # nft add rule ip6 filter x \ set add ip6 saddr . ip6 daddr @test nft: netlink_linearize.c:648: netlink_gen_expr: Assertion `dreg < ctx->reg_low' failed. Aborted This is was previously fixed for flow statements in fbea4a6f4449 ("netlink_linearize: skip set element expression in flow table key"), and this patch implements the same change for set statements by using the set element key in netlink_gen_set_stmt(). nft-test.py is updated to support set types with concatenated data types in order to support testing of this. Signed-off-by: Anders K. Pedersen <akp@cohaesio.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests/py/ip/sets.t')
-rw-r--r--tests/py/ip/sets.t4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/py/ip/sets.t b/tests/py/ip/sets.t
index 4d14e825..b159ad8d 100644
--- a/tests/py/ip/sets.t
+++ b/tests/py/ip/sets.t
@@ -47,6 +47,10 @@ ip saddr != @set33 drop;fail
?set4 192.168.1.1;fail
?set4 192.168.3.0/24;ok
+!set5 type ipv4_addr . ipv4_addr;ok
+ip saddr . ip daddr @set5 drop;ok
+set add ip saddr . ip daddr @set5;ok
+
# test nested anonymous sets
ip saddr { { 1.1.1.0, 3.3.3.0 }, 2.2.2.0 };ok;ip saddr { 1.1.1.0, 2.2.2.0, 3.3.3.0 }
ip saddr { { 1.1.1.0/24, 3.3.3.0/24 }, 2.2.2.0/24 };ok;ip saddr { 1.1.1.0/24, 2.2.2.0/24, 3.3.3.0/24 }