From: Mr Dash Four <mr.dash.four@googlemail.com>
To: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Cc: "'netfilter@vger.kernel.org'" <netfilter@vger.kernel.org>
Subject: Re: ipset 6.6 bug: subnet (mis)matching
Date: Wed, 08 Jun 2011 13:12:19 +0100 [thread overview]
Message-ID: <4DEF6723.1030902@googlemail.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1106081327030.31592@blackhole.kfki.hu>
> Current behaviour cannot be modified easily. There's no overlap checking
> (and aggregation/breaking up) in ipset, so it can't be prevented that
> someone adds overlapping elements to a set:
>
> add 10.16.0.0/16
> add 10.16.1.0/24
>
> Now if 10.16.1.0/24 is tested as you suggest, one cannot tell whether the
> explicit network 10.16.1.0/24 is added to the set or the tested elements
> are just the members of a larger network.
>
> Currently:
> test 10.16.1.1 => test explicit and implicit membership
> test 10.16.1.0/24 => test explicit membership only
>
> What you propose is to test explicit and implicit membership in all cases.
>
The way I see it, you can take the base of a set member (10.16.0.0 in my
case), build up a mask with the range (16), do the same with the range
being tested and then match them with logical "and". If you get the same
result as the set member - you have a match, if you don't there isn't a
(complete) match.
Alternatively, you could loop through the members of the specified range
to be tested and compare against the set members, but that would be a
bit slower, though since this is done in userspace (i.e. interactively)
speed wouldn't be that important compared to the kernel matching where
good performance is needed.
> My top priority now is to get the kernel in sync with ipset 6.7. It's just
> a much higher problem, because a lot of features and fixes are missing,
> even from the newest kernel version.
>
I am not asking or demanding anything to be implemented/corrected
immediately - I am simply making you aware of a bug in ipset I found
last night. If/When you are going to fix it it is for you to decide -
you are the author of ipset, not me - I am just a user.
prev parent reply other threads:[~2011-06-08 12:12 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-24 8:48 [ANNOUNCE] ipset 6.6 released Jozsef Kadlecsik
2011-05-24 11:09 ` Mr Dash Four
2011-05-24 11:44 ` Jozsef Kadlecsik
2011-06-08 1:17 ` ipset 6.6 bug: subnet (mis)matching Mr Dash Four
2011-06-08 7:07 ` Jozsef Kadlecsik
2011-06-08 10:07 ` Mr Dash Four
2011-06-08 10:46 ` Jozsef Kadlecsik
2011-06-08 11:21 ` Mr Dash Four
2011-06-08 11:43 ` Jozsef Kadlecsik
2011-06-08 12:12 ` Mr Dash Four [this message]
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=4DEF6723.1030902@googlemail.com \
--to=mr.dash.four@googlemail.com \
--cc=kadlec@blackhole.kfki.hu \
--cc=netfilter@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