netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: fw@strlen.de, phil@nwl.cc
Subject: Re: [PATCH iptables RFC 4/4] nft: don't care about previous state in RESTART
Date: Mon, 20 May 2019 16:49:38 +0200	[thread overview]
Message-ID: <20190520144938.gqjakvfck6v4akq3@salvia> (raw)
In-Reply-To: <20190520144115.29732-5-pablo@netfilter.org>

On Mon, May 20, 2019 at 04:41:15PM +0200, Pablo Neira Ayuso wrote:
> We need to re-evalute based on the existing cache generation.
> 
> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
> ---
>  iptables/nft.c | 19 +++++++++++--------
>  1 file changed, 11 insertions(+), 8 deletions(-)
> 
> diff --git a/iptables/nft.c b/iptables/nft.c
> index c1a079b734cf..bc3847d7ea47 100644
> --- a/iptables/nft.c
> +++ b/iptables/nft.c
> @@ -2782,10 +2782,10 @@ static void nft_refresh_transaction(struct nft_handle *h)
>  			if (!tablename)
>  				continue;
>  			exists = nft_table_find(h, tablename);
> -			if (n->skip && exists)
> -				n->skip = 0;
> -			else if (!n->skip && !exists)
> +			if (exists)
>  				n->skip = 1;
> +			else
> +				n->skip = 0;

Actually, this should be the opposite:

 			if (exists)
 				n->skip = 0;
			else
				n->skip = 1;

So we only skip the flush if the table does not exist.

Still not working though, hitting EEXIST on CHAIN_USER_ADD.

  reply	other threads:[~2019-05-20 14:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-20 14:41 [PATCH iptables RFC 0/4] revisit RESTART log Pablo Neira Ayuso
2019-05-20 14:41 ` [PATCH iptables RFC 1/4] nft: don't check for table existence from __nft_table_flush() Pablo Neira Ayuso
2019-05-20 14:41 ` [PATCH iptables RFC 2/4] nft: keep original cache in case of ERESTART Pablo Neira Ayuso
2019-05-20 14:41 ` [PATCH iptables RFC 3/4] nft: don't skip table addition from ERESTART Pablo Neira Ayuso
2019-05-20 14:41 ` [PATCH iptables RFC 4/4] nft: don't care about previous state in RESTART Pablo Neira Ayuso
2019-05-20 14:49   ` Pablo Neira Ayuso [this message]
2019-05-20 14:59     ` Pablo Neira Ayuso
2019-05-20 15:06     ` Pablo Neira Ayuso
2019-05-20 15:12       ` 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=20190520144938.gqjakvfck6v4akq3@salvia \
    --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 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).