]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
nft: Avoid nested cache fetching
authorPhil Sutter <phil@nwl.cc>
Mon, 7 Oct 2019 10:35:21 +0000 (12:35 +0200)
committerPhil Sutter <phil@nwl.cc>
Thu, 10 Oct 2019 21:51:16 +0000 (23:51 +0200)
Don't call fetch_table_cache() from within fetch_chain_cache() but
instead from __nft_build_cache(). Since that is the only caller of
fetch_chain_cache(), this change should not have any effect in practice.

Signed-off-by: Phil Sutter <phil@nwl.cc>
Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
iptables/nft.c

index bdc9fbc37f110fc1d7a8d6164866701d02e3a4ad..3228842cd3c8bdf0e5f5122e3001e531aa1dd797 100644 (file)
@@ -1414,8 +1414,6 @@ static int fetch_chain_cache(struct nft_handle *h)
        struct nlmsghdr *nlh;
        int i, ret;
 
-       fetch_table_cache(h);
-
        for (i = 0; i < NFT_TABLE_MAX; i++) {
                enum nft_table_type type = h->tables[i].type;
 
@@ -1592,6 +1590,7 @@ static void __nft_build_cache(struct nft_handle *h)
 
 retry:
        mnl_genid_get(h, &genid_start);
+       fetch_table_cache(h);
        fetch_chain_cache(h);
        fetch_rule_cache(h);
        h->have_cache = true;