diff options
author | Jeremy Sowden <jeremy@azazel.net> | 2021-12-21 19:36:49 +0000 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2022-01-15 17:02:39 +0100 |
commit | 99f1ef9abba353b0c33b4db21e8f45e4f638c5bf (patch) | |
tree | d4010c6c614557a172bb4b179f2bdc22ff85682e /tests/py/inet/ip_tcp.t.json.output | |
parent | 4b8e51ea5fc8556037c54e849bdb15de2e04e085 (diff) |
tests: py: fix inet/ip_tcp.t test
Contrary to the comment and expected output, nft does _not_ eliminate
the redundant `ip protocol` expression from the second test. Dependency
elimination requires a higher level expression. `ip saddr` cannot lead
to the elimination of `ip protocol` since they are both L3 expressions.
`tcp dport` cannot because although `ip saddr` and `ip protocol` both
imply that the L3 protocol is `ip`, only protocol matches are stored as
dependencies, so the redundancy is not apparent, and in fact,
`payload_may_dependency_kill` explicitly checks for the combination of
inet, bridge or netdev family, L4 expression and L3 ipv4 or ipv6
dependency and returns false.
Correct the expected output and comment.
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'tests/py/inet/ip_tcp.t.json.output')
-rw-r--r-- | tests/py/inet/ip_tcp.t.json.output | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/py/inet/ip_tcp.t.json.output b/tests/py/inet/ip_tcp.t.json.output index 4a6a05d7..acad8b1f 100644 --- a/tests/py/inet/ip_tcp.t.json.output +++ b/tests/py/inet/ip_tcp.t.json.output @@ -32,6 +32,18 @@ "match": { "left": { "payload": { + "field": "protocol", + "protocol": "ip" + } + }, + "op": "==", + "right": 6 + } + }, + { + "match": { + "left": { + "payload": { "field": "saddr", "protocol": "ip" } |