diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2022-06-23 18:41:21 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2022-06-23 20:08:18 +0200 |
commit | 6d1ee9267e7e5e429a84d7bb8a8644f9eebddb22 (patch) | |
tree | 93c0385dacb4718c5067e5859499022a0f160955 /tests | |
parent | 5357cb7b5cb93fc9b20d4d95b093d6b9f86b7727 (diff) |
intervals: check for EXPR_F_REMOVE in case of element mismatch
If auto-merge is disable and element to be deleted finds no exact
matching, then bail out.
Fixes: 3e8d934e4f72 ("intervals: support to partial deletion with automerge")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/shell/testcases/sets/errors_0 | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/tests/shell/testcases/sets/errors_0 b/tests/shell/testcases/sets/errors_0 index 2960b694..a676ac73 100755 --- a/tests/shell/testcases/sets/errors_0 +++ b/tests/shell/testcases/sets/errors_0 @@ -1,7 +1,5 @@ #!/bin/bash -set -e - RULESET="table ip x { set y { type ipv4_addr @@ -11,4 +9,22 @@ RULESET="table ip x { delete element ip x y { 2.3.4.5 }" +$NFT -f - <<< $RULESET +if [ $? -eq 0 ] +then + exit 1 +fi + +RULESET="table ip x { + set y { + type ipv4_addr + flags interval + } +} + +add element x y { 1.1.1.1/24 } +delete element x y { 1.1.1.1/24 } +add element x y { 1.1.1.1/24 } +delete element x y { 2.2.2.2/24 }" + $NFT -f - <<< $RULESET || exit 0 |