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 --- 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