diff mbox series

[iptables,1/3] xtables: Fix typo in do_command() error message

Message ID 20181112132947.9501-2-phil@nwl.cc
State Accepted
Headers show
Series A few minor fixes | expand

Commit Message

Phil Sutter Nov. 12, 2018, 1:29 p.m. UTC
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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/iptables/xtables.c b/iptables/xtables.c
index 0038804e288c6..429bd652cc439 100644
--- a/iptables/xtables.c
+++ b/iptables/xtables.c
@@ -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))