]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
xtables: initialize xtables defaults even on listing rules
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Tue, 14 May 2013 00:52:02 +0000 (00:52 +0000)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 30 Dec 2013 22:50:30 +0000 (23:50 +0100)
Output of the tool should be the same as for iptables.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
iptables/nft.c

index e55c18c10a512c593ee46430310976e163d29c94..7e1b47bc1efaa0085e8805d0240650d4f285ead4 100644 (file)
@@ -2483,6 +2483,10 @@ int nft_rule_list(struct nft_handle *h, const char *chain, const char *table,
        struct nft_chain_list_iter *iter;
        struct nft_chain *c;
 
+       /* If built-in chains don't exist for this table, create them */
+       if (nft_xtables_config_load(h, XTABLES_CONFIG_DEFAULT, 0) < 0)
+               nft_chain_builtin_init(h, table, NULL, NF_ACCEPT);
+
        list = nft_chain_dump(h);
 
        iter = nft_chain_list_iter_create(list);