All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Patrick McHardy <kaber@trash.net>
Cc: Florian Westphal <fw@strlen.de>,
	Pablo Neira Ayuso <pablo@netfilter.org>,
	netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nft] src: add interface wildcard matching
Date: Sun, 18 Oct 2015 21:43:30 +0200	[thread overview]
Message-ID: <20151018194330.GB4386@breakpoint.cc> (raw)
In-Reply-To: <20151018190445.GB7250@macbook.localdomain>

Patrick McHardy <kaber@trash.net> wrote:
> On 18.10, Florian Westphal wrote:
> > Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> > > Contrary to iptables, we use '*' as wildcard as in udev since the '+' can be
> > > used as a valid interface name.
> > 
> > '*' can also be part of an interface name, seems only '/', ':', and ' '
> > (space) are disallowed.
> > 
> > >  # nft --debug=netlink add rule test test iifname eth\*
> > >  ip test test
> > >    [ meta load iifname => reg 1 ]
> > >    [ bitwise reg 1 = (reg=1 & 0x00ffffff 0x00000000 0x00000000 0x00000000 ) ^ 0x00000000 0x00000000 0x00000000 0x00000000 ]
> > >    [ cmp eq reg 1 0x2a687465 0x00000000 0x00000000 0x00000000 ]
> > 
> > Why do we need a bitwise op for this?
> > 
> > Instead we could just ask for cmp of 3 bytes ('eth' instead of 4 'eth\0')?
> > 
> > You might recall ancient RFC patch for this:
> > https://patchwork.ozlabs.org/patch/283639/
> 
> This is actually something I think should be implemented as general
> optimzation. It also applies to network address matches, where we
> can also avoid loading unnecessary data. Other cases will benefit
> from this as well.

Sorry, I'm dense.

So what you're saying is that Pablos patch with bitwise op + cmp is fine
and that you'd suggest to later add code to e.g. netlink serialize step
that checks if bitop+cmp can be replaced by a single cmp operation?

  reply	other threads:[~2015-10-18 19:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-18 18:02 [PATCH nft] src: add interface wildcard matching Pablo Neira Ayuso
2015-10-18 18:33 ` Florian Westphal
2015-10-18 19:04   ` Patrick McHardy
2015-10-18 19:43     ` Florian Westphal [this message]
2015-10-18 20:39       ` Patrick McHardy
2015-10-18 20:14   ` Pablo Neira Ayuso
2015-10-18 20:18     ` 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=20151018194330.GB4386@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=kaber@trash.net \
    --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.