]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests: icmp, icmpv6: check we don't add second dependency
authorFlorian Westphal <fw@strlen.de>
Wed, 9 Dec 2020 17:43:16 +0000 (18:43 +0100)
committerFlorian Westphal <fw@strlen.de>
Wed, 9 Dec 2020 17:44:45 +0000 (18:44 +0100)
If dependency is already fulfilled, do not add another one.

Signed-off-by: Florian Westphal <fw@strlen.de>
tests/py/ip/icmp.t
tests/py/ip/icmp.t.payload.ip
tests/py/ip6/icmpv6.t
tests/py/ip6/icmpv6.t.payload.ip6

index 996e1fc321e43d7f2f8e254dfe6416c5af50086d..c22b55eb1e3f479d06bbc7f13e61c4210692e15a 100644 (file)
@@ -60,6 +60,7 @@ icmp sequence != { 33, 55, 67, 88};ok;icmp type { echo-request, echo-reply} icmp
 icmp sequence { 33-55};ok;icmp type { echo-request, echo-reply} icmp sequence { 33-55}
 icmp sequence != { 33-55};ok;icmp type { echo-request, echo-reply} icmp sequence != { 33-55}
 icmp id 1 icmp sequence 2;ok;icmp type { echo-reply, echo-request} icmp id 1 icmp sequence 2
+icmp type { echo-reply, echo-request} icmp id 1 icmp sequence 2;ok
 
 icmp mtu 33;ok
 icmp mtu 22-33;ok
index e238c4bb142c4bec476a8f6c7dbfecaf9ffede51..d75d12a0612528fb76d19950a63efbecac73291b 100644 (file)
@@ -514,6 +514,18 @@ ip
   [ payload load 4b @ transport header + 4 => reg 1 ]
   [ cmp eq reg 1 0x02000100 ]
 
+# icmp type { echo-reply, echo-request} icmp id 1 icmp sequence 2
+__set%d test-ip4 3
+__set%d test-ip4 0
+       element 00000000  : 0 [end]     element 00000008  : 0 [end]
+ip 
+  [ meta load l4proto => reg 1 ]
+  [ cmp eq reg 1 0x00000001 ]
+  [ payload load 1b @ transport header + 0 => reg 1 ]
+  [ lookup reg 1 set __set%d ]
+  [ payload load 4b @ transport header + 4 => reg 1 ]
+  [ cmp eq reg 1 0x02000100 ]
+
 # icmp mtu 33
 ip test-ip4 input
   [ meta load l4proto => reg 1 ]
index 67fa6ca8490f39fd6a1c1e1f72864e58136a5c43..8b411a8bf4392c4c77a79499f46bf32f956c36ef 100644 (file)
@@ -66,6 +66,7 @@ icmpv6 mtu {33, 55, 67, 88};ok
 icmpv6 mtu != {33, 55, 67, 88};ok
 icmpv6 mtu {33-55};ok
 icmpv6 mtu != {33-55};ok
+icmpv6 type packet-too-big icmpv6 mtu 1280;ok;icmpv6 mtu 1280
 
 icmpv6 id 33-45;ok;icmpv6 type { echo-request, echo-reply} icmpv6 id 33-45
 icmpv6 id != 33-45;ok;icmpv6 type { echo-request, echo-reply} icmpv6 id != 33-45
index 406bdd6dab934f470ffa95411d32da7f81570485..171b7eade6d3ec6911392ccef05f470b4bb30696 100644 (file)
@@ -408,6 +408,15 @@ ip6 test-ip6 input
   [ payload load 4b @ transport header + 4 => reg 1 ]
   [ lookup reg 1 set __set%d 0x1 ]
 
+# icmpv6 type packet-too-big icmpv6 mtu 1280
+ip6 
+  [ meta load l4proto => reg 1 ]
+  [ cmp eq reg 1 0x0000003a ]
+  [ payload load 1b @ transport header + 0 => reg 1 ]
+  [ cmp eq reg 1 0x00000002 ]
+  [ payload load 4b @ transport header + 4 => reg 1 ]
+  [ cmp eq reg 1 0x00050000 ]
+
 # icmpv6 id 33-45
 __set%d test-ip6 3
 __set%d test-ip6 0