From: Florian Westphal <fw@strlen.de>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Florian Westphal <fw@strlen.de>, netfilter-devel@vger.kernel.org
Subject: Re: [RFC nf-next] netfilter: ct: add helper assignment support
Date: Thu, 16 Feb 2017 15:22:08 +0100 [thread overview]
Message-ID: <20170216142208.GD20261@breakpoint.cc> (raw)
In-Reply-To: <20170216132414.GA2141@salvia>
Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> On Wed, Feb 15, 2017 at 11:19:03PM +0100, Florian Westphal wrote:
> > Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> > > > Note from myself, i dislike L3PROTO, it would be nicer to be able
> > > > to handle this via the table family but I did not yet find a way
> > > > to detect this from the obj->init() function.
> > >
> > > We can pass nft_ctx to obj->init().
> >
> > OK, I can make that change then, no problem.
> >
> > > > Its needed for nf_conntrack_helper_try_module_get().
> > > >
> > > > This also begs the question of how one would handle
> > > > NFPROTO_INET, in that case we'd want both v4 and v6, but that
> > > > would require stashing two struct nf_conntrack_helper in
> > > > priv area.
> > >
> > > Still, someone may want to only enable helper for IPv4 in the inet
> > > chain, right? It's a bit of corner case but this attribute provides
> > > slight more flexibility.
> >
> > But assignment can be limited via nft ... meta nfproto ipv4, no?
>
> Right, that's a possible solution to restrict this. Downside is that
> we have some slight packet runtime cost, since we have to evaluate
> this extra expression in the rule for each packet.
>
> Another aspect is that we end up having part of the helper
> configuration spread between the helper definition and the rule, given
> that l4proto would restrict setting the helper to the transport
> protocol and that is set from the helper definition itself.
>
> From a user perspective, we can just hide this detail by infering it
> from context around if not specified, so:
>
> table ip x {
> helper "ftp" {
> type "ftp"
> l4proto tcp
> }
> }
>
> So in this case:
>
> table inet x {
> helper "ftp" {
> type "ftp"
> l4proto tcp
> }
> }
>
> We register it for both ip and ip6.
>
> In this case, with explicit layer 3 protocol:
>
> table bridge x {
> helper "ftp" {
> type "ftp"
> protocol ip
> l4proto tcp
> }
> }
>
> From helper ->eval() we could just skip traffic that is neither IPv4
> at layer 3 nor TCP at layer 4 without having to add this dependency.
>
> If protocol specified in helper for bridge, then default to
> NFPROTO_INET, ie. both enabled.
>
> So yes, I'm still proposing to keep with that layer 3 attribute
> around. What do you think?
Sure, I have no issue with this, its just a minor implementation detail
to me.
I will work on nft parser side for this now and will get back to you.
prev parent reply other threads:[~2017-02-16 14:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-15 16:25 [RFC nf-next] netfilter: ct: add helper assignment support Florian Westphal
2017-02-15 17:05 ` Pablo Neira Ayuso
2017-02-15 22:19 ` Florian Westphal
2017-02-16 13:24 ` Pablo Neira Ayuso
2017-02-16 14:22 ` Florian Westphal [this message]
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=20170216142208.GD20261@breakpoint.cc \
--to=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;
as well as URLs for NNTP newsgroup(s).