All of lore.kernel.org
 help / color / mirror / Atom feed
From: Phil Sutter <phil@nwl.cc>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org
Subject: [nft PATCH 3/5] cache: Relax chain_cache_dump filter application
Date: Wed, 11 Mar 2026 00:11:13 +0100	[thread overview]
Message-ID: <20260310231115.25638-4-phil@nwl.cc> (raw)
In-Reply-To: <20260310231115.25638-1-phil@nwl.cc>

While populating chain cache, a filter was only effective if it limited
fetching to both a table and a chain. Make it apply to 'list chains'
command as well which at most specifies a family and table.

Since the code is OK with filter->list fields being NULL, merely check
for filter to be non-NULL (which is the case if nft_cache_update() is
called by nft_cmd_enoent_chain()).

Signed-off-by: Phil Sutter <phil@nwl.cc>
---
 src/cache.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/cache.c b/src/cache.c
index 82efd476e3698..13d4cb19eb4f6 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -625,7 +625,7 @@ chain_cache_dump(struct netlink_ctx *ctx,
 	const char *chain = NULL;
 	int family = NFPROTO_UNSPEC;
 
-	if (filter && filter->list.table && filter->list.chain) {
+	if (filter) {
 		family = filter->list.family;
 		table = filter->list.table;
 		chain = filter->list.chain;
-- 
2.51.0


  parent reply	other threads:[~2026-03-10 23:11 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-10 23:11 [nft PATCH 0/5] Enhance cache filter for list commands Phil Sutter
2026-03-10 23:11 ` [nft PATCH 1/5] cache: Include chains, flowtables and objects in netlink debug output Phil Sutter
2026-03-10 23:11 ` [nft PATCH 2/5] cache: Respect family in all list commands Phil Sutter
2026-03-11  9:34   ` Pablo Neira Ayuso
2026-03-11 10:19     ` Phil Sutter
2026-03-11 12:11       ` Pablo Neira Ayuso
2026-03-11 14:01         ` Phil Sutter
2026-03-10 23:11 ` Phil Sutter [this message]
2026-03-11  9:38   ` [nft PATCH 3/5] cache: Relax chain_cache_dump filter application Pablo Neira Ayuso
2026-03-10 23:11 ` [nft PATCH 4/5] cache: Filter for table when listing sets or maps Phil Sutter
2026-03-11  9:39   ` Pablo Neira Ayuso
2026-03-10 23:11 ` [nft PATCH 5/5] cache: Filter for table when listing flowtables Phil Sutter
2026-03-11  9:40   ` Pablo Neira Ayuso
2026-03-11 15:06 ` [nft PATCH 0/5] Enhance cache filter for list commands Eric Garver
2026-03-11 19:15   ` Phil Sutter
2026-03-18 16:23 ` Phil Sutter
2026-03-18 16:58   ` Pablo Neira Ayuso
2026-03-18 16:59     ` Pablo Neira Ayuso
2026-03-18 18:49       ` Phil Sutter

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=20260310231115.25638-4-phil@nwl.cc \
    --to=phil@nwl.cc \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.