diff options
author | Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com> | 2013-05-14 00:52:02 +0000 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2013-12-30 23:50:30 +0100 |
commit | aa1601423175c90c37c3e6a3d6975d3e2eb74d1e (patch) | |
tree | 666e6bb215645bfee1f74bd7343fdb00fd1050be /iptables | |
parent | 93373d52cb2d2963a2f3cbcec2092dcf6bddd0cf (diff) |
xtables: initialize xtables defaults even on listing rules
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>
Diffstat (limited to 'iptables')
-rw-r--r-- | iptables/nft.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/iptables/nft.c b/iptables/nft.c index e55c18c1..7e1b47bc 100644 --- a/iptables/nft.c +++ b/iptables/nft.c @@ -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); |