From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Phil Sutter <phil@nwl.cc>, Florian Westphal <fw@strlen.de>,
netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nft 1/4] doc: add documentation about list hooks feature
Date: Mon, 19 Aug 2024 12:56:01 +0200 [thread overview]
Message-ID: <ZsMkwTdIp1hYWBXt@calendula> (raw)
In-Reply-To: <Zrs-STpwUN2rqnl2@orbyte.nwl.cc>
Hi Phil, Florian,
@Florian, could you push out what you have to flush your queue in this front?
On Tue, Aug 13, 2024 at 01:06:49PM +0200, Phil Sutter wrote:
> On Mon, Jul 29, 2024 at 05:32:11PM +0200, Florian Westphal wrote:
> [...]
> Let me suggest a deviation which seems more user-friendly:
>
> > 1. nft list hooks
> > dump everything EXCEPT netdev families/devices
>
> Include netdev here, make it really list *all* hooks. Iterating over
> the list of currently existing NICs in this netns is no big deal, is
> it?
I like this suggestion.
I think it should be possible to incrementally extend with these
suggestions, it should be possible to submit patches for your review.
> > 2. nft list hooks netdev device foo
> > dump ingress/egress netdev hooks,
> > INCLUDING inet ingress (its scoped to the device).
>
> Drop 'netdev' from the syntax here. The output really is "all hooks
> specific to that NIC", not necessarily only netdev ones. (And "device"
> is a distinct identifier for network interfaces in nftables syntax.)
I think allowing 'device foo' without family would be good.
> > 3. nft list hooks arp
> > dump arp input and output, if any
> > 4. nft list hooks bridge
> > dump bridge pre/input/forward/out/postrouting
> > 5. nft list hooks ip
> > dump ip pre/input/forward/out/postrouting
> > 6. nft list hooks ip6 -> see above
> > 7. nft list hooks inet -> alias for dumping both ip+ip6 hooks.
>
> I wonder if this is more confusing than not - on the netfilter hooks
> layer, it doesn't quite exist. The only thing which persists a tad
> longer is inet ingress, indicated by nf_register_net_hook() passing it
> down to __nf_register_net_hook for nf_hook_entry_head() to return the
> same value as for netdev ingress. I guess they could be spliced even
> further up.
inet is an "alias". I think dumpg both ip+ip6 hooks should be fine.
> > This also means that i'd make 'inet device foo' return a warning
> > that the device will be ignored because "inet ingress" is syntactic
> > frontend sugar similar to inet pseudo-family.
>
> Iff my claim holds true, there is no such thing as an inet hook and
> thus also no inet device one. :)
>
> > We could try the 'detect pipeline' later. But, as per example
> > above, I don't think its easy, unless one omits all packet rewrites
> > (stateless nat, dnat, redirect) and everything else that causes
> > re-routing, e.g. policy routing, tproxy, tc(x), etc.
> >
> > And then there is l3 and l2 multicasting...
> >
> > But, admittingly, it might be nice to have something and it might be
> > good enough if pipeline alterations by ruleset and other entities
> > are omitted.
>
> I seem to recall us discussing something like that on NFWS, but to
> simulate traversal of a packet with given properties through the
> ruleset. Which would also identify the hooks involved, I guess?
Yes, this all is more complicated and it needs a whole lot of work to
add this feature in a complete way, which makes sense to schedule this
for the _future_.
next prev parent reply other threads:[~2024-08-19 10:56 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-26 1:58 [PATCH nft 0/4] list hooks refactoring Florian Westphal
2024-07-26 1:58 ` [PATCH nft 1/4] doc: add documentation about list hooks feature Florian Westphal
2024-07-26 9:00 ` Pablo Neira Ayuso
2024-07-26 12:31 ` Florian Westphal
2024-07-28 23:19 ` Pablo Neira Ayuso
2024-07-28 23:37 ` Florian Westphal
2024-07-29 0:21 ` Pablo Neira Ayuso
2024-07-29 15:32 ` Florian Westphal
2024-07-30 23:34 ` Pablo Neira Ayuso
2024-08-13 11:06 ` Phil Sutter
2024-08-19 10:56 ` Pablo Neira Ayuso [this message]
2024-08-19 12:10 ` Florian Westphal
2024-07-26 1:58 ` [PATCH nft 2/4] src: remove decnet support Florian Westphal
2024-07-29 23:23 ` Florian Westphal
2024-07-26 1:58 ` [PATCH nft 3/4] src: mnl: clean up hook listing code Florian Westphal
2024-07-26 1:58 ` [PATCH nft 4/4] src: add egress support for 'list hooks' 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=ZsMkwTdIp1hYWBXt@calendula \
--to=pablo@netfilter.org \
--cc=fw@strlen.de \
--cc=netfilter-devel@vger.kernel.org \
--cc=phil@nwl.cc \
/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.