From 27d01216cf05eb0b49b6456137e01a44d4547796 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Thu, 30 Jul 2020 11:54:36 +0200 Subject: nft: Eliminate table list from cache The full list of tables in kernel is not relevant, only those used by iptables-nft and for those, knowing if they exist or not is sufficient. For holding that information, the already existing 'table' array in nft_cache suits well. Consequently, nft_table_find() merely checks if the new 'exists' boolean is true or not and nft_for_each_table() iterates over the builtin_table array in nft_handle, additionally checking the boolean in cache for whether to skip the entry or not. Signed-off-by: Phil Sutter --- iptables/nft-cache.h | 9 --------- 1 file changed, 9 deletions(-) (limited to 'iptables/nft-cache.h') diff --git a/iptables/nft-cache.h b/iptables/nft-cache.h index aeab4bde..76f9fbb6 100644 --- a/iptables/nft-cache.h +++ b/iptables/nft-cache.h @@ -1,8 +1,6 @@ #ifndef _NFT_CACHE_H_ #define _NFT_CACHE_H_ -#include - struct nft_handle; struct nft_cmd; @@ -19,12 +17,5 @@ struct nftnl_chain_list * nft_chain_list_get(struct nft_handle *h, const char *table, const char *chain); struct nftnl_set_list * nft_set_list_get(struct nft_handle *h, const char *table, const char *set); -struct list_head *nft_table_list_get(struct nft_handle *h); - -struct nft_table { - struct list_head list; - struct nftnl_table *nftnl; -}; - #endif /* _NFT_CACHE_H_ */ -- cgit v1.2.3