Skip to content

Commit 9d74da1

Browse files
committed
netfilter: nft_set_hash: GC reaps elements with conncount for dynamic sets only
conncount has its own GC handler which determines when to reap stale elements, this is convenient for dynamic sets. However, this also reaps non-dynamic sets with static configurations coming from control plane. Always run connlimit gc handler but honor feedback to reap element if this set is dynamic. Fixes: 290180e ("netfilter: nf_tables: add connlimit support") Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
1 parent ed3ba9b commit 9d74da1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/netfilter/nft_set_hash.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,8 @@ static bool nft_rhash_expr_needs_gc_run(const struct nft_set *set,
309309

310310
nft_setelem_expr_foreach(expr, elem_expr, size) {
311311
if (expr->ops->gc &&
312-
expr->ops->gc(read_pnet(&set->net), expr))
312+
expr->ops->gc(read_pnet(&set->net), expr) &&
313+
set->flags & NFT_SET_EVAL)
313314
return true;
314315
}
315316

0 commit comments

Comments
 (0)