From 20e95a4ec5cec14d9e03ba562fa65f015d49dc14 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Tue, 14 Nov 2023 18:51:59 +0100 Subject: xshared: Introduce xt_cmd_parse_ops::option_name The old opt2char() function was flawed: Since not every field in optflags contains a printable character, typical use of its return value in print statements could lead to garbage on screen. Replace this by a mechanism to retrieve an option's long name which supports family-specific overrides. and get rid of optflags field altogether and define NUMBER_OF_OPT similar to NUMBER_OF_CMD. Signed-off-by: Phil Sutter --- iptables/iptables.c | 1 + 1 file changed, 1 insertion(+) (limited to 'iptables/iptables.c') diff --git a/iptables/iptables.c b/iptables/iptables.c index 6f7b3476..4bfce62d 100644 --- a/iptables/iptables.c +++ b/iptables/iptables.c @@ -663,6 +663,7 @@ int do_command4(int argc, char *argv[], char **table, struct xt_cmd_parse_ops cmd_parse_ops = { .proto_parse = ipv4_proto_parse, .post_parse = ipv4_post_parse, + .option_name = ip46t_option_name, }; struct xt_cmd_parse p = { .table = *table, -- cgit v1.2.3