From: Florian Westphal <fw@strlen.de>
To: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Cc: Florian Westphal <fw@strlen.de>, netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nf] ipset: allow a 0 netmask with hash_netiface type
Date: Tue, 12 Jan 2016 20:53:23 +0100 [thread overview]
Message-ID: <20160112195323.GB17166@breakpoint.cc> (raw)
In-Reply-To: <alpine.DEB.2.10.1601122046240.19324@blackhole.kfki.hu>
Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> wrote:
> Hi Florian,
>
> On Tue, 12 Jan 2016, Florian Westphal wrote:
>
> > Jozsef says:
> > The correct behaviour is that if we have
> > ipset create test1 hash:net,iface
> > ipset add test1 0.0.0.0/0,eth0
> > iptables -A INPUT -m set --match-set test1 src,src
> >
> > then the rule should match for any traffic coming in through eth0.
> >
> > This removes the -EINVAL runtime test to make matching work
> > in case packet arrived via the specified interface.
>
> No, the patch actually would break the set type. In order to support /0
> prefixes, cidr + 1 is stored internally. Zero value means "empty
> slot/bucket".
Hmm, but matching is broken currently, the rule quoted above never
matches. And its exaclty because of if (e.cidr == 0) is true.
Tested with nf-next tree.
Before patch: never matches
After patch: matches for all packets from eth0
next prev parent reply other threads:[~2016-01-12 19:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-12 16:07 [PATCH nf] ipset: allow a 0 netmask with hash_netiface type Florian Westphal
2016-01-12 19:51 ` Jozsef Kadlecsik
2016-01-12 19:53 ` Florian Westphal [this message]
2016-01-12 20:38 ` Jozsef Kadlecsik
2016-01-13 8:33 ` Jozsef Kadlecsik
2016-01-13 8:35 ` Jozsef Kadlecsik
2016-01-13 13:07 ` 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=20160112195323.GB17166@breakpoint.cc \
--to=fw@strlen.de \
--cc=kadlec@blackhole.kfki.hu \
--cc=netfilter-devel@vger.kernel.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).