Pablo Neira Ayuso 30f6679206 src: add 'auto-merge' option to sets
After discussions with Karel here:

https://bugzilla.netfilter.org/show_bug.cgi?id=1184

And later on with Phil Sutter, we decided to disable the automatic merge
feature in sets with intervals. This feature is problematic because it
introduces an inconsistency between what we add and what we later on
get. This is going to get worse with the upcoming timeout support for
intervals. Therefore, we turned off this by default.

However, Jeff Kletsky and folks like this feature, so let's restore this
behaviour on demand with this new 'auto-merge' statement, that you can
place on the set definition, eg.

 # nft list ruleset
 table ip x {
	...
        set y {
                type ipv4_addr
                flags interval
                auto-merge
        }
 }
 # nft add element x z { 1.1.1.1-2.2.2.2, 1.1.1.2 }

Regarding implementation details: Given this feature only makes sense
from userspace, let's store this in the set user data area, so nft knows
it has to do automatic merge of adjacent/overlapping elements as per
user request.

 # nft add set x z { type ipv4_addr\; auto-merge\; }
 Error: auto-merge only works with interval sets
 add set x z { type ipv4_addr; auto-merge; }
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Fixes: https://bugzilla.netfilter.org/show_bug.cgi?id=1216
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2018-01-22 11:47:58 +01:00
2018-01-22 11:47:58 +01:00
2014-11-12 19:41:13 +01:00
2018-01-22 11:47:58 +01:00
2018-01-19 13:52:38 +01:00
2009-03-18 04:55:00 +01:00
2009-03-18 04:55:00 +01:00
2009-03-18 08:20:02 +01:00
Description
No description provided
7.3 MiB
Languages
C 61.3%
Shell 21.7%
Yacc 6%
Raku 3.5%
Python 2.9%
Other 4.6%