From 21ba5b3874fb3d0c4cccc9b59f65c8df575211e2 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Wed, 20 Sep 2017 19:34:36 +0200 Subject: ip{,6}tables-restore: Don't accept wait-interval without wait If -W was given, error out if -w wasn't since that doesn't make sense. Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso --- iptables/iptables-restore.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'iptables/iptables-restore.c') 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; -- cgit v1.2.3