From 284a3e67563a8984fb0f513e1dc27a2364a12ce2 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Tue, 22 Oct 2019 22:55:08 +0200 Subject: xshared: Share a common implementation of parse_rulenumber() The function is really small, but still copied four times. Signed-off-by: Phil Sutter Acked-by: Pablo Neira Ayuso --- iptables/ip6tables.c | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'iptables/ip6tables.c') diff --git a/iptables/ip6tables.c b/iptables/ip6tables.c index 9a9d71f1..f4ccfc60 100644 --- a/iptables/ip6tables.c +++ b/iptables/ip6tables.c @@ -352,19 +352,6 @@ static int is_exthdr(uint16_t proto) proto == IPPROTO_DSTOPTS); } -/* 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) { -- cgit v1.2.3