From b1aee6b2238794446feba41778f88703784560f7 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Wed, 16 Mar 2022 17:14:07 +0100 Subject: nft: Reject standard targets as chain names when restoring Reuse parse_chain() called from do_parse() for '-N' and rename it for a better description of what it does. Note that by itself, this patch will likely kill iptables-restore performance for big rulesets due to the extra extension lookup for chain lines. A following patch announcing those chains to libxtables will alleviate that. Signed-off-by: Phil Sutter Reviewed-by: Florian Westphal --- iptables/xshared.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'iptables/xshared.h') diff --git a/iptables/xshared.h b/iptables/xshared.h index 0de0e12e..ca761ee7 100644 --- a/iptables/xshared.h +++ b/iptables/xshared.h @@ -244,7 +244,7 @@ char cmd2char(int option); void add_command(unsigned int *cmd, const int newcmd, const int othercmds, int invert); int parse_rulenumber(const char *rule); -void parse_chain(const char *chainname); +void assert_valid_chain_name(const char *chainname); void generic_opt_check(int command, int options); char opt2char(int option); -- cgit v1.2.3