{"id":816386,"url":"http://patchwork.ozlabs.org/api/patches/816386/?format=json","web_url":"http://patchwork.ozlabs.org/project/netfilter-devel/patch/20170920173436.20221-3-phil@nwl.cc/","project":{"id":26,"url":"http://patchwork.ozlabs.org/api/projects/26/?format=json","name":"Netfilter Development","link_name":"netfilter-devel","list_id":"netfilter-devel.vger.kernel.org","list_email":"netfilter-devel@vger.kernel.org","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20170920173436.20221-3-phil@nwl.cc>","list_archive_url":null,"date":"2017-09-20T17:34:36","name":"[iptables,2/2] ip{,6}tables-restore: Don't accept wait-interval without wait","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"69caa63ae416f9168a477644389a3a7f6eaa0698","submitter":{"id":4285,"url":"http://patchwork.ozlabs.org/api/people/4285/?format=json","name":"Phil Sutter","email":"phil@nwl.cc"},"delegate":{"id":6139,"url":"http://patchwork.ozlabs.org/api/users/6139/?format=json","username":"pablo","first_name":"Pablo","last_name":"Neira","email":"pablo@netfilter.org"},"mbox":"http://patchwork.ozlabs.org/project/netfilter-devel/patch/20170920173436.20221-3-phil@nwl.cc/mbox/","series":[{"id":4186,"url":"http://patchwork.ozlabs.org/api/series/4186/?format=json","web_url":"http://patchwork.ozlabs.org/project/netfilter-devel/list/?series=4186","date":"2017-09-20T17:34:34","name":"ip{,6}tables-restore: Fix wait-interval parsing","version":1,"mbox":"http://patchwork.ozlabs.org/series/4186/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/816386/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/816386/checks/","tags":{},"related":[],"headers":{"Return-Path":"<netfilter-devel-owner@vger.kernel.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netfilter-devel-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xy6M147blz9s0g\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 21 Sep 2017 03:34:53 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751732AbdITRex (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tWed, 20 Sep 2017 13:34:53 -0400","from orbyte.nwl.cc ([151.80.46.58]:41528 \"EHLO orbyte.nwl.cc\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1751718AbdITRew (ORCPT <rfc822; netfilter-devel@vger.kernel.org>);\n\tWed, 20 Sep 2017 13:34:52 -0400","from localhost ([::1]:36070 helo=xsao)\n\tby orbyte.nwl.cc with esmtp (Exim 4.89)\n\t(envelope-from <phil@nwl.cc>)\n\tid 1duitf-00069C-UF; Wed, 20 Sep 2017 19:34:51 +0200"],"From":"Phil Sutter <phil@nwl.cc>","To":"Pablo Neira Ayuso <pablo@netfilter.org>","Cc":"netfilter-devel@vger.kernel.org","Subject":"[iptables PATCH 2/2] ip{,\n\t6}tables-restore: Don't accept wait-interval without wait","Date":"Wed, 20 Sep 2017 19:34:36 +0200","Message-Id":"<20170920173436.20221-3-phil@nwl.cc>","X-Mailer":"git-send-email 2.13.1","In-Reply-To":"<20170920173436.20221-1-phil@nwl.cc>","References":"<20170920173436.20221-1-phil@nwl.cc>","Sender":"netfilter-devel-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netfilter-devel.vger.kernel.org>","X-Mailing-List":"netfilter-devel@vger.kernel.org"},"content":"If -W <val> was given, error out if -w wasn't since that doesn't make\nsense.\n\nSigned-off-by: Phil Sutter <phil@nwl.cc>\n---\n iptables/ip6tables-restore.c | 5 +++++\n iptables/iptables-restore.c  | 5 +++++\n 2 files changed, 10 insertions(+)","diff":"diff --git a/iptables/ip6tables-restore.c b/iptables/ip6tables-restore.c\nindex eaa2bcbc3856e..47310f20b9363 100644\n--- a/iptables/ip6tables-restore.c\n+++ b/iptables/ip6tables-restore.c\n@@ -273,6 +273,11 @@ int ip6tables_restore_main(int argc, char *argv[])\n \t}\n \telse in = stdin;\n \n+\tif (!wait_interval.tv_sec && !wait) {\n+\t\tfprintf(stderr, \"Option --wait-interval requires option --wait\\n\");\n+\t\texit(1);\n+\t}\n+\n \t/* Grab standard input. */\n \twhile (fgets(buffer, sizeof(buffer), in)) {\n \t\tint ret = 0;\ndiff --git a/iptables/iptables-restore.c b/iptables/iptables-restore.c\nindex 9dbfc572a7cec..074552af5dc74 100644\n--- a/iptables/iptables-restore.c\n+++ b/iptables/iptables-restore.c\n@@ -271,6 +271,11 @@ iptables_restore_main(int argc, char *argv[])\n \t}\n \telse in = stdin;\n \n+\tif (!wait_interval.tv_sec && !wait) {\n+\t\tfprintf(stderr, \"Option --wait-interval requires option --wait\\n\");\n+\t\texit(1);\n+\t}\n+\n \t/* Grab standard input. */\n \twhile (fgets(buffer, sizeof(buffer), in)) {\n \t\tint ret = 0;\n","prefixes":["iptables","2/2"]}