]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
ebtables: Print non-standard target parameters
authorPhil Sutter <phil@nwl.cc>
Thu, 2 Aug 2018 15:05:21 +0000 (17:05 +0200)
committerFlorian Westphal <fw@strlen.de>
Sat, 4 Aug 2018 12:53:51 +0000 (14:53 +0200)
If a rule has a non-standard target (i.e., cs->target != NULL), it may
contain parameters. This patch enables printing them.

The code assumed that a non-standard target is only present if
cs->jumpto is not set, but that is wrong: If
nft_rule_to_iptables_command_state() encounters a target expression, it
calls nft_parse_target() which in turn calls the family-specific
parse_target callback. All of them assign cs->target, whose name is
later assigned to cs->jumpto by the first function.

Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Florian Westphal <fw@strlen.de>
iptables/nft-bridge.c

index bbcecd825f8ceed144af409a864550a387d90f24..c8605dc97ca27d9fa2d8312255912a3c3125498b 100644 (file)
@@ -466,8 +466,10 @@ static void nft_bridge_save_rule(const void *data, unsigned int format)
                else
                        printf("CONTINUE");
        }
-       else if (cs->target != NULL && cs->target->print != NULL)
+       if (cs->target != NULL && cs->target->print != NULL) {
+               printf(" ");
                cs->target->print(&cs->fw, cs->target->t, format & FMT_NUMERIC);
+       }
 
        if (!(format & FMT_NOCOUNTS)) {
                const char *counter_fmt;