From 5705ea1f4e3c9cd3d5d9cbcf84b9733ce1f07e57 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Mon, 19 Nov 2012 15:32:18 +0100 Subject: xtables-restore: add support for dormant tables This patch adds support for dormant tables for xtables-restore. Signed-off-by: Pablo Neira Ayuso --- iptables/xtables-restore.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'iptables/xtables-restore.c') 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); -- cgit v1.2.3