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/xtables.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'iptables/xtables.c') diff --git a/iptables/xtables.c b/iptables/xtables.c index 5c69af7e..32b93d2b 100644 --- a/iptables/xtables.c +++ b/iptables/xtables.c @@ -424,14 +424,7 @@ void do_parse(struct nft_handle *h, int argc, char *argv[], break; case 'N': - if (optarg && (*optarg == '-' || *optarg == '!')) - xtables_error(PARAMETER_PROBLEM, - "chain name not allowed to start " - "with `%c'\n", *optarg); - if (xtables_find_target(optarg, XTF_TRY_LOAD)) - xtables_error(PARAMETER_PROBLEM, - "chain name may not clash " - "with target name\n"); + parse_chain(optarg); add_command(&p->command, CMD_NEW_CHAIN, CMD_NONE, invert); p->chain = optarg; -- cgit v1.2.3