netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Phil Sutter <phil@nwl.cc>, netfilter-devel@vger.kernel.org
Subject: Re: [iptables PATCH 14/14] nft: bridge: Rudimental among extension support
Date: Tue, 27 Aug 2019 12:39:34 +0200	[thread overview]
Message-ID: <20190827103934.26m7eponuwseb43i@salvia> (raw)
In-Reply-To: <20190826154006.GD14469@orbyte.nwl.cc>

On Mon, Aug 26, 2019 at 05:40:06PM +0200, Phil Sutter wrote:
> On Sat, Aug 24, 2019 at 06:53:34PM +0200, Pablo Neira Ayuso wrote:
> > On Wed, Aug 21, 2019 at 11:26:02AM +0200, Phil Sutter wrote:
> > [...]
> > > +/* XXX: move this into libnftnl, replacing nftnl_set_lookup() */
> > > +static struct nftnl_set *nft_set_byname(struct nft_handle *h,
> > > +					const char *table, const char *set)
> > 
> > Probably extend libnftnl to allow to take a pointer to a nftnl_set
> > object, as an alternative to the set name? The idea is that this
> > set object now belongs to the lookup extension, so this extension will
> > take care of releasing it from the destroy path.
> > 
> > Then, the lookup extension will have a pointer to the anonymous set so
> > you could then skip the cache code (and all the updates to have access
> > to it).
> 
> Sounds like a nice approach! So I would add a new
> NFTNL_EXPR_LOOKUP_SET_PTR to link the set and introduce
> NFTA_LOOKUP_ANON_SET (or so) which starts a nested attribute filled
> simply by nftnl_set_nlmsg_build_payload()? Kernel code would have to be
> extended accordingly, of course.

No need for kernel code update.

> Seems like I can't reuse nftnl_set_nlmsg_parse() since
> mnl_attr_parse_nested() would have to be called. But I guess outsourcing
> the attribute handling from the further and introducing a second wrapper
> would do.

My proposal is to add NFTNL_EXPR_LOOKUP_SET_PTR, that allows you to
pass a pointer to the set, if that makes this simpler for you.

This would be an alias of the SET_ID, from the build path it would
use. You would still need to add the set command.

But I think you will end up needing the set cache anyway from the
netlink dump path anyway.

I'm re-evaluating, and I think your patchset is a good approach.

  reply	other threads:[~2019-08-27 10:39 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-21  9:25 [iptables PATCH 00/14] Implement among match support Phil Sutter
2019-08-21  9:25 ` [iptables PATCH 01/14] nft: Fix typo in nft_parse_limit() error message Phil Sutter
2019-08-24 16:40   ` Pablo Neira Ayuso
2019-08-21  9:25 ` [iptables PATCH 02/14] nft: Get rid of NFT_COMPAT_EXPR_MAX define Phil Sutter
2019-08-24 16:40   ` Pablo Neira Ayuso
2019-08-21  9:25 ` [iptables PATCH 03/14] nft: Keep nft_handle pointer in nft_xt_ctx Phil Sutter
2019-08-24 16:41   ` Pablo Neira Ayuso
2019-09-26  8:29     ` Phil Sutter
2019-08-21  9:25 ` [iptables PATCH 04/14] nft: Eliminate pointless calls to nft_family_ops_lookup() Phil Sutter
2019-08-24 16:41   ` Pablo Neira Ayuso
2019-08-21  9:25 ` [iptables PATCH 05/14] nft: Fetch sets when updating rule cache Phil Sutter
2019-08-27 10:37   ` Pablo Neira Ayuso
2019-08-21  9:25 ` [iptables PATCH 06/14] nft: Support NFT_COMPAT_SET_ADD Phil Sutter
2019-08-21  9:25 ` [iptables PATCH 07/14] nft: family_ops: Pass nft_handle to 'add' callback Phil Sutter
2019-08-21  9:25 ` [iptables PATCH 08/14] nft: family_ops: Pass nft_handle to 'rule_find' callback Phil Sutter
2019-08-21  9:25 ` [iptables PATCH 09/14] nft: family_ops: Pass nft_handle to 'print_rule' callback Phil Sutter
2019-08-21  9:25 ` [iptables PATCH 10/14] nft: family_ops: Pass nft_handle to 'rule_to_cs' callback Phil Sutter
2019-08-21  9:25 ` [iptables PATCH 11/14] nft: Bore up nft_parse_payload() Phil Sutter
2019-08-27 10:38   ` Pablo Neira Ayuso
2019-08-27 10:50     ` Pablo Neira Ayuso
2019-08-21  9:26 ` [iptables PATCH 12/14] nft: Embed rule's table name in nft_xt_ctx Phil Sutter
2019-08-21  9:26 ` [iptables PATCH 13/14] nft: Support parsing lookup expression Phil Sutter
2019-08-21  9:26 ` [iptables PATCH 14/14] nft: bridge: Rudimental among extension support Phil Sutter
2019-08-24 16:53   ` Pablo Neira Ayuso
2019-08-26 15:40     ` Phil Sutter
2019-08-27 10:39       ` Pablo Neira Ayuso [this message]
2019-08-27 10:49   ` Pablo Neira Ayuso
2019-08-27 11:35     ` Phil Sutter
2019-08-27 12:21       ` Pablo Neira Ayuso
2019-08-27 12:47         ` 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=20190827103934.26m7eponuwseb43i@salvia \
    --to=pablo@netfilter.org \
    --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 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).