From: Phil Sutter <phil@nwl.cc>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Florian Westphal <fw@strlen.de>, netfilter-devel@vger.kernel.org
Subject: Re: [nft PATCH] evaluate: Reject set stmt refs to sets without dynamic flag
Date: Thu, 18 May 2023 13:26:11 +0200 [thread overview]
Message-ID: <ZGYLUx/fNGPXPqN9@orbyte.nwl.cc> (raw)
In-Reply-To: <ZGXytiRHHS5O6U2v@calendula>
Hi Pablo,
On Thu, May 18, 2023 at 11:41:10AM +0200, Pablo Neira Ayuso wrote:
> On Wed, May 10, 2023 at 01:48:01PM +0200, Phil Sutter wrote:
> > Hi Pablo,
> >
> > On Wed, May 10, 2023 at 12:54:28PM +0200, Pablo Neira Ayuso wrote:
> > > On Wed, May 03, 2023 at 12:50:22PM +0200, Phil Sutter wrote:
> > > > This is a revert of commit 8d443adfcc8c1 ("evaluate: attempt to set_eval
> > > > flag if dynamic updates requested"), implementing the alternative
> > > > mentioned in the comment it added.
> > > >
> > > > Reason is the inconsistent behaviour when applying the same ruleset
> > > > twice: In the first call, the set lacking 'dynamic' flag does not exist
> > > > and is therefore added to the cache. Consequently, both the 'add set'
> > > > command and the set statement point at the same set object. In the
> > > > second call, a set with same name exists already, so the object created
> > > > for 'add set' command is not added to cache and consequently not updated
> > > > with the missing flag. The kernel thus rejects the NEWSET request as the
> > > > existing set differs from the new one.
> > >
> > > # cat test.nft
> > > flush ruleset
> >
> > Just remove this 'flush ruleset' call, then it should trigger.
>
> I cannot reproduce it yet :(
This is very odd.
> # cat test.nft
> table ip test {
> set dlist {
> type ipv4_addr
> size 65535
> }
>
> chain output {
> type filter hook output priority filter; policy accept;
> udp dport 1234 update @dlist { ip daddr } counter packets 0 bytes 0
> }
> }
> # nft -f test.nft
> # nft -f test.nft
On my side, this second call emits:
| /tmp/test.nft:2:6-10: Error: Could not process rule: File exists
| set dlist {
| ^^^^^
> Maybe I need a specific kernel? I am trying with latest.
IIUC, it is not kernel-related. I can reproduce with:
nftables @ d486c9e626405 ("datatype: add hint error handler")
libnftnl @ libnftnl-1.2.5
linux @ b50a8b0d57ab1 ("net: openvswitch: Use struct_size()")
Cheers, Phil
next prev parent reply other threads:[~2023-05-18 11:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-03 10:50 [nft PATCH] evaluate: Reject set stmt refs to sets without dynamic flag Phil Sutter
2023-05-10 10:54 ` Pablo Neira Ayuso
2023-05-10 11:48 ` Phil Sutter
2023-05-18 9:41 ` Pablo Neira Ayuso
2023-05-18 11:26 ` Phil Sutter [this message]
2023-05-18 15:05 ` 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=ZGYLUx/fNGPXPqN9@orbyte.nwl.cc \
--to=phil@nwl.cc \
--cc=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 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.