summaryrefslogtreecommitdiffstats
path: root/iptables/xtables.c
diff options
context:
space:
mode:
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>2014-02-11 12:46:44 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2014-02-11 12:09:08 +0100
commit7851975e5055381d30f0788d90671485695928e1 (patch)
treee71790623ca459b44b9c44e1c01eb1b5e99c5999 /iptables/xtables.c
parent4cffe00557b40dfe8c3236746797b24c4074c95e (diff)
xtables: Add backward compatibility with -w option
Just to keep aligned with iptables legacy tool. Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'iptables/xtables.c')
-rw-r--r--iptables/xtables.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/iptables/xtables.c b/iptables/xtables.c
index c49b4a2f..7a8ace3d 100644
--- a/iptables/xtables.c
+++ b/iptables/xtables.c
@@ -678,7 +678,8 @@ static void command_match(struct iptables_command_state *cs)
xtables_error(OTHER_PROBLEM, "can't alloc memory!");
}
-int do_commandx(struct nft_handle *h, int argc, char *argv[], char **table)
+int do_commandx(struct nft_handle *h, int argc, char *argv[], char **table,
+ bool restore)
{
struct iptables_command_state cs;
int verbose = 0;
@@ -1001,6 +1002,14 @@ int do_commandx(struct nft_handle *h, int argc, char *argv[], char **table)
prog_name, prog_vers);
exit(0);
+ case 'w':
+ if (restore) {
+ xtables_error(PARAMETER_PROBLEM,
+ "You cannot use `-w' from "
+ "iptables-restore");
+ }
+ break;
+
case '0':
set_option(&cs.options, OPT_LINENUMBERS,
&args.invflags, cs.invert);