From: Hangbin Liu <hangbin.liu@linux.dev>
To: sashiko-reviews@lists.linux.dev
Cc: mptcp@lists.linux.dev
Subject: Re: [PATCH mptcp-next v3 2/2] selftests: mptcp: convert iptables to nftables for mptcp_join.sh
Date: Fri, 4 Sep 2026 17:33:03 +0800 [thread overview]
Message-ID: <apqQT8TAR4gRvl1F@fedora> (raw)
In-Reply-To: <20260904074206.C41951F00A3D@smtp.kernel.org>
On Fri, Sep 04, 2026 at 07:42:06AM +0000, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Medium] Missing 'add' keyword in nftables configuration script causes syntax error, silently skipping tests.
> --
>
> commit 45eaf6e2e654e036380de79d25fbc989c2055da7
> Author: Hangbin Liu <liuhangbin@kylinos.cn>
>
> selftests: mptcp: convert iptables to nftables for mptcp_join.sh
>
> This commit replaces the iptables/ip6tables setup with nftables in the
> mptcp_join.sh selftest. It introduces a new init_nftables function to setup
> the nft tables using a heredoc rather than configuring them inline.
>
> > diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
> > index 18ce7136a2b0e..835cb92cab1a4 100755
> > --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
> > +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
>
> [ ... ]
>
> > @@ -184,6 +147,28 @@ init_shapers()
> > done
> > }
> >
> > +init_nftables()
> > +{
> > + nft_handle=""
> > +
> > + local netns table
> > + for netns in "$ns1" "$ns2"; do
> > + for table in ip ip6; do
> > + ip netns exec "$netns" nft -f - <<-EOF
> > + add table $table filter
> > + add chain $table filter INPUT \
> > + { type filter hook input priority filter; policy accept; }
> > + add chain $table filter OUTPUT \
> > + { type filter hook output priority filter; policy accept; }
> > +
> > + table $table mangle
> > + chain $table mangle OUTPUT \
> ^^^^
>
> [Severity: Medium]
> Are these table and chain declarations missing the "add" keyword?
>
Ah, copy‑and‑paste error. But the test passed when I run it.
After investigating, I found the interesting usage for nft. Both
nft -f - <<-EOF
add table ...
add chain ..
EOF
and
nft -f - <<-EOF
table ...
chain ..
EOF
Works!
Anyway, I will sync the writing in next version (if have) to not miss-leading
others.
Thanks
Hangbin
next prev parent reply other threads:[~2026-09-04 9:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-04 7:31 [PATCH mptcp-next v3 0/2] selftests: mptcp: convert iptables to nftables Hangbin Liu
2026-09-04 7:31 ` [PATCH mptcp-next v3 1/2] selftests: mptcp: convert iptables to nftables for mptcp_sockopt.sh Hangbin Liu
2026-09-04 7:31 ` [PATCH mptcp-next v3 2/2] selftests: mptcp: convert iptables to nftables for mptcp_join.sh Hangbin Liu
2026-09-04 7:42 ` sashiko-bot
2026-09-04 9:33 ` Hangbin Liu [this message]
2026-09-04 8:41 ` [PATCH mptcp-next v3 0/2] selftests: mptcp: convert iptables to nftables MPTCP CI
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=apqQT8TAR4gRvl1F@fedora \
--to=hangbin.liu@linux.dev \
--cc=mptcp@lists.linux.dev \
--cc=sashiko-reviews@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.