Skip to contentSkip to conversation

evaluate: add set to cache once

PATCH In review Pablo Neira Ayuso 2 participants 2 messages Jun 14, 2021 netfilter

lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

PATCH 1/1 evaluate: add set to cache once

67d3969a7244 ("evaluate: add set to the cache") re-adds the set into the cache again.

This bug was hidden behind 5ec5c706d993 ("cache: add hashtable cache for table") which broken set_evaluate() for anonymous sets.

Phil reported a gcc compilation warning which uncovered this problem.

Fixes 67d3969a7244 ("evaluate: add set to the cache")
---
 src/evaluate.c | 3 ---
 1 file changed, 3 deletions(-)
src/evaluate.c +0 -3
index 5311963a20c5..92cc8994c809 100644
@@ -3867,9 +3867,6 @@ static int set_evaluate(struct eval_ctx *ctx, struct set *set)
 	}
 	ctx->set = NULL;
 
-	if (set_cache_find(table, set->handle.set.name) == NULL)
-		set_cache_add(set_get(set), table);
-
 	return 0;
 }
 
Signature · 1 line
2.20.1
reviewer
#1 lore raw
Quoted 11 lines · Pablo Neira Ayuso

67d3969a7244 ("evaluate: add set to the cache") re-adds the set into the cache again.

This bug was hidden behind 5ec5c706d993 ("cache: add hashtable cache for table") which broken set_evaluate() for anonymous sets.

Phil reported a gcc compilation warning which uncovered this problem.

Fixes 67d3969a7244 ("evaluate: add set to the cache")

Thanks for the quick fix!

Out of curiosity, did you not use set_is_anonymous() in commit bbcc5eda7e588 on purpose?

Cheers, Phil