From 9a4b513014cfdeaad6d247b72a7924b3a536cfe9 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Wed, 10 Jan 2018 21:32:04 +0100 Subject: src: Don't merge adjacent/overlapping ranges Previously, when adding multiple ranges to a set they were merged if overlapping or adjacent. This might cause inconvenience though since it is afterwards not easily possible anymore to remove one of the merged ranges again while keeping the others in place. Since it is not possible to have overlapping ranges, this patch adds a check for newly added ranges to make sure they don't overlap if merging is turned off. Note that it is not possible (yet?) to enable range merging using nft tool. Testsuite had to be adjusted as well: One test in tests/py changed avoid adding overlapping ranges and the test in tests/shell which explicitly tests for this feature dropped. Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso --- include/expression.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/expression.h') diff --git a/include/expression.h b/include/expression.h index 915ce0ba..0a0e178f 100644 --- a/include/expression.h +++ b/include/expression.h @@ -419,7 +419,7 @@ extern struct expr *set_expr_alloc(const struct location *loc, const struct set *set); extern int set_to_intervals(struct list_head *msgs, struct set *set, struct expr *init, bool add, - unsigned int debug_mask); + unsigned int debug_mask, bool merge); extern void interval_map_decompose(struct expr *set); extern struct expr *mapping_expr_alloc(const struct location *loc, -- cgit v1.2.3