summaryrefslogtreecommitdiffstats
path: root/tests/py/ip/ip.t.payload.inet
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2017-08-16 16:12:37 +0200
committerFlorian Westphal <fw@strlen.de>2017-08-17 12:30:23 +0200
commit96c1346d5c230d2c381b9c1c9e8e2b30d3915ea1 (patch)
tree551b5e6c60356b63b1d7b40daee26e38168fa6ae /tests/py/ip/ip.t.payload.inet
parent63c504cd3c0dbecbe226fbef970e700130367214 (diff)
tests: add test case for ttl/protocol set
nft .. ip ttl set 42 did set the protocol field and left ttl alone, add test cases for this. Signed-off-by: Florian Westphal <fw@strlen.de> Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests/py/ip/ip.t.payload.inet')
-rw-r--r--tests/py/ip/ip.t.payload.inet20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/py/ip/ip.t.payload.inet b/tests/py/ip/ip.t.payload.inet
index 64606d95..ef6725eb 100644
--- a/tests/py/ip/ip.t.payload.inet
+++ b/tests/py/ip/ip.t.payload.inet
@@ -750,3 +750,23 @@ inet test-inet input
[ bitwise reg 1 = (reg=1 & 0x000003ff ) ^ 0x00000000 ]
[ payload write reg 1 => 2b @ network header + 0 csum_type 1 csum_off 10 csum_flags 0x0 ]
+# iif "lo" ip ttl set 23
+inet test-inet input
+ [ meta load iif => reg 1 ]
+ [ cmp eq reg 1 0x00000001 ]
+ [ meta load nfproto => reg 1 ]
+ [ cmp eq reg 1 0x00000002 ]
+ [ payload load 2b @ network header + 8 => reg 1 ]
+ [ bitwise reg 1 = (reg=1 & 0x0000ff00 ) ^ 0x00000017 ]
+ [ payload write reg 1 => 2b @ network header + 8 csum_type 1 csum_off 10 csum_flags 0x0 ]
+
+# iif "lo" ip protocol set 1
+inet test-inet input
+ [ meta load iif => reg 1 ]
+ [ cmp eq reg 1 0x00000001 ]
+ [ meta load nfproto => reg 1 ]
+ [ cmp eq reg 1 0x00000002 ]
+ [ payload load 2b @ network header + 8 => reg 1 ]
+ [ bitwise reg 1 = (reg=1 & 0x000000ff ) ^ 0x00000100 ]
+ [ payload write reg 1 => 2b @ network header + 8 csum_type 1 csum_off 10 csum_flags 0x1 ]
+