summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2017-09-20 19:34:36 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2017-10-04 15:54:00 +0200
commit21ba5b3874fb3d0c4cccc9b59f65c8df575211e2 (patch)
tree3b85517709f934549554c24a70929c089bce3bfa
parent60e0ffd365a2d936b3df13c1289b2ef57b756d92 (diff)
ip{,6}tables-restore: Don't accept wait-interval without wait
If -W <val> was given, error out if -w wasn't since that doesn't make sense. Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r--iptables/ip6tables-restore.c5
-rw-r--r--iptables/iptables-restore.c5
2 files changed, 10 insertions, 0 deletions
diff --git a/iptables/ip6tables-restore.c b/iptables/ip6tables-restore.c
index eaa2bcbc..47310f20 100644
--- a/iptables/ip6tables-restore.c
+++ b/iptables/ip6tables-restore.c
@@ -273,6 +273,11 @@ int ip6tables_restore_main(int argc, char *argv[])
}
else in = stdin;
+ if (!wait_interval.tv_sec && !wait) {
+ fprintf(stderr, "Option --wait-interval requires option --wait\n");
+ exit(1);
+ }
+
/* Grab standard input. */
while (fgets(buffer, sizeof(buffer), in)) {
int ret = 0;
diff --git a/iptables/iptables-restore.c b/iptables/iptables-restore.c
index 9dbfc572..074552af 100644
--- a/iptables/iptables-restore.c
+++ b/iptables/iptables-restore.c
@@ -271,6 +271,11 @@ iptables_restore_main(int argc, char *argv[])
}
else in = stdin;
+ if (!wait_interval.tv_sec && !wait) {
+ fprintf(stderr, "Option --wait-interval requires option --wait\n");
+ exit(1);
+ }
+
/* Grab standard input. */
while (fgets(buffer, sizeof(buffer), in)) {
int ret = 0;