From 9189d1898f2f6c10689e1147e97f3a382d272e41 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Thu, 10 Sep 2020 16:19:44 +0200 Subject: nft: cache: Move nft_chain_find() over It is basically just a cache lookup, hence fits better in here. Signed-off-by: Phil Sutter --- iptables/nft.c | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'iptables/nft.c') diff --git a/iptables/nft.c b/iptables/nft.c index afe7fe9e..9b40b3c3 100644 --- a/iptables/nft.c +++ b/iptables/nft.c @@ -738,9 +738,6 @@ nft_chain_builtin_find(const struct builtin_table *t, const char *chain) return found ? &t->chains[i] : NULL; } -static struct nftnl_chain * -nft_chain_find(struct nft_handle *h, const char *table, const char *chain); - static void nft_chain_builtin_init(struct nft_handle *h, const struct builtin_table *table) { @@ -1837,20 +1834,6 @@ out: return ret == 0 ? 1 : 0; } -static struct nftnl_chain * -nft_chain_find(struct nft_handle *h, const char *table, const char *chain) -{ - const struct builtin_table *t; - struct nftnl_chain_list *list; - - t = nft_table_builtin_find(h, table); - if (!t) - return NULL; - - list = h->cache->table[t->type].chains; - return list ? nftnl_chain_list_lookup_byname(list, chain) : NULL; -} - bool nft_chain_exists(struct nft_handle *h, const char *table, const char *chain) { -- cgit v1.2.3