From 1189d830ea4fd269da87761d400ebabca02e1ef3 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Fri, 5 Apr 2019 13:21:19 +0200 Subject: xshared: Merge and share parse_chain() Have a common routine to perform chain name checks, combining all variants' requirements. Signed-off-by: Phil Sutter --- iptables/iptables.c | 25 ------------------------- 1 file changed, 25 deletions(-) (limited to 'iptables/iptables.c') diff --git a/iptables/iptables.c b/iptables/iptables.c index b925f089..246526a5 100644 --- a/iptables/iptables.c +++ b/iptables/iptables.c @@ -223,31 +223,6 @@ iptables_exit_error(enum xtables_exittype status, const char *msg, ...) /* Christophe Burki wants `-p 6' to imply `-m tcp'. */ -static void -parse_chain(const char *chainname) -{ - const char *ptr; - - if (strlen(chainname) >= XT_EXTENSION_MAXNAMELEN) - xtables_error(PARAMETER_PROBLEM, - "chain name `%s' too long (must be under %u chars)", - chainname, XT_EXTENSION_MAXNAMELEN); - - if (*chainname == '-' || *chainname == '!') - xtables_error(PARAMETER_PROBLEM, - "chain name not allowed to start " - "with `%c'\n", *chainname); - - if (xtables_find_target(chainname, XTF_TRY_LOAD)) - xtables_error(PARAMETER_PROBLEM, - "chain name may not clash " - "with target name\n"); - - for (ptr = chainname; *ptr; ptr++) - if (isspace(*ptr)) - xtables_error(PARAMETER_PROBLEM, - "Invalid chain name `%s'", chainname); -} static void print_header(unsigned int format, const char *chain, struct xtc_handle *handle) -- cgit v1.2.3