Commit babc3dc9 authored by Pablo Neira Ayuso's avatar Pablo Neira Ayuso

netfilter: nft_set_rbtree: overlap detection with element re-addition after deletion

This patch fixes spurious EEXIST errors.

Extend d2df92e9 ("netfilter: nft_set_rbtree: handle element
re-addition after deletion") to deal with elements with same end flags
in the same transation.

Reset the overlap flag as described by 7c84d414 ("netfilter:
nft_set_rbtree: Detect partial overlaps on insertion").

Fixes: 7c84d414 ("netfilter: nft_set_rbtree: Detect partial overlaps on insertion")
Fixes: d2df92e9 ("netfilter: nft_set_rbtree: handle element re-addition after deletion")
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
Reviewed-by: default avatarStefano Brivio <sbrivio@redhat.com>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent eba1a872
...@@ -349,7 +349,11 @@ static int __nft_rbtree_insert(const struct net *net, const struct nft_set *set, ...@@ -349,7 +349,11 @@ static int __nft_rbtree_insert(const struct net *net, const struct nft_set *set,
*ext = &rbe->ext; *ext = &rbe->ext;
return -EEXIST; return -EEXIST;
} else { } else {
overlap = false;
if (nft_rbtree_interval_end(rbe))
p = &parent->rb_left; p = &parent->rb_left;
else
p = &parent->rb_right;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment