No need for a full cache to serve the list of tables.

Signed-off-by: Phil Sutter <p...@nwl.cc>
---
 iptables/nft.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/iptables/nft.c b/iptables/nft.c
index 255e51b4d2275..695758831047a 100644
--- a/iptables/nft.c
+++ b/iptables/nft.c
@@ -2046,7 +2046,8 @@ int nft_chain_user_rename(struct nft_handle *h,const char 
*chain,
 
 static struct nftnl_table_list *nftnl_table_list_get(struct nft_handle *h)
 {
-       nft_build_cache(h);
+       if (!h->cache->tables)
+               fetch_table_cache(h);
 
        return h->cache->tables;
 }
-- 
2.23.0

Reply via email to