]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
xtables: Use correct built-in chain count
authorPhil Sutter <phil@nwl.cc>
Thu, 2 Aug 2018 15:05:13 +0000 (17:05 +0200)
committerFlorian Westphal <fw@strlen.de>
Sat, 4 Aug 2018 12:15:17 +0000 (14:15 +0200)
In nft_chain_builtin_init(), The wrong macro was used for iterating over
the built-in chains of a given table. That array's length is defined
using NF_INET_NUMHOOKS, not NF_IP_NUMHOOKS. Though this change is rather
cosmetic since both macros resolve into the same value.

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

index 05cd1564eaea16621fa7b99e1ef8779c7e19db6e..f483eb6f04d3754d5de4edf03f64d5f927f9f941 100644 (file)
@@ -675,7 +675,7 @@ static void nft_chain_builtin_init(struct nft_handle *h,
        struct nftnl_chain *c;
 
        /* Initialize built-in chains if they don't exist yet */
-       for (i=0; i<NF_IP_NUMHOOKS && table->chains[i].name != NULL; i++) {
+       for (i=0; i < NF_INET_NUMHOOKS && table->chains[i].name != NULL; i++) {
 
                c = nft_chain_list_find(list, table->name,
                                        table->chains[i].name);