Skip to contentSkip to conversation

tests: shell: Add test for set element leak bug

PATCH Applied Elise Lennion 2 participants 2 messages Jan 19, 2017 – Jan 23, 2017 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests: shell: Add test for set element leak bug

This tests for a bug where a repeated element is added and the set elements counter is incorrectly increased.

---
 tests/shell/testcases/sets/0016element_leak_0 | 11 +++++++++++
 1 file changed, 11 insertions(+)
 create mode 100755 tests/shell/testcases/sets/0016element_leak_0
tests/shell/testcases/sets/0016element_leak_0 new file +11 -0
new file mode 100755
index 0000000..5675db3
@@ -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}
Signature · 1 line
2.7.4
maintainer Applied
#1 lore raw
Quoted 2 lines · Elise Lennion

This tests for a bug where a repeated element is added and the set elements counter is incorrectly increased.

Applied, thanks.

It would be good to have another test to catch the 'nft flush set x y' bug that you uncover, this requires the kernel patches I sent to cure this problem.