Skip to contentSkip to conversation

tests: hash:net,iface.t: check wildcard add and delete

PATCH New Florian Westphal 1 participant 1 message Nov 4 netfilter

lore
Share & tools
lore

Florian Westphal

author maintainer
#0 lore raw

PATCH 1/1 tests: hash:net,iface.t: check wildcard add and delete

The existing implementation allows to delete an element that was added with wildcard flag provided the key matches.

Check kernel doesn't require a wildcard flag to delete the element.

---
One more quirk worth testing for: check we can remove an element that had wildcard flag applied to it.

 tests/hash:net,iface.t | 7 +++++++
 1 file changed, 7 insertions(+)
tests/hash:net,iface.t +7 -0
index f1a36e33ff8f..9f3d9e36e232 100644
@@ -282,5 +282,12 @@
 0 ipset test test 10.0.5.0/24,eth0
 # Test a 2nd, unrelated interface matches the wildcard too.
 0 ipset test test 10.0.5.0/24,eth1
+0 ipset flush test
+# Add a wildcard-flagged element
+0 ipset add test 10.0.6.0/24,eth wildcard
+# Delete the element. ipset del does not expose a wildcard flag
+0 ipset del test 10.0.6.0/24,eth
+# Check the wildcard element was removed
+1 ipset test test 10.0.6.0/24,eth1
 0 ipset destroy test
 # eof
Signature · 1 line
2.56.0