]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
cache: only dump rules for the given table
authorPablo Neira Ayuso <pablo@netfilter.org>
Sun, 25 Aug 2024 22:41:40 +0000 (00:41 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 23 Jan 2025 00:35:37 +0000 (01:35 +0100)
commit ebd06f85a3257c294572005d0fa6b8ab0f213486 upstream.

Only family is set on in the dump request, set on table and chain
otherwise, rules for the given family are fetched for each existing
table.

Fixes: afbd102211dc ("src: do not use the nft_cache_filter object from mnl.c")
Tested-by: Eric Garver <eric@garver.life>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/cache.c

index 697ba0d5f20fbc41b37b18ef5e00767cbc715008..a2757aade32f39767cb5a733fffd5bc646c327cd 100644 (file)
@@ -605,7 +605,7 @@ static int rule_cache_dump(struct netlink_ctx *ctx, const struct handle *h,
                           const struct nft_cache_filter *filter)
 {
        struct nftnl_rule_list *rule_cache;
-       const char *table = NULL;
+       const char *table = h->table.name;
        const char *chain = NULL;
 
        if (filter) {