]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
nft: don't call nft_init in nft_xtables_config_load
authorPablo Neira Ayuso <pablo@netfilter.org>
Fri, 31 May 2013 12:54:33 +0000 (14:54 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 30 Dec 2013 22:50:31 +0000 (23:50 +0100)
Otherwise we keep initializing the handle over and over again.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
iptables/nft.c
iptables/xtables-config.c

index 54951154f6880ec631ec0952301663df22bd3b33..ca56d0edebea2d9907c4ad39a11ebd16b11242bd 100644 (file)
@@ -2798,8 +2798,6 @@ int nft_xtables_config_load(struct nft_handle *h, const char *filename,
                return -1;
        }
 
-       nft_init(h);
-
        /* Stage 1) create tables */
        titer = nft_table_list_iter_create(table_list);
        while ((table = nft_table_list_iter_next(titer)) != NULL) {
index 3ad46e852000be1c5d5eb8dab1eac39944156598..12165627ce553c9053c31a64e1faea1779744095 100644 (file)
@@ -35,6 +35,8 @@ int xtables_config_main(int argc, char *argv[])
        else
                filename = argv[1];
 
+       nft_init(&h);
+
        return nft_xtables_config_load(&h, filename, NFT_LOAD_VERBOSE) == 0 ?
                                                    EXIT_SUCCESS : EXIT_FAILURE;
 }