]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
xtables: Fix typo in do_command() error message
authorPhil Sutter <phil@nwl.cc>
Mon, 12 Nov 2018 13:29:45 +0000 (14:29 +0100)
committerFlorian Westphal <fw@strlen.de>
Mon, 12 Nov 2018 13:34:06 +0000 (14:34 +0100)
This checks p->chain for existence, not cs->jumpto. Fixes this bogus
error message:

| # iptables-nft -t nat -A FORWARD -j ACCEPT
| iptables v1.8.1 (nf_tables): Chain 'ACCEPT' does not exist

Fixes: b6a06c1a215f8 ("xtables: Align return codes with legacy iptables")
Signed-off-by: Phil Sutter <phil@nwl.cc>
iptables/xtables.c

index 0038804e288c6389ff390de02fbf011f3dd0d3b2..429bd652cc439f99074c2c49c494a55ce0aa2e01 100644 (file)
@@ -1065,7 +1065,7 @@ void do_parse(struct nft_handle *h, int argc, char *argv[],
 
                if (!p->xlate && !nft_chain_exists(h, p->table, p->chain))
                        xtables_error(OTHER_PROBLEM,
-                                     "Chain '%s' does not exist", cs->jumpto);
+                                     "Chain '%s' does not exist", p->chain);
 
                if (!p->xlate && !cs->target && strlen(cs->jumpto) > 0 &&
                    !nft_chain_exists(h, p->table, cs->jumpto))