diff options
author | Phil Sutter <phil@nwl.cc> | 2019-04-05 13:21:19 +0200 |
---|---|---|
committer | Phil Sutter <phil@nwl.cc> | 2021-11-23 15:01:23 +0100 |
commit | 1189d830ea4fd269da87761d400ebabca02e1ef3 (patch) | |
tree | b7c6e734d3dfc43727b3ce589633d80c264e01b1 /iptables/xtables.c | |
parent | 1eab8e83aec0e6965f11f8cad460add1caeae629 (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.c | 9 |
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; |