From: Jozsef Kadlecsik Date: Fri, 12 Jan 2018 09:42:40 +0000 (+0100) Subject: Add test to verify wraparound fix X-Git-Tag: v6.36~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a7726d76253778e35ab3848a1fd1ae616c737164;p=ipset Add test to verify wraparound fix --- diff --git a/tests/hash:net,port.t b/tests/hash:net,port.t index 3c154f9..5424ff7 100644 --- a/tests/hash:net,port.t +++ b/tests/hash:net,port.t @@ -74,6 +74,12 @@ 0 ipset add test 10.0.0.0-10.0.2.255,tcp:80-1105 # Check that correct number of elements are added 0 n=`ipset list test|grep '^10.0'|wc -l` && test $n -eq 2052 +# Flush set +0 ipset flush test +# Add range to verify wraparound does not happen +0 ipset add test 255.255.255.253-255.255.255.255,tcp:65534-65535 +# Check that correct number of elements are added +0 n=`ipset list test|grep '^255.255.255'|wc -l` && test $n -eq 4 # Destroy set 0 ipset -X test # Create test set with timeout support