diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2022-06-16 10:53:56 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2022-06-19 00:55:20 +0200 |
commit | d434de8b50dcf3f5f4ca027e122a7df9d4e5d8e1 (patch) | |
tree | 261b62cea8db499c6b5bc41935db12347f5ca2ce /src/intervals.c | |
parent | 87ba510fc704f766b5417d3bfc326e8ab9378c2a (diff) |
intervals: do not empty cache for maps
Translate set element to range and sort in maps for the NFT_SET_MAP
case, which does not support for automerge yet.
Fixes: 81e36530fcac ("src: replace interval segment tree overlap and automerge")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/intervals.c')
-rw-r--r-- | src/intervals.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/intervals.c b/src/intervals.c index 89f5c33d..e2034132 100644 --- a/src/intervals.c +++ b/src/intervals.c @@ -216,6 +216,12 @@ int set_automerge(struct list_head *msgs, struct cmd *cmd, struct set *set, struct cmd *purge_cmd; struct handle h = {}; + if (set->flags & NFT_SET_MAP) { + set_to_range(init); + list_expr_sort(&init->expressions); + return 0; + } + if (existing_set) { if (existing_set->init) { list_splice_init(&existing_set->init->expressions, @@ -229,9 +235,6 @@ int set_automerge(struct list_head *msgs, struct cmd *cmd, struct set *set, set_to_range(init); list_expr_sort(&init->expressions); - if (set->flags & NFT_SET_MAP) - return 0; - ctx.purge = set_expr_alloc(&internal_location, set); setelem_automerge(&ctx); |