All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Phil Sutter <phil@nwl.cc>, Florian Westphal <fw@strlen.de>,
	netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nft] tests: monitor: fix up test case breakage
Date: Wed, 30 Oct 2024 23:21:23 +0100	[thread overview]
Message-ID: <ZyKxY6WZJrKioMDt@calendula> (raw)
In-Reply-To: <ZyKnPxdGwh1X3AwT@calendula>

On Wed, Oct 30, 2024 at 10:38:11PM +0100, Pablo Neira Ayuso wrote:
> On Wed, Oct 30, 2024 at 07:19:47PM +0100, Phil Sutter wrote:
> > On Tue, Oct 29, 2024 at 09:12:19PM +0100, Florian Westphal wrote:
> > [...]
> > > diff --git a/tests/monitor/testcases/set-simple.t b/tests/monitor/testcases/set-simple.t
> > > index 8ca4f32463fd..6853a0ebbb0c 100644
> > > --- a/tests/monitor/testcases/set-simple.t
> > > +++ b/tests/monitor/testcases/set-simple.t
> > > @@ -37,9 +37,10 @@ J {"add": {"element": {"family": "ip", "table": "t", "name": "portrange", "elem"
> > >  # make sure half open before other element works
> > >  I add element ip t portrange { 1024-65535 }
> > >  I add element ip t portrange { 100-200 }
> > > -O -
> > > -J {"add": {"element": {"family": "ip", "table": "t", "name": "portrange", "elem": {"set": [{"range": [1024, 65535]}]}}}}
> > > +O add element ip t portrange { 100-200 }
> > > +O add element ip t portrange { 1024-65535 }
> > >  J {"add": {"element": {"family": "ip", "table": "t", "name": "portrange", "elem": {"set": [{"range": [100, 200]}]}}}}
> > > +J {"add": {"element": {"family": "ip", "table": "t", "name": "portrange", "elem": {"set": [{"range": [1024, 65535]}]}}}}
> > 
> > This is odd: Why does monitor output reverse input? If nft reorders
> > input, the test ("make sure half open before other element works") is
> > probably moot anyway.
> 
> Because elements are collapsed in one single command.
> 
>   I add element ip t portrange { 1024-65535 }
>   I add element ip t portrange { 100-200 }
> 
> and there is qsort() to search for interval overlaps.
> 
> this becomes one single command with { 100-200, 1024-65535 }
> 
> I have a patch to remove the overlap check using qsort() from
> userspace which should remove this reordering, but it seems there is a
> overlap case that kernel does not handle yet.

I can also revert the patch if you don't like, but it is saving _a
lot_ of memory from userspace for the silly one element per line case.

  reply	other threads:[~2024-10-30 22:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-29 20:12 [PATCH nft] tests: monitor: fix up test case breakage Florian Westphal
2024-10-29 21:27 ` Pablo Neira Ayuso
2024-10-30 18:19 ` Phil Sutter
2024-10-30 18:54   ` Florian Westphal
2024-10-30 21:38   ` Pablo Neira Ayuso
2024-10-30 22:21     ` Pablo Neira Ayuso [this message]
2024-10-30 23:29       ` Florian Westphal
2024-10-31 13:07         ` 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=ZyKxY6WZJrKioMDt@calendula \
    --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 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.