From: Florian Westphal <fw@strlen.de>
To: <netfilter-devel@vger.kernel.org>
Cc: Florian Westphal <fw@strlen.de>
Subject: [PATCH nft 2/3] testcases: test jump to basechain is rejected, even if there is no loop
Date: Wed, 10 Jul 2024 23:42:19 +0200 [thread overview]
Message-ID: <20240710214224.11841-2-fw@strlen.de> (raw)
In-Reply-To: <20240710214224.11841-1-fw@strlen.de>
Check that we can't jump to input hook from output.
Signed-off-by: Florian Westphal <fw@strlen.de>
---
.../shell/testcases/chains/jump_to_base_chain | 25 +++++++++++++++++++
1 file changed, 25 insertions(+)
create mode 100755 tests/shell/testcases/chains/jump_to_base_chain
diff --git a/tests/shell/testcases/chains/jump_to_base_chain b/tests/shell/testcases/chains/jump_to_base_chain
new file mode 100755
index 000000000000..d71da4cf35eb
--- /dev/null
+++ b/tests/shell/testcases/chains/jump_to_base_chain
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+$NFT -f - <<EOF
+table t {
+ chain i {
+ type filter hook input priority 0
+ }
+
+ chain o {
+ type filter hook output priority 0
+ jump c
+ }
+
+ chain c {
+ jump i
+ }
+}
+EOF
+
+if [ $? -eq 0 ];then
+ echo "E: Accepted jump to a base chain"
+ exit 1
+fi
+
+exit 0
--
2.44.2
next prev parent reply other threads:[~2024-07-10 21:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-10 21:42 [PATCH nft 1/3] tests: add more ruleset validation test cases Florian Westphal
2024-07-10 21:42 ` Florian Westphal [this message]
2024-07-10 21:42 ` [PATCH nft 3/3] tests: connect chains to hook point Florian Westphal
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=20240710214224.11841-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