From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Phil Sutter <phil@nwl.cc>, netfilter-devel@vger.kernel.org
Subject: Re: [nft PATCH 3/4] segtree: Merge get_set_interval_find() and get_set_interval_end()
Date: Fri, 1 May 2020 13:05:36 +0200 [thread overview]
Message-ID: <20200501110536.GA13284@salvia> (raw)
In-Reply-To: <20200430160120.GT15009@orbyte.nwl.cc>
On Thu, Apr 30, 2020 at 06:01:20PM +0200, Phil Sutter wrote:
> On Thu, Apr 30, 2020 at 05:52:18PM +0200, Pablo Neira Ayuso wrote:
> > On Thu, Apr 30, 2020 at 05:48:42PM +0200, Phil Sutter wrote:
> > > On Thu, Apr 30, 2020 at 05:37:29PM +0200, Pablo Neira Ayuso wrote:
> > > > On Thu, Apr 30, 2020 at 05:14:07PM +0200, Phil Sutter wrote:
> > > > > Both functions were very similar already. Under the assumption that they
> > > > > will always either see a range (or start of) that matches exactly or not
> > > > > at all, reduce complexity and make get_set_interval_find() accept NULL
> > > > > (left or) right values. This way it becomes a full replacement for
> > > > > get_set_interval_end().
> > > >
> > > > I have to go back to the commit log of this patch, IIRC my intention
> > > > here was to allow users to ask for a single element, then return the
> > > > range that contains it.
> > >
> > > That was my suspicion as well, but while testing I found out that no
> > > matter what I passed to 'get element', I couldn't provoke a situation in
> > > which get_set_interval_find() would have left and right elements which
> > > didn't match exactly (or not at all).
> > >
> > > There must be some preparation happening before the call to
> > > get_set_decompose() which normalizes things. And still, If I disable the
> > > call to get_set_decompose() entirely, tests start failing.
> >
> > Hm, so the approximate or exact matching is broken? Or you mean they
> > fail because you didn't expect the approximate matching?
>
> It's the opposite: Things are working fine even after my
> simplifications. get_set_interval_find() expected left/right values
> which sit within a range, e.g. left/right of 22/23 and a set with
> element 20-30. But to my surprise, this doesn't happen. With these
> example values, left/right are 20/30, i.e. match the range in the set.
>
> That's why I extended tests/shell/testcases/sets/0034get_element_0.
> Please have a look if there's a use-case I missed.
This looks good indeed. Please, push this out.
Thanks for explaining.
next prev parent reply other threads:[~2020-05-01 11:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-30 15:14 [nft PATCH 0/4] Two bugfixes around prefixes in sets Phil Sutter
2020-04-30 15:14 ` [nft PATCH 1/4] segtree: Fix missing expires value in prefixes Phil Sutter
2020-04-30 15:14 ` [nft PATCH 2/4] segtree: Use expr_clone in get_set_interval_*() Phil Sutter
2020-04-30 15:14 ` [nft PATCH 3/4] segtree: Merge get_set_interval_find() and get_set_interval_end() Phil Sutter
2020-04-30 15:37 ` Pablo Neira Ayuso
2020-04-30 15:41 ` Pablo Neira Ayuso
2020-05-04 12:53 ` Phil Sutter
2020-04-30 15:48 ` Phil Sutter
2020-04-30 15:52 ` Pablo Neira Ayuso
2020-04-30 16:01 ` Phil Sutter
2020-05-01 11:05 ` Pablo Neira Ayuso [this message]
2020-04-30 15:14 ` [nft PATCH 4/4] segtree: Fix get element command with prefixes Phil Sutter
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=20200501110536.GA13284@salvia \
--to=pablo@netfilter.org \
--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 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.