All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH ipset] tests: hash:net,iface.t: add test case for wildcard matching behaviour
@ 2026-10-28 13:02 Florian Westphal
  2026-11-15 16:39 ` Jozsef Kadlecsik
  2026-11-15 16:45 ` Jozsef Kadlecsik
  0 siblings, 2 replies; 6+ messages in thread
From: Florian Westphal @ 2026-10-28 13:02 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Jozsef Kadlecsik, Florian Westphal

Document the existing behaviour of wildcard matching.

Signed-off-by: Florian Westphal <fw@strlen.de>
---
 LLM generated.  Passes on nf, fails with
 rhashtable conversion patches.

 tests/hash:net,iface.t | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/tests/hash:net,iface.t b/tests/hash:net,iface.t
index 556d56df5c4b..b1d92bef26f8 100644
--- a/tests/hash:net,iface.t
+++ b/tests/hash:net,iface.t
@@ -235,4 +235,30 @@
 0 ipset list
 # Counters and timeout: destroy set
 0 ipset x test
+# Re-Create the set for wildcard tests.
+0 ipset create test hash:net,iface hashsize 128
+# Add a specific entry first, a wildcard entry for the same net second.
+0 ipset add test 10.0.1.0/24,eth0
+0 ipset add test 10.0.1.0/24,eth wildcard
+# Delete the specific entry.
+0 ipset del test 10.0.1.0/24,eth0
+# The wildcard entry should still be there and match eth1 via its prefix.
+0 ipset test test 10.0.1.0/24,eth1
+0 ipset flush test
+# Same layout: specific entry first, wildcard entry second.
+0 ipset add test 10.0.2.0/24,eth0
+0 ipset add test 10.0.2.0/24,eth wildcard
+# Re-add the specific entry with -exist, expecting a no-op refresh.
+0 ipset -exist add test 10.0.2.0/24,eth0
+# The wildcard entry should have survived the refresh and still match eth1.
+0 ipset test test 10.0.2.0/24,eth1
+0 ipset flush test
+# Add a nomatch exception first, a wildcard entry for the same net second.
+0 ipset add test 10.0.3.0/24,eth0 nomatch
+0 ipset add test 10.0.3.0/24,eth wildcard
+# eth1 isn't excluded, so the wildcard should match it.
+0 ipset test test 10.0.3.0/24,eth1
+# eth0 is excluded by the nomatch entry; it must not match via the wildcard.
+1 ipset test test 10.0.3.0/24,eth0
+0 ipset destroy test
 # eof
-- 
2.55.0


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

end of thread, other threads:[~2026-11-17 17:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-28 13:02 [PATCH ipset] tests: hash:net,iface.t: add test case for wildcard matching behaviour Florian Westphal
2026-11-15 16:39 ` Jozsef Kadlecsik
2026-11-15 18:21   ` Florian Westphal
2026-11-17 16:26     ` Jozsef Kadlecsik
2026-11-17 17:10       ` Florian Westphal
2026-11-15 16:45 ` Jozsef Kadlecsik

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.