diff options
author | Florian Westphal <fw@strlen.de> | 2021-02-01 22:44:25 +0100 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2021-02-01 22:47:04 +0100 |
commit | 3eb14fd93093c5e084d3ac1c4b0171cf80fb264f (patch) | |
tree | d7e9bbb91f3e21346f159ab0dae50e28b3a7fec7 /tests/py/ip | |
parent | 5789da3b729f5e3724aeecdcec1a44476659ed03 (diff) |
tests: add icmp/6 test where dependency should be left alone
These tests fail: nft should leave the type as-is.
Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'tests/py/ip')
-rw-r--r-- | tests/py/ip/icmp.t | 2 | ||||
-rw-r--r-- | tests/py/ip/icmp.t.json | 28 | ||||
-rw-r--r-- | tests/py/ip/icmp.t.payload.ip | 6 |
3 files changed, 36 insertions, 0 deletions
diff --git a/tests/py/ip/icmp.t b/tests/py/ip/icmp.t index c22b55eb..11f3662e 100644 --- a/tests/py/ip/icmp.t +++ b/tests/py/ip/icmp.t @@ -86,3 +86,5 @@ icmp gateway != { 33-55};ok icmp gateway != 34;ok icmp gateway != { 333, 334};ok +icmp code 1 icmp type 2;ok;icmp type 2 icmp code host-unreachable +icmp code != 1 icmp type 2 icmp mtu 5;fail diff --git a/tests/py/ip/icmp.t.json b/tests/py/ip/icmp.t.json index 9691f072..12b53b0f 100644 --- a/tests/py/ip/icmp.t.json +++ b/tests/py/ip/icmp.t.json @@ -1843,3 +1843,31 @@ } } ] + +# icmp code 1 icmp type 2 +[ + { + "match": { + "left": { + "payload": { + "field": "type", + "protocol": "icmp" + } + }, + "op": "==", + "right": 2 + } + }, + { + "match": { + "left": { + "payload": { + "field": "code", + "protocol": "icmp" + } + }, + "op": "==", + "right": "host-unreachable" + } + } +] diff --git a/tests/py/ip/icmp.t.payload.ip b/tests/py/ip/icmp.t.payload.ip index d75d12a0..97464a08 100644 --- a/tests/py/ip/icmp.t.payload.ip +++ b/tests/py/ip/icmp.t.payload.ip @@ -787,3 +787,9 @@ ip test-ip4 input [ lookup reg 1 set __set%d ] [ immediate reg 0 accept ] +# icmp code 1 icmp type 2 +ip + [ meta load l4proto => reg 1 ] + [ cmp eq reg 1 0x00000001 ] + [ payload load 2b @ transport header + 0 => reg 1 ] + [ cmp eq reg 1 0x00000102 ] |