From: Phil Sutter <phil@nwl.cc>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [nft PATCH] segtree: Check ranges when deleting elements
Date: Sat, 16 Nov 2019 20:43:09 +0100 [thread overview]
Message-ID: <20191116194309.GB17739@orbyte.nwl.cc> (raw)
In-Reply-To: <20191112191007.9752-1-phil@nwl.cc>
Hi,
On Tue, Nov 12, 2019 at 08:10:07PM +0100, Phil Sutter wrote:
> Make sure any intervals to delete actually exist, otherwise reject the
> command. Without this, it is possible to mess up rbtree contents:
>
> | # nft list ruleset
> | table ip t {
> | set s {
> | type ipv4_addr
> | flags interval
> | auto-merge
> | elements = { 192.168.1.0-192.168.1.254, 192.168.1.255 }
> | }
> | }
> | # nft delete element t s '{ 192.168.1.0/24 }'
> | # nft list ruleset
> | table ip t {
> | set s {
> | type ipv4_addr
> | flags interval
> | auto-merge
> | elements = { 192.168.1.255-255.255.255.255 }
> | }
> | }
Sadly, this breaks tests/monitor/testcases/set-simple.t. The reason is
that 'add element' command does not add the new element to set in cache
and my change requires for 'delete element' command to find the range in
cache. Above test case basically does:
| # nft 'add element ip t s { 10-20 }; delete element ip t s { 10-20 }'
This is not really a common use-case, but still worth fixing IMO.
Sorry, Phil
prev parent reply other threads:[~2019-11-16 19:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-12 19:10 [nft PATCH] segtree: Check ranges when deleting elements Phil Sutter
2019-11-13 23:11 ` Pablo Neira Ayuso
2019-11-16 19:43 ` Phil Sutter [this message]
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=20191116194309.GB17739@orbyte.nwl.cc \
--to=phil@nwl.cc \
--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 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).