summaryrefslogtreecommitdiffstats
path: root/iptables/iptables.c
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2019-10-22 22:55:08 +0200
committerPhil Sutter <phil@nwl.cc>2019-10-30 10:00:59 +0100
commit284a3e67563a8984fb0f513e1dc27a2364a12ce2 (patch)
tree41a66f581b4e05fc28e329f2e9a8996d76ebc843 /iptables/iptables.c
parent45989e8fbec52fcbafa5ae9917fc2a0d62e3640d (diff)
xshared: Share a common implementation of parse_rulenumber()
The function is really small, but still copied four times. Signed-off-by: Phil Sutter <phil@nwl.cc> Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'iptables/iptables.c')
-rw-r--r--iptables/iptables.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/iptables/iptables.c b/iptables/iptables.c
index 5fec2537..df371f41 100644
--- a/iptables/iptables.c
+++ b/iptables/iptables.c
@@ -343,18 +343,6 @@ opt2char(int option)
*/
/* Christophe Burki wants `-p 6' to imply `-m tcp'. */
-/* Can't be zero. */
-static int
-parse_rulenumber(const char *rule)
-{
- unsigned int rulenum;
-
- if (!xtables_strtoui(rule, NULL, &rulenum, 1, INT_MAX))
- xtables_error(PARAMETER_PROBLEM,
- "Invalid rule number `%s'", rule);
-
- return rulenum;
-}
static void
parse_chain(const char *chainname)