summaryrefslogtreecommitdiffstats
path: root/iptables/xtables.c
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2019-04-05 13:21:19 +0200
committerPhil Sutter <phil@nwl.cc>2021-11-23 15:01:23 +0100
commit1189d830ea4fd269da87761d400ebabca02e1ef3 (patch)
treeb7c6e734d3dfc43727b3ce589633d80c264e01b1 /iptables/xtables.c
parent1eab8e83aec0e6965f11f8cad460add1caeae629 (diff)
xshared: Merge and share parse_chain()
Have a common routine to perform chain name checks, combining all variants' requirements. Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'iptables/xtables.c')
-rw-r--r--iptables/xtables.c9
1 files changed, 1 insertions, 8 deletions
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;