summaryrefslogtreecommitdiffstats
path: root/iptables/xtables-restore.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2012-11-19 15:32:18 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2013-12-30 23:50:21 +0100
commit5705ea1f4e3c9cd3d5d9cbcf84b9733ce1f07e57 (patch)
tree8bf9943f0eee5b64acbc1e49ee5ce5c59f56d87b /iptables/xtables-restore.c
parent890fd9ef76ad0c11695fb0d09a88169e6e46584f (diff)
xtables-restore: add support for dormant tables
This patch adds support for dormant tables for xtables-restore. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'iptables/xtables-restore.c')
-rw-r--r--iptables/xtables-restore.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/iptables/xtables-restore.c b/iptables/xtables-restore.c
index 09922a0c..30ea813c 100644
--- a/iptables/xtables-restore.c
+++ b/iptables/xtables-restore.c
@@ -243,11 +243,16 @@ xtables_restore_main(int argc, char *argv[])
fputs(buffer, stdout);
continue;
} else if ((strcmp(buffer, "COMMIT\n") == 0) && (in_table)) {
- /* FIXME commit/testing operation not supported */
if (!testing) {
+ if (nft_table_wake_dormant(&h, curtable) < 0) {
+ fprintf(stderr, "Failed to wake up "
+ "dormant table `%s'\n",
+ curtable);
+ }
DEBUGP("Calling commit\n");
ret = 1;
} else {
+ /* FIXME -t needs to be fixed */
DEBUGP("Not calling commit, testing\n");
ret = 1;
}
@@ -270,6 +275,7 @@ xtables_restore_main(int argc, char *argv[])
if (tablename && (strcmp(tablename, table) != 0))
continue;
+ nft_table_set_dormant(&h, table);
if (noflush == 0) {
DEBUGP("Cleaning all chains of table '%s'\n",
table);