diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2018-05-04 11:25:00 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2018-05-05 10:05:44 +0200 |
commit | 09f0d47b213de944303a320a70bf57e143bfed62 (patch) | |
tree | ef510269f7c362031464ca8779f5cd94e0a9a9d0 /iptables/xtables-restore.c | |
parent | 8798eb8f48434b1a764788c8a0c133a983bc39e6 (diff) |
iptables-compat: do not fail on restore if user chain exists
The following snippet fails if user chain FOO exists, but it should not fail:
iptables-compat -F
iptables-compat -N FOO
iptables-compat-save > foo
iptables-compat-restore < foo
Reported-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'iptables/xtables-restore.c')
-rw-r--r-- | iptables/xtables-restore.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/iptables/xtables-restore.c b/iptables/xtables-restore.c index fc39ad9c..3de496f8 100644 --- a/iptables/xtables-restore.c +++ b/iptables/xtables-restore.c @@ -191,7 +191,7 @@ struct nft_xt_restore_cb restore_cb = { .commit = nft_commit, .abort = nft_abort, .chains_purge = nft_table_purge_chains, - .rule_flush = nft_rule_flush, + .table_flush = nft_table_flush, .chain_del = chain_delete, .do_command = do_commandx, .chain_set = nft_chain_set, @@ -270,8 +270,8 @@ void xtables_restore_parse(struct nft_handle *h, if (noflush == 0) { DEBUGP("Cleaning all chains of table '%s'\n", table); - if (cb->rule_flush) - cb->rule_flush(h, NULL, table); + if (cb->table_flush) + cb->table_flush(h, table); } ret = 1; |