]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests: shell: Add test for set element leak bug
authorElise Lennion <elise.lennion@gmail.com>
Thu, 19 Jan 2017 16:29:47 +0000 (14:29 -0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 23 Jan 2017 13:24:40 +0000 (14:24 +0100)
This tests for a bug where a repeated element is added and the set
elements counter is incorrectly increased.

Signed-off-by: Elise Lennion <elise.lennion@gmail.com>
tests/shell/testcases/sets/0016element_leak_0 [new file with mode: 0755]

diff --git a/tests/shell/testcases/sets/0016element_leak_0 b/tests/shell/testcases/sets/0016element_leak_0
new file mode 100755 (executable)
index 0000000..5675db3
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+# This tests for a bug where a repeated element is added and the set
+# elements counter is incorrectly increased.
+
+set -e
+$NFT add table x
+$NFT add set x s {type ipv4_addr\; size 2\;}
+$NFT add element x s {1.1.1.1}
+$NFT add element x s {1.1.1.1}
+$NFT add element x s {1.1.1.1}