From: Phil Sutter <phil@nwl.cc>
To: Florian Westphal <fw@strlen.de>
Cc: Pablo Neira Ayuso <pablo@netfilter.org>, netfilter-devel@vger.kernel.org
Subject: Re: [nf-next PATCH] netfilter: nfnetlink_hook: Dump nat type chains
Date: Thu, 19 Mar 2026 17:59:20 +0100 [thread overview]
Message-ID: <abwraHUuxizN4krg@orbyte.nwl.cc> (raw)
In-Reply-To: <abwegj2TijkaQVLz@strlen.de>
On Thu, Mar 19, 2026 at 05:04:18PM +0100, Florian Westphal wrote:
> Phil Sutter <phil@nwl.cc> wrote:
> > These chains are indirectly attached to the hook since they are
> > not called for packets belonging to an established connection.
> >
> > Introduce NF_HOOK_OP_NAT to identify the container and dump attached
> > entries instead of the container itself.
>
> Please lets not do this.
>
> Before:
>
> hook postrouting {
> +0000000100 nf_nat_ipv6_out [nf_nat]
> +2147483647 nf_confirm [nf_conntrack]
> }
>
> After:
> hook postrouting {
> +0000200000 chain inet nat postrouting [nft_chain_nat]
> +2147483647 nf_confirm [nf_conntrack]
> }
>
> ... and thats not true. The nat chain isn't hooked at 200000.
>
> It hooks at +100, this is a dispatcher.
> Concealing the actual hook location and then unrolling the embedded
> nat hooks gives a wrong impression and will mislead users wrt. the
> actual ordering.
Ah, so the nat-type chain's priority value orders it inside the
dispatcher's list.
Maybe I should print them below the dispatcher hook with extra
indentation? Maybe extra braces could further clarify, e.g.:
| hook postrouting {
| +0000000100 nf_nat_ipv6_out [nf_nat] {
| +0000200000 chain inet nat postrouting [nft_chain_nat]
| }
| +2147483647 nf_confirm [nf_conntrack]
| }
> If we really want the ability to list the nat hooks, I think this
> needs a new command to dump them.
We may change 'nft list hooks' output arbitrarily, right? Or should we
fear braking some third-party parsers when doing too fancy stuff?
Thanks, Phil
next prev parent reply other threads:[~2026-03-19 16:59 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-13 15:32 [nf-next PATCH] netfilter: nfnetlink_hook: Dump nat type chains Phil Sutter
2026-03-19 16:04 ` Florian Westphal
2026-03-19 16:59 ` Phil Sutter [this message]
2026-03-19 17:06 ` Florian Westphal
2026-03-19 21:08 ` Phil Sutter
2026-03-20 0:24 ` Pablo Neira Ayuso
2026-03-20 10:17 ` Phil Sutter
2026-03-20 11:11 ` Phil Sutter
2026-03-20 11:18 ` Florian Westphal
2026-03-20 11:26 ` Phil Sutter
2026-03-20 11:36 ` Phil Sutter
2026-03-20 11:47 ` Florian Westphal
2026-03-20 12:09 ` Pablo Neira Ayuso
2026-03-20 12:27 ` Phil Sutter
2026-03-20 11:45 ` Florian Westphal
2026-03-20 11:46 ` 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=abwraHUuxizN4krg@orbyte.nwl.cc \
--to=phil@nwl.cc \
--cc=fw@strlen.de \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.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