Skip to content

Commit 5f0623a

Browse files
committed
...
1 parent dd52a04 commit 5f0623a

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

ipthelper/ip6tables.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1442,7 +1442,7 @@ int do_command6(int argc, char *argv[], char **table, void **handle)
14421442
opts = xt_params->orig_opts;
14431443
while ((cs.c = getopt_long(argc, argv,
14441444
"-:A:C:D:R:I:L::S::M:F::Z::N:X::E:P:Vh::o:p:s:d:j:i:bvnt:m:xc:g:46",
1445-
opts, NULL)) != -1) {
1445+
xt_params->opts ?: opts, NULL)) != -1) {
14461446
switch (cs.c) {
14471447
/*
14481448
* Command selection

ipthelper/iptables.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1020,7 +1020,8 @@ int do_command4(int argc, char *argv[], char **table, void **handle)
10201020
iptables_globals.opts = iptables_globals.orig_opts;
10211021
while ((cs.c = getopt_long(argc, argv,
10221022
"-:A:C:D:R:I:L::S::M:F::Z::N:X::E:P:Vh::o:p:s:d:j:i:fbvnt:m:xc:g:46",
1023-
iptables_globals.opts, NULL)) != -1) {
1023+
iptables_globals.opts?: iptables_globals.orig_opts,
1024+
NULL)) != -1) {
10241025
switch (cs.c) {
10251026
/*
10261027
* Command selection

ipthelper/xshared.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,8 @@ void command_match(struct iptables_command_state *cs)
571571
else if (m->extra_opts != NULL)
572572
opts = xtables_merge_options(xt_params->orig_opts, opts,
573573
m->extra_opts, &m->option_offset);
574+
else
575+
return;
574576
if (opts == NULL)
575577
xtables_error(OTHER_PROBLEM, "can't alloc memory!");
576578
}
@@ -628,10 +630,12 @@ void command_jump(struct iptables_command_state *cs)
628630
opts = xtables_options_xfrm(xt_params->orig_opts, opts,
629631
cs->target->x6_options,
630632
&cs->target->option_offset);
631-
else
633+
else if (cs->target->extra_opts != NULL)
632634
opts = xtables_merge_options(xt_params->orig_opts, opts,
633635
cs->target->extra_opts,
634636
&cs->target->option_offset);
637+
else
638+
return;
635639
if (opts == NULL)
636640
xtables_error(OTHER_PROBLEM, "can't alloc memory!");
637641
xt_params->opts = opts;

0 commit comments

Comments
 (0)