Linux Netfilter development
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: <netfilter-devel@vger.kernel.org>
Cc: Florian Westphal <fw@strlen.de>
Subject: [PATCH nft 1/4] tests: add shift+and typeof test cases
Date: Tue,  7 Dec 2021 16:16:56 +0100	[thread overview]
Message-ID: <20211207151659.5507-2-fw@strlen.de> (raw)
In-Reply-To: <20211207151659.5507-1-fw@strlen.de>

These tests work, but I omitted a few lines that do not:

in: frag frag-off @s4 accept
in: ip version @s8

out: (frag unknown & 0xfff8 [invalid type]) >> 3 == @s4
out:  (ip l4proto & pfsync) >> 4 == @s8

Next patches resolve this.

Signed-off-by: Florian Westphal <fw@strlen.de>
---
 .../shell/testcases/sets/dumps/typeof_sets_0.nft  | 15 +++++++++++++++
 tests/shell/testcases/sets/typeof_sets_0          | 14 ++++++++++++++
 2 files changed, 29 insertions(+)

diff --git a/tests/shell/testcases/sets/dumps/typeof_sets_0.nft b/tests/shell/testcases/sets/dumps/typeof_sets_0.nft
index 8f11b110552c..ad442713f6dc 100644
--- a/tests/shell/testcases/sets/dumps/typeof_sets_0.nft
+++ b/tests/shell/testcases/sets/dumps/typeof_sets_0.nft
@@ -34,6 +34,17 @@ table inet t {
 		elements = { 1, 4 }
 	}
 
+	set s8 {
+		typeof ip version
+		elements = { 4, 6 }
+	}
+
+	set s9 {
+		typeof ip hdrlength
+		elements = { 0, 1, 2, 3, 4,
+			     15 }
+	}
+
 	chain c1 {
 		osf name @s1 accept
 	}
@@ -53,4 +64,8 @@ table inet t {
 	chain c7 {
 		sctp chunk init num-inbound-streams @s7 accept
 	}
+
+	chain c9 {
+		ip hdrlength @s9 accept
+	}
 }
diff --git a/tests/shell/testcases/sets/typeof_sets_0 b/tests/shell/testcases/sets/typeof_sets_0
index 1e99e2987733..2102789e1043 100755
--- a/tests/shell/testcases/sets/typeof_sets_0
+++ b/tests/shell/testcases/sets/typeof_sets_0
@@ -40,6 +40,16 @@ EXPECTED="table inet t {
 		elements = { 1, 4 }
 	}
 
+	set s8 {
+		typeof ip version
+		elements = { 4, 6 }
+	}
+
+	set s9 {
+		typeof ip hdrlength
+		elements = { 0, 1, 2, 3, 4, 15 }
+	}
+
 	chain c1 {
 		osf name @s1 accept
 	}
@@ -59,6 +69,10 @@ EXPECTED="table inet t {
 	chain c7 {
 		sctp chunk init num-inbound-streams @s7 accept
 	}
+
+	chain c9 {
+		ip hdrlength @s9 accept
+	}
 }"
 
 set -e
-- 
2.32.0


  reply	other threads:[~2021-12-07 15:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-07 15:16 [PATCH nft 0/4] second batch of typeof fixes Florian Westphal
2021-12-07 15:16 ` Florian Westphal [this message]
2021-12-07 15:16 ` [PATCH nft 2/4] payload: skip templates with meta key set Florian Westphal
2021-12-07 15:16 ` [PATCH nft 3/4] netlink_delinearize: and/shift postprocessing Florian Westphal
2021-12-07 15:16 ` [PATCH nft 4/4] netlink_delinearize: zero shift removal Florian Westphal
2021-12-09  0:31 ` [PATCH nft 0/4] second batch of typeof fixes Pablo Neira Ayuso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211207151659.5507-2-fw@strlen.de \
    --to=fw@strlen.de \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox