]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests/py: Fix JSON for icmp*.t
authorPhil Sutter <phil@nwl.cc>
Tue, 11 Sep 2018 20:14:27 +0000 (22:14 +0200)
committerFlorian Westphal <fw@strlen.de>
Thu, 13 Sep 2018 08:43:05 +0000 (10:43 +0200)
A recent change to ip/icmp.t and ip6/icmpv6.t did not update JSON
equivalents accordingly, fix this.

Fixes: 0f44d4f627535 ("proto: fix icmp/icmpv6 code datatype")
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Florian Westphal <fw@strlen.de>
tests/py/ip/icmp.t.json
tests/py/ip/icmp.t.json.output
tests/py/ip6/icmpv6.t.json
tests/py/ip6/icmpv6.t.json.output

index 918621cb99027fc7226038d9b20de7a8ffe8e42e..4e17274587791e2f881130fdc2aaed8c12d4aa3f 100644 (file)
     }
 ]
 
-# icmp code != { 2, 4, 54, 33, 56}
+# icmp code != { prot-unreachable, 4, 33, 54, 56}
 [
     {
         "match": {
             "op": "!=",
             "right": {
                 "set": [
-                    2,
+                    "prot-unreachable",
                     4,
                     33,
                     54,
index 30637a1345945ca2df605ae35447e65f3ab45f63..e8045bb8182e0177b882c38d762ffe203eb593ac 100644 (file)
     }
 ]
 
+# icmp code { 2, 4, 54, 33, 56}
+[
+    {
+        "match": {
+            "left": {
+                "payload": {
+                    "field": "code",
+                    "protocol": "icmp"
+                }
+            },
+            "op": "==",
+            "right": {
+                "set": [
+                    "prot-unreachable",
+                    4,
+                    33,
+                    54,
+                    56
+                ]
+            }
+        }
+    }
+]
+
 # icmp checksum { 1111, 222, 343} accept
 [
     {
index 73b9277ae9872004aa81b631f19a228cb51e11e7..f6cfbf172f562022b6a2ea4d39fc455ed1406316 100644 (file)
     }
 ]
 
-# icmpv6 code != {5, 6, 7} accept
+# icmpv6 code != {policy-fail, reject-route, 7} accept
 [
     {
         "match": {
             "op": "!=",
             "right": {
                 "set": [
-                    5,
-                    6,
+                    "policy-fail",
+                    "reject-route",
                     7
                 ]
             }
index 472b2ce74133bff91970754b7e716e9a13c48bfc..17032a03d80bd66c825566480e688457ed1ce7d4 100644 (file)
     }
 ]
 
+# icmpv6 code 4
+[
+    {
+        "match": {
+            "left": {
+                "payload": {
+                    "field": "code",
+                    "protocol": "icmpv6"
+                }
+            },
+           "op": "==",
+            "right": "port-unreachable"
+        }
+    }
+]
+
+# icmpv6 code {5, 6, 7} accept
+[
+    {
+        "match": {
+            "left": {
+                "payload": {
+                    "field": "code",
+                    "protocol": "icmpv6"
+                }
+            },
+           "op": "==",
+            "right": {
+                "set": [
+                    "policy-fail",
+                    "reject-route",
+                    7
+                ]
+            }
+        }
+    },
+    {
+        "accept": null
+    }
+]