From 79aadecc3f56a8052ebedcadacdac8828b29d442 Mon Sep 17 00:00:00 2001 From: Brian Rumple Date: Tue, 29 Nov 2016 17:57:34 -0500 Subject: [PATCH] rulenum is not mutually exclusive of other args --- lib/iptables/insert.js | 9 ++++----- lib/iptables/replace.js | 9 ++++----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/lib/iptables/insert.js b/lib/iptables/insert.js index 4355442..9c1d733 100755 --- a/lib/iptables/insert.js +++ b/lib/iptables/insert.js @@ -42,10 +42,9 @@ module.exports = function (options, cb) { if (typeof options.rulenum != 'undefined') { args = args.concat(options.rulenum); } - else { - var common_rule_specs = processCommonRuleSpecs(options); - args = args.concat(common_rule_specs); - } + + var common_rule_specs = processCommonRuleSpecs(options); + args = args.concat(common_rule_specs); /* * Execute command. @@ -62,4 +61,4 @@ module.exports = function (options, cb) { cb(null); } }); -}; \ No newline at end of file +}; diff --git a/lib/iptables/replace.js b/lib/iptables/replace.js index 048f5eb..cac6ad3 100755 --- a/lib/iptables/replace.js +++ b/lib/iptables/replace.js @@ -42,10 +42,9 @@ module.exports = function (options, cb) { if (typeof options.rulenum != 'undefined') { args = args.concat(options.rulenum); } - else { - var common_rule_specs = processCommonRuleSpecs(options); - args = args.concat(common_rule_specs); - } + + var common_rule_specs = processCommonRuleSpecs(options); + args = args.concat(common_rule_specs); /* * Execute command. @@ -62,4 +61,4 @@ module.exports = function (options, cb) { cb(null); } }); -}; \ No newline at end of file +};