]> granicus.if.org Git - ipset/commitdiff
Tests added to check ICMP/ICMPv6 type/code parsing
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Thu, 24 Nov 2011 15:49:54 +0000 (16:49 +0100)
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Thu, 24 Nov 2011 15:49:54 +0000 (16:49 +0100)
tests/hash:net,port.t
tests/hash:net,port.t.list0
tests/hash:net6,port.t
tests/hash:net6,port.t.list0

index b7bc8a3442bcf3cc86c3c875a92e00737983edb4..993893d772a1e7aa62f2dfcfc100f6671785c706 100644 (file)
 1 ipset test test 2.0.1.0,icmp:ping
 # Try to add IP address
 0 ipset add test 2.0.0.1,icmp:ping timeout 3
+# Add ICMP by type/code
+0 ipset add test 2.0.0.255,icmp:3/10
+# Test ICMP by type/code
+0 ipset test test 2.0.0.255,icmp:3/10
+# Test ICMP by name
+0 ipset test test 2.0.0.255,icmp:host-prohibited
 # List set
 0 ipset list test | sed 's/timeout ./timeout x/' > .foo0 && ./sort.sh .foo0
 # Check listing
index 4988d96a28f9c9feafa4214760ff36554a56e0c0..60244a01aacf2010a870ac2fc0d6d4c4a03a555d 100644 (file)
@@ -8,3 +8,4 @@ Members:
 192.168.68.64/27,tcp:8 timeout x
 2.0.0.0/24,icmp:echo-request timeout x
 2.0.0.1,icmp:echo-request timeout x
+2.0.0.255,icmp:host-prohibited timeout x
index 1638157251366280004d72fa3cab1c88c4c3d644..3b58523ecc9fd2e0958943c395b3f6dcb45b9094 100644 (file)
 1 ipset test test 3:0:0::1,tcp:8
 # Try to add IP address
 0 ipset add test 3:0:0::1,tcp:8
+# Add ICMPv6 by type/code
+0 ipset add test 192:168:68::95,icmpv6:1/4
+# Test ICMPv6 by type/code
+0 ipset test test 192:168:68::95,icmpv6:1/4
+# Test ICMPv6 by name
+0 ipset test test 192:168:68::95,icmpv6:port-unreachable
 # List set
 0 ipset list test | sed 's/timeout ./timeout x/' > .foo0 && ./sort.sh .foo0
 # Save set
index e66d2dfdf262e569e277ae1a799bfca12266d05d..f574d2c6f4c95d22e4a5bb4e551b77f6feaa0521 100644 (file)
@@ -5,6 +5,7 @@ Size in memory: 2328
 References: 0
 Members:
 192:160::/27,ipv6-icmp:echo-request timeout x
+192:168:68::95,ipv6-icmp:port-unreachable timeout x
 1:1:1::1,tcp:8 timeout x
 2::/24,tcp:8 timeout x
 3::1,tcp:8 timeout x