[iptables PATCH v2 05/24] nft: Make nftnl_table_list_get() fetch only tables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: Phil Sutter <phil@xxxxxx>
---
 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




[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux