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 --- tests/shell/testcases/sets/0002named_interval_automerging_0 | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100755 tests/shell/testcases/sets/0002named_interval_automerging_0 (limited to 'tests/shell') diff --git a/tests/shell/testcases/sets/0002named_interval_automerging_0 b/tests/shell/testcases/sets/0002named_interval_automerging_0 deleted file mode 100755 index b07e0b09..00000000 --- a/tests/shell/testcases/sets/0002named_interval_automerging_0 +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# This testscase checks the automerging of adjacent intervals - -set -e - -$NFT add table t -$NFT add set t s { type ipv4_addr \; flags interval \; } -$NFT add element t s { 192.168.0.0/24, 192.168.1.0/24 } -$NFT list ruleset | grep "192.168.0.0/23" >/dev/null && exit 0 -echo "E: automerging of adjavect intervals failed in named set" >&2 -exit 1 -- cgit v1.2.3