]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
nft: Make nftnl_table_list_get() fetch only tables
authorPhil Sutter <phil@nwl.cc>
Tue, 24 Sep 2019 14:57:24 +0000 (16:57 +0200)
committerPhil Sutter <phil@nwl.cc>
Mon, 30 Sep 2019 06:12:36 +0000 (08:12 +0200)
No need for a full cache to serve the list of tables.

Signed-off-by: Phil Sutter <phil@nwl.cc>
Acked-by: Florian Westphal <fw@strlen.de>
iptables/nft.c

index 0249cbbe486390ca01f1a380545f4e8c5362f73f..fde1b2a3e057e3443fd9d850ac88c05e456dc20d 100644 (file)
@@ -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;
 }