From: Patrick McHardy <kaber@trash.net>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nft 0/4] Interval overlap detection for named sets
Date: Mon, 25 Apr 2016 11:38:32 +0100 [thread overview]
Message-ID: <20160425103832.GC29560@macbook.localdomain> (raw)
In-Reply-To: <1461427720-4939-1-git-send-email-pablo@netfilter.org>
On 23.04, Pablo Neira Ayuso wrote:
> Hi,
>
> This patchset adds the missing code to reject overlapping intervals.
>
> # nft add table ip filter
> # nft add set ip filter myset { type ipv4_addr\; flags interval\; }
> # nft add chain ip filter output { type filter hook output priority 0\; }
> # nft add rule ip daddr @myset counter packets 0 bytes 0
> # nft add element ip filter myset { 127.0.0.0/16 }
>
> Then, if you add an overlapping element:
>
> # nft add element ip filter myset { 127.0.0.0/24 }
> <cmdline>:1:31-42: Error: interval overlaps with an existing one
> add element ip filter myset { 127.0.0.0/24 }
> ^^^^^^^^^^^^
>
> The new validation code from userspace rejects this to avoid shadowing
> issues.
This is actually intended. There is no issue with shadowing since sets only
contain one statement, present or not present. For maps something like this
does make sense, but for sets it only makes it harder to use.
Generally, we have a conflict resolution based on size, the more specific
element wins. The assumption being that if you add something generic and
something more specific, the more specific item is an exception to the
more generic one.
> Pablo Neira Ayuso (4):
> segtree: set expr->len for prefix expression from interval_map_decompose()
> segtree: add expr_to_intervals()
> segtree: rename set expression set_to_segtree()
> segtree: add interval overlap detection for dynamic updates
>
> src/segtree.c | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++--------
> 1 file changed, 80 insertions(+), 12 deletions(-)
>
> --
> 2.1.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
next prev parent reply other threads:[~2016-04-25 10:38 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-23 16:08 [PATCH nft 0/4] Interval overlap detection for named sets Pablo Neira Ayuso
2016-04-23 16:08 ` [PATCH nft 1/4] segtree: set expr->len for prefix expression from interval_map_decompose() Pablo Neira Ayuso
2016-04-23 16:08 ` [PATCH nft 2/4] segtree: add expr_to_intervals() Pablo Neira Ayuso
2016-04-23 16:08 ` [PATCH nft 3/4] segtree: rename set expression set_to_segtree() Pablo Neira Ayuso
2016-04-23 16:08 ` [PATCH nft 4/4] segtree: add interval overlap detection for dynamic updates Pablo Neira Ayuso
2016-04-25 10:38 ` Patrick McHardy [this message]
2016-04-25 11:57 ` [PATCH nft 0/4] Interval overlap detection for named sets Pablo Neira Ayuso
2016-04-25 16:59 ` Patrick McHardy
2016-04-25 21:32 ` Pablo Neira Ayuso
2016-04-25 21:49 ` Patrick McHardy
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=20160425103832.GC29560@macbook.localdomain \
--to=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 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).