diff options
author | Florian Westphal <fw@strlen.de> | 2021-06-02 13:39:39 +0200 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2021-06-02 15:07:51 +0200 |
commit | c0b685951fabb2852d16cf62a1d1bf5b426e098c (patch) | |
tree | 9a8d59bcfd51ffe85c8c5b0960cdad02b1d230f0 /tests | |
parent | 790889957b48f4d28dc1699bd6c193617f2141b3 (diff) |
json: fix parse of flagcmp expression
The json test case for the flagcmp notation ('tcp flags syn,fin / syn,fin') fails with:
command: {"nftables": [{"add": {"rule": {"family": "ip", "table": "test-ip4", "chain": "input", "expr": [{"match": {"left": {"&": [{"payload": {"field": "flags", "protocol": "tcp"}}, ["fin", "syn"]]}, "op": "==", "right": ["fin", "syn"]}}]}}}]}
internal:0:0-0: Error: List expression only allowed on RHS or in statement expression.
internal:0:0-0: Error: Failed to parse RHS of binop expression.
internal:0:0-0: Error: Invalid LHS of relational.
internal:0:0-0: Error: Parsing expr array at index 0 failed.
internal:0:0-0: Error: Parsing command array at index 0 failed.
Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/py/inet/tcp.t.json | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/py/inet/tcp.t.json b/tests/py/inet/tcp.t.json index 922ab91c..b0455676 100644 --- a/tests/py/inet/tcp.t.json +++ b/tests/py/inet/tcp.t.json @@ -1749,3 +1749,30 @@ } } ] + +# tcp flags fin,syn / fin,syn +[ + { + "match": { + "left": { + "&": [ + { + "payload": { + "field": "flags", + "protocol": "tcp" + } + }, + [ + "fin", + "syn" + ] + ] + }, + "op": "==", + "right": [ + "fin", + "syn" + ] + } + } +] |