From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Subject: [PATCH nft 09/18] cache: add set_cache_del() and use it
Date: Fri, 30 Apr 2021 01:42:46 +0200 [thread overview]
Message-ID: <20210429234255.16840-10-pablo@netfilter.org> (raw)
In-Reply-To: <20210429234255.16840-1-pablo@netfilter.org>
Update set_cache_del() from the monitor path to remove sets
in the cache.
Fixes: df48e56e987f ("cache: add hashtable cache for sets")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
include/cache.h | 1 +
src/cache.c | 5 +++++
src/monitor.c | 2 +-
3 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/include/cache.h b/include/cache.h
index 992f993c0667..f5b4876a4d40 100644
--- a/include/cache.h
+++ b/include/cache.h
@@ -70,6 +70,7 @@ struct chain;
void chain_cache_add(struct chain *chain, struct table *table);
struct chain *chain_cache_find(const struct table *table, const char *name);
void set_cache_add(struct set *set, struct table *table);
+void set_cache_del(struct set *set);
struct set *set_cache_find(const struct table *table, const char *name);
struct cache {
diff --git a/src/cache.c b/src/cache.c
index 1aec12666d52..03b781bb4834 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -319,6 +319,11 @@ void set_cache_add(struct set *set, struct table *table)
cache_add(&set->cache, &table->set_cache, hash);
}
+void set_cache_del(struct set *set)
+{
+ cache_del(&set->cache);
+}
+
struct set *set_cache_find(const struct table *table, const char *name)
{
struct set *set;
diff --git a/src/monitor.c b/src/monitor.c
index ae288f6cb212..00cf7d135034 100644
--- a/src/monitor.c
+++ b/src/monitor.c
@@ -687,7 +687,7 @@ out:
static void netlink_events_cache_delset_cb(struct set *s,
void *data)
{
- list_del(&s->list);
+ set_cache_del(s);
set_free(s);
}
--
2.20.1
next prev parent reply other threads:[~2021-04-29 23:43 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-29 23:42 [PATCH nft 00/18] cache updates,v2 Pablo Neira Ayuso
2021-04-29 23:42 ` [PATCH nft 01/18] tests: shell: remove missing modules Pablo Neira Ayuso
2021-04-29 23:42 ` [PATCH nft 02/18] src: unbreak deletion by table handle Pablo Neira Ayuso
2021-04-29 23:42 ` [PATCH nft 03/18] rule: skip fuzzy lookup for unexisting 64-bit handle Pablo Neira Ayuso
2021-04-29 23:42 ` [PATCH nft 04/18] src: pass chain name to chain_cache_find() Pablo Neira Ayuso
2021-04-29 23:42 ` [PATCH nft 05/18] src: consolidate nft_cache infrastructure Pablo Neira Ayuso
2021-04-29 23:42 ` [PATCH nft 06/18] src: consolidate object cache infrastructure Pablo Neira Ayuso
2021-04-29 23:42 ` [PATCH nft 07/18] cache: add hashtable cache for object Pablo Neira Ayuso
2021-04-29 23:42 ` [PATCH nft 08/18] cache: add hashtable cache for flowtable Pablo Neira Ayuso
2021-04-29 23:42 ` Pablo Neira Ayuso [this message]
2021-04-29 23:42 ` [PATCH nft 10/18] evaluate: add set to the cache Pablo Neira Ayuso
2021-04-29 23:42 ` [PATCH nft 11/18] evaluate: add flowtable " Pablo Neira Ayuso
2021-04-29 23:42 ` [PATCH nft 12/18] cache: missing table cache for several policy objects Pablo Neira Ayuso
2021-04-29 23:42 ` [PATCH nft 13/18] evaluate: add object to the cache Pablo Neira Ayuso
2021-04-29 23:42 ` [PATCH nft 14/18] cache: add hashtable cache for table Pablo Neira Ayuso
2021-04-29 23:42 ` [PATCH nft 15/18] evaluate: remove chain from cache on delete chain command Pablo Neira Ayuso
2021-04-29 23:42 ` [PATCH nft 16/18] evaluate: remove set from cache on delete set command Pablo Neira Ayuso
2021-04-29 23:42 ` [PATCH nft 17/18] evaluate: remove flowtable from cache on delete flowtable command Pablo Neira Ayuso
2021-04-29 23:42 ` [PATCH nft 18/18] evaluate: remove object from cache on delete object command Pablo Neira Ayuso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210429234255.16840-10-pablo@netfilter.org \
--to=pablo@netfilter.org \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).