All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>,
	Netfilter Development Mailing list
	<netfilter-devel@vger.kernel.org>
Subject: Re: nft option to flush out the existing ruleset [was Re: [libnftnl PATCH] examples: add nft-ruleset-replace]
Date: Tue, 26 Aug 2014 15:35:49 +0100	[thread overview]
Message-ID: <20140826143549.GC23476@acer.localdomain> (raw)
In-Reply-To: <20140826134706.GA5913@salvia>

On Tue, Aug 26, 2014 at 03:47:06PM +0200, Pablo Neira Ayuso wrote:
> On Tue, Aug 26, 2014 at 02:30:30PM +0100, Patrick McHardy wrote:
> > >> - add a generation ID to the ruleset
> > >> - dump the entire ruleset
> > >> - generate delete commands for each existing rule/chain/set...
> > >> - generate add commands for each new rule/chain/set...
> > >> - send the entire thing to the kernel, including the generation ID
> > >> - if the generation ID doesn't match, meaning the ruleset has changed
> > >>   since the last dump, return an error to userspace, retry
> > >
> > >The approach in my patchset is different:
> > >
> > >- generate a delete command that will flush all the previous ruleset
> > >- generate add commands for each new rule/chain/set/tables
> > >- send the batch to the kernel
> > >
> > >In this approach, we don't care about what is in the kernel previous
> > >to the delete command.
> > 
> > Sure, but as Pablo pointed out, it adds more code that needs to be maintained that isn't strictly neccessary.
> 
> Oh, I probably didn't explain well myself. I'd like to see Arturo's
> shortcut using _DELTABLE unless you have any concern with them :-).

No concerns, was just trying to support your arguments :) Either way seems
reasonable to me.

> We still need that generation ID indeed to catch interferences between
> two object dumps, I'll send you a patch proposal for this soon.

Yep, we also need this for set transactions. I suppose we need generation
IDs for each individual object type as well as AF-specific ones which
change for any object change (table level doesn't work because sets are
per AF).

  reply	other threads:[~2014-08-26 14:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-26  9:57 [libnftnl PATCH] examples: add nft-ruleset-replace Arturo Borrero Gonzalez
2014-08-26 11:09 ` nft option to flush out the existing ruleset [was Re: [libnftnl PATCH] examples: add nft-ruleset-replace] Pablo Neira Ayuso
2014-08-26 12:14   ` Patrick McHardy
2014-08-26 13:12     ` Arturo Borrero Gonzalez
2014-08-26 13:30       ` Patrick McHardy
2014-08-26 13:47         ` Pablo Neira Ayuso
2014-08-26 14:35           ` Patrick McHardy [this message]
2014-08-26 13:38       ` Pablo Neira Ayuso
2014-09-01 15:07   ` Arturo Borrero Gonzalez
2014-09-01 15:17     ` 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=20140826143549.GC23476@acer.localdomain \
    --to=kaber@trash.net \
    --cc=arturo.borrero.glez@gmail.com \
    --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.