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/xtables-arp.c | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'iptables/xtables-arp.c') diff --git a/iptables/xtables-arp.c b/iptables/xtables-arp.c index 584b6f06..79cc83d3 100644 --- a/iptables/xtables-arp.c +++ b/iptables/xtables-arp.c @@ -518,19 +518,6 @@ parse_interface(const char *arg, char *vianame, unsigned char *mask) } } -/* 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 set_option(unsigned int *options, unsigned int option, u_int16_t *invflg, int invert) -- cgit v1.2.3