All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH] netfilter: nf_tables: fix rule batch with anonymous set and module autoload
Date: Sun, 16 Feb 2014 10:44:09 +0000	[thread overview]
Message-ID: <20140216104409.GB28646@macbook.localnet> (raw)
In-Reply-To: <20140216103335.GA4499@localhost>

On Sun, Feb 16, 2014 at 11:33:35AM +0100, Pablo Neira Ayuso wrote:
> On Sat, Feb 15, 2014 at 09:38:23AM +0000, Patrick McHardy wrote:
> > > 
> > > The set definition and the elements need to be included in the lookup
> > > expression for anonymous sets, can you think of any better solution?
> > 
> > I think we can use some identifiers generated by userspace to tie them
> > both together. Something like a unique numeric identifier (unique within
> > the transaction).
> 
> That can be done, but I don't see why we allow the creation of
> anonymous sets out of the scope of a rule since:
> 
> * They can only be used by one single rule.
> * You cannot update them by adding/deleting elements.
> 
> The current API allows creating an anonymous set that can be left
> unused. I think we should only allow the creation of non-anonymous
> sets via NFT_MSG_NEWSET at some point.

The two main reasons are:

- it keeps the API simpler
- members might not fit into a single message and currently we can keep
  adding members as long as the set is not bound

I don't think we should change this.

It actually also is possible to use anonymous sets with more than one
rule, just nft doesn't provide a way to do it. The definition of an
anonymous set it (anonymous isn't the best name) a set that is automatically
destroyed once the last rule unbinds.

The fact that we don't allow to use them in multiple rules is purely
internal to nft.

On a general note, nft is just meant to be *one* frontend, there's no
reason why someone else couldn't write a different one more suitable for
a specific purpose. F.i. a simple embedded system might only use tuples
of (dst,proto,port) and use a hash for the lookup.

  reply	other threads:[~2014-02-16 10:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-14 11:27 [PATCH] netfilter: nf_tables: fix rule batch with anonymous set and module autoload Pablo Neira Ayuso
2014-02-14 11:37 ` Patrick McHardy
2014-02-14 12:34   ` Pablo Neira Ayuso
2014-02-15  9:38     ` Patrick McHardy
2014-02-16 10:33       ` Pablo Neira Ayuso
2014-02-16 10:44         ` Patrick McHardy [this message]
2014-02-16 11:14           ` Pablo Neira Ayuso
2014-02-16 11:23             ` Patrick McHardy

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=20140216104409.GB28646@macbook.localnet \
    --to=kaber@trash.net \
    --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 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.