tests: hash:net,iface.t: check wildcard refresh ordering
Florian Westphal
maintainerPATCH 1/1 tests: hash:net,iface.t: check wildcard refresh ordering
When the first wildcard element gets re-added while '-exist (-!)' option is given that request must not have side effects.
Check that the verdict isn't altered.
Signed-off-by Florian Westphal <[email protected]>
---
Yet another problem with the rewrite.
tests/hash:net,iface.t | 12 ++++++++++++ 1 file changed, 12 insertions(+)
tests/hash:net,iface.t +12 -0
@@ -289,5 +289,17 @@ 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 flush test +# Wildcard refresh ordering: add first wildcard, marked nomatch +0 ipset add test 10.0.0.0/24,eth wildcard nomatch +# Wildcard refresh ordering: add second, overlapping wildcard, matching +0 ipset add test 10.0.0.0/24,et wildcard +# Wildcard refresh ordering: first-added wildcard must win: nomatch verdict +1 ipset test test 10.0.0.1,eth0 +# Wildcard refresh ordering: refresh the first wildcard with -exist, data unchanged +0 ipset -! add test 10.0.0.0/24,eth wildcard nomatch +# Wildcard refresh ordering: verdict must still be nomatch. +1 ipset test test 10.0.0.1,eth0 +# Wildcard refresh ordering: destroy set 0 ipset destroy test # eof
Signature · 1 line
2.56.0
Hi Florian,
Quoted 17 lines · Florian Westphal
When the first wildcard element gets re-added while '-exist (-!)' option is given that request must not have side effects.
Check that the verdict isn't altered.
Signed-off-by Florian Westphal <[email protected]>---
Yet another problem with the rewrite.tests/hash:net,iface.t | 12 ++++++++++++ 1 file changed, 12 insertions(+)tests/hash:net,iface.t +0
-0
tests/hash:net,iface.t line 298
Quoted 10 lines
tests/hash:net,iface.t +7
-0@@ -289,5 +289,17 @@ 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 flush test +# Wildcard refresh ordering: add first wildcard, marked nomatch +0 ipset add test 10.0.0.0/24,eth wildcard nomatch +# Wildcard refresh ordering: add second, overlapping wildcard, matching +0 ipset add test 10.0.0.0/24,et wildcard +# Wildcard refresh ordering: first-added wildcard must win: nomatch verdict +1 ipset test test 10.0.0.1,eth0
This also not handled with the current code: the wildcards are not ordered in the more-specific, then less specific order.
tests/hash:net,iface.t line 305
Quoted 7 lines
tests/hash:net,iface.t +5
-0+# Wildcard refresh ordering: refresh the first wildcard with -exist, data unchanged +0 ipset -! add test 10.0.0.0/24,eth wildcard nomatch +# Wildcard refresh ordering: verdict must still be nomatch. +1 ipset test test 10.0.0.1,eth0 +# Wildcard refresh ordering: destroy set 0 ipset destroy test # eof
Best regards,
Jozsef
Signature · 3 lines
E-mail : [email protected], [email protected], [email protected] Address: Wigner Research Centre for Physics H-1525 Budapest 114, POB. 49, Hungary