]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests: py: any/tcpopt.t.json: Fix JSON equivalent
authorPhil Sutter <phil@nwl.cc>
Wed, 8 Oct 2025 21:46:34 +0000 (23:46 +0200)
committerPhil Sutter <phil@nwl.cc>
Thu, 23 Oct 2025 20:48:51 +0000 (22:48 +0200)
Set element ordering differed from the rule in standard syntax.

Fixes: d199cca92f9eb ("expression: expr_build_udata_recurse should recurse")
Signed-off-by: Phil Sutter <phil@nwl.cc>
tests/py/any/tcpopt.t.json
tests/py/any/tcpopt.t.json.output

index e712a5e0ed56f5470c1941139adaa0593d368340..65fa1de50eea0a23e023dfd78d837489f1d5f823 100644 (file)
                     },
                     {
                         "concat": [
-                            "remove-addr",
-                            300
+                            "mp-join",
+                            100
                         ]
                     },
                     {
                         "concat": [
-                            "mp-fastclose",
-                            600
+                            "add-addr",
+                            200
                         ]
                     },
                     {
                         "concat": [
-                            "mp-join",
-                            100
+                            "remove-addr",
+                            300
                         ]
                     },
                     {
                     },
                     {
                         "concat": [
-                            "mp-tcprst",
-                            700
+                            "mp-fail",
+                            500
                         ]
                     },
                     {
                         "concat": [
-                            "add-addr",
-                            200
+                            "mp-fastclose",
+                            600
                         ]
                     },
                     {
                         "concat": [
-                            "mp-fail",
-                            500
+                            "mp-tcprst",
+                            700
                         ]
                     }
                 ]
index ad0d25f4d56c63b6eb68c916ce7da43febec91b3..ae979e7747762aacd214c8a7fce43af4a3e76172 100644 (file)
     }
 ]
 
+# tcp option mptcp subtype . tcp dport { mp-capable . 10, mp-join . 100, add-addr . 200, remove-addr . 300, mp-prio . 400, mp-fail . 500, mp-fastclose . 600, mp-tcprst . 700 }
+[
+    {
+        "match": {
+            "left": {
+                "concat": [
+                    {
+                        "tcp option": {
+                            "field": "subtype",
+                            "name": "mptcp"
+                        }
+                    },
+                    {
+                        "payload": {
+                            "field": "dport",
+                            "protocol": "tcp"
+                        }
+                    }
+                ]
+            },
+            "op": "==",
+            "right": {
+                "set": [
+                    {
+                        "concat": [
+                            "mp-capable",
+                            10
+                        ]
+                    },
+                    {
+                        "concat": [
+                            "remove-addr",
+                            300
+                        ]
+                    },
+                    {
+                        "concat": [
+                            "mp-fastclose",
+                            600
+                        ]
+                    },
+                    {
+                        "concat": [
+                            "mp-join",
+                            100
+                        ]
+                    },
+                    {
+                        "concat": [
+                            "mp-prio",
+                            400
+                        ]
+                    },
+                    {
+                        "concat": [
+                            "mp-tcprst",
+                            700
+                        ]
+                    },
+                    {
+                        "concat": [
+                            "add-addr",
+                            200
+                        ]
+                    },
+                    {
+                        "concat": [
+                            "mp-fail",
+                            500
+                        ]
+                    }
+                ]
+            }
+        }
+    }
+]