]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests: add ether payload set test
authorFlorian Westphal <fw@strlen.de>
Fri, 22 Jul 2016 10:08:47 +0000 (12:08 +0200)
committerFlorian Westphal <fw@strlen.de>
Fri, 22 Jul 2016 10:08:47 +0000 (12:08 +0200)
... and fix missing line in ip6 test.

Signed-off-by: Florian Westphal <fw@strlen.de>
tests/py/bridge/ether.t
tests/py/bridge/ether.t.payload
tests/py/ip6/ip6.t.payload.ip6

index 5b39fe0bfb0d287b2a65dca50271c953ccf53d51..4a177ab01d85de41bc0e57023f50a0198014e9a2 100644 (file)
@@ -6,3 +6,5 @@ tcp dport 22 iiftype ether ip daddr 1.2.3.4 ether saddr 00:0f:54:0c:11:4 accept;
 tcp dport 22 ip daddr 1.2.3.4 ether saddr 00:0f:54:0c:11:04;ok;tcp dport 22 ether saddr 00:0f:54:0c:11:04 ip daddr 1.2.3.4
 tcp dport 22 ether saddr 00:0f:54:0c:11:04 ip daddr 1.2.3.4;ok
 ether saddr 00:0f:54:0c:11:04 ip daddr 1.2.3.4 accept;ok
+
+ether daddr 00:01:02:03:04:05 ether saddr set ff:ff:ff:ff:ff:ff drop;ok
index 8fdb0a954ea24698b7b50f07695b0e08ca01c038..c545d6576df6bff9880f2c6e24783d76f2b61b05 100644 (file)
@@ -42,3 +42,11 @@ bridge test-bridge input
   [ cmp eq reg 1 0x04030201 ]
   [ immediate reg 0 accept ]
 
+# ether daddr 00:01:02:03:04:05 ether saddr set ff:ff:ff:ff:ff:ff drop
+bridge test-bridge input
+  [ payload load 6b @ link header + 0 => reg 1 ]
+  [ cmp eq reg 1 0x03020100 0x00000504 ]
+  [ immediate reg 1 0xffffffff 0x0000ffff ]
+  [ payload write reg 1 => 6b @ link header + 6 csum_type 0 csum_off 0 ]
+  [ immediate reg 0 drop ]
+
index e3549890561187fa6bed92a308ffb82299d0db7d..7e158a8b471f4ce25d3c33cd42f08e468198169a 100644 (file)
@@ -391,3 +391,4 @@ ip6 test-ip6 input
   [ meta load iif => reg 1 ]
   [ cmp eq reg 1 0x00000001 ]
   [ immediate reg 1 0x00000001 ]
+  [ payload write reg 1 => 1b @ network header + 7 csum_type 0 csum_off 0 ]