netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Subject: [PATCH nft 03/10] cache: add set_cache_del() and use it
Date: Thu, 15 Apr 2021 15:13:23 +0200	[thread overview]
Message-ID: <20210415131330.6692-4-pablo@netfilter.org> (raw)
In-Reply-To: <20210415131330.6692-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     | 6 ++++++
 src/monitor.c   | 2 +-
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/include/cache.h b/include/cache.h
index 6fa21742503c..d3be4c8a8693 100644
--- a/include/cache.h
+++ b/include/cache.h
@@ -60,6 +60,7 @@ void chain_cache_add(struct chain *chain, struct table *table);
 struct chain *chain_cache_find(const struct table *table,
 			       const struct handle *handle);
 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);
 
 void obj_cache_add(struct obj *obj, struct table *table);
diff --git a/src/cache.c b/src/cache.c
index 95b5c46306c3..73c96a17704a 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -324,6 +324,12 @@ void set_cache_add(struct set *set, struct table *table)
 	list_add_tail(&set->cache_list, &table->cache_set);
 }
 
+void set_cache_del(struct set *set)
+{
+	list_del(&set->cache_hlist);
+	list_del(&set->cache_list);
+}
+
 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 1f0f8a361fbd..eb887d9344fa 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


  parent reply	other threads:[~2021-04-15 13:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-15 13:13 [PATCH nft 0/10] cache updates Pablo Neira Ayuso
2021-04-15 13:13 ` [PATCH nft 01/10] cache: add hashtable cache for object Pablo Neira Ayuso
2021-04-15 13:13 ` [PATCH nft 02/10] cache: add hashtable cache for flowtable Pablo Neira Ayuso
2021-04-15 13:13 ` Pablo Neira Ayuso [this message]
2021-04-15 13:13 ` [PATCH nft 04/10] evaluate: add set to the cache Pablo Neira Ayuso
2021-04-15 13:13 ` [PATCH nft 05/10] evaluate: add flowtable " Pablo Neira Ayuso
2021-04-15 13:13 ` [PATCH nft 06/10] cache: missing table cache for several policy objects Pablo Neira Ayuso
2021-04-15 13:13 ` [PATCH nft 07/10] evaluate: add object to the cache Pablo Neira Ayuso
2021-04-15 13:13 ` [PATCH nft 08/10] cache: move struct nft_cache declaration to cache.h Pablo Neira Ayuso
2021-04-15 13:13 ` [PATCH nft 09/10] cache: add hashtable cache for table Pablo Neira Ayuso
2021-04-15 13:13 ` [PATCH nft 10/10] evaluate: remove table_lookup_global() 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=20210415131330.6692-4-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).