path: root/iptables/xshared.c
diff options
authorPhil Sutter <>2019-02-05 17:01:42 +0100
committerFlorian Westphal <>2019-02-07 15:51:58 +0100
commit932d5c3fb94acc499c8a6264e354ab1e33316b72 (patch)
tree2ac6641f91cc52ceb4b176055bfc205a6c2e3e21 /iptables/xshared.c
parent35b22e82fa62e10950d8e0fa53a755d4abadf346 (diff)
xshared: Explicitly pass target to command_jump()
The use of global 'optarg' variable inside that function is a mess, but most importantly it limits its applicability to input parsers. Fix this by having it take the option argument as a parameter. Signed-off-by: Phil Sutter <> Signed-off-by: Florian Westphal <>
Diffstat (limited to 'iptables/xshared.c')
1 files changed, 2 insertions, 2 deletions
diff --git a/iptables/xshared.c b/iptables/xshared.c
index b16f5fa6..fb186fb1 100644
--- a/iptables/xshared.c
+++ b/iptables/xshared.c
@@ -653,12 +653,12 @@ const char *xt_parse_target(const char *targetname)
return targetname;
-void command_jump(struct iptables_command_state *cs)
+void command_jump(struct iptables_command_state *cs, const char *jumpto)
struct option *opts = xt_params->opts;
size_t size;
- cs->jumpto = xt_parse_target(optarg);
+ cs->jumpto = xt_parse_target(jumpto);
/* TRY_LOAD (may be chain name) */
cs->target = xtables_find_target(cs->jumpto, XTF_TRY_LOAD);