Re: [PATCH nf] ipset: allow a 0 netmask with hash_netiface type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jozsef Kadlecsik <kadlec@xxxxxxxxxxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux