From cb4b07d0b62836ab860e11e1f50c98656eeb4f9f Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Tue, 30 Nov 2021 20:06:09 +0100 Subject: cache: Support filtering for a specific flowtable Extend nft_cache_filter to hold a flowtable name so 'list flowtable' command causes fetching the requested flowtable only. Dump flowtables just once instead of for each table, merely assign fetched data to tables inside the loop. Signed-off-by: Phil Sutter --- src/netlink.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/netlink.c') diff --git a/src/netlink.c b/src/netlink.c index f74c0383..359d801c 100644 --- a/src/netlink.c +++ b/src/netlink.c @@ -1721,7 +1721,8 @@ int netlink_list_flowtables(struct netlink_ctx *ctx, const struct handle *h) struct nftnl_flowtable_list *flowtable_cache; int err; - flowtable_cache = mnl_nft_flowtable_dump(ctx, h->family, h->table.name); + flowtable_cache = mnl_nft_flowtable_dump(ctx, h->family, + h->table.name, NULL); if (flowtable_cache == NULL) { if (errno == EINTR) return -1; -- cgit v1.2.3