netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH nft] tests: shell: Add test for set element leak bug
@ 2017-01-19 16:29 Elise Lennion
  2017-01-23 13:39 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 2+ messages in thread
From: Elise Lennion @ 2017-01-19 16:29 UTC (permalink / raw)
  To: pablo; +Cc: netfilter-devel

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 | 11 +++++++++++
 1 file changed, 11 insertions(+)
 create mode 100755 tests/shell/testcases/sets/0016element_leak_0

diff --git a/tests/shell/testcases/sets/0016element_leak_0 b/tests/shell/testcases/sets/0016element_leak_0
new file mode 100755
index 0000000..5675db3
--- /dev/null
+++ b/tests/shell/testcases/sets/0016element_leak_0
@@ -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}
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH nft] tests: shell: Add test for set element leak bug
  2017-01-19 16:29 [PATCH nft] tests: shell: Add test for set element leak bug Elise Lennion
@ 2017-01-23 13:39 ` Pablo Neira Ayuso
  0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2017-01-23 13:39 UTC (permalink / raw)
  To: Elise Lennion; +Cc: netfilter-devel

On Thu, Jan 19, 2017 at 02:29:47PM -0200, Elise Lennion wrote:
> 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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-01-23 13:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-19 16:29 [PATCH nft] tests: shell: Add test for set element leak bug Elise Lennion
2017-01-23 13:39 ` Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).