Skip to content

Commit d111692

Browse files
ummakynesFlorian Westphal
authored andcommitted
netfilter: nft_set_rbtree: .deactivate fails if element has expired
This allows to remove an expired element which is not possible in other existing set backends, this is more noticeable if gc-interval is high so expired elements remain in the tree. On-demand gc also does not help in this case, because this is delete element path. Return NULL if element has expired. Fixes: 8d8540c ("netfilter: nft_set_rbtree: add timeout support") Signed-off-by: Pablo Neira Ayuso <[email protected]> Signed-off-by: Florian Westphal <[email protected]>
1 parent 2e2d9c7 commit d111692

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

net/netfilter/nft_set_rbtree.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,8 @@ static void *nft_rbtree_deactivate(const struct net *net,
568568
nft_rbtree_interval_end(this)) {
569569
parent = parent->rb_right;
570570
continue;
571+
} else if (nft_set_elem_expired(&rbe->ext)) {
572+
break;
571573
} else if (!nft_set_elem_active(&rbe->ext, genmask)) {
572574
parent = parent->rb_left;
573575
continue;

0 commit comments

Comments
 (0)