path: root/iptables/xtables-translate.c
diff options
authorPhil Sutter <>2018-10-23 16:59:14 +0200
committerPablo Neira Ayuso <>2018-10-23 17:24:05 +0200
commit682f39afe64305a820d3d8e186d0a6da893f0f35 (patch)
tree6e95b84f194dcb315466770d293008df40d05c43 /iptables/xtables-translate.c
parent90f7dc3c28a7381ea80aef0b1376d3dd5f1fbf4e (diff)
xtables: Fix for spurious errors from iptables-translate
When aligning iptables-nft error messages with legacy ones, I missed that translate tools shouldn't check for missing or duplicated chains. Introduce a boolean in struct nft_xt_cmd_parse indicating we're "just" translating and do_parse() should skip the checks. Fixes: b6a06c1a215f8 ("xtables: Align return codes with legacy iptables") Signed-off-by: Phil Sutter <> Signed-off-by: Pablo Neira Ayuso <>
Diffstat (limited to 'iptables/xtables-translate.c')
1 files changed, 1 insertions, 0 deletions
diff --git a/iptables/xtables-translate.c b/iptables/xtables-translate.c
index f4c0f9cf..849c53f3 100644
--- a/iptables/xtables-translate.c
+++ b/iptables/xtables-translate.c
@@ -216,6 +216,7 @@ static int do_command_xlate(struct nft_handle *h, int argc, char *argv[],
struct nft_xt_cmd_parse p = {
.table = *table,
.restore = restore,
+ .xlate = true,
struct iptables_command_state cs;
struct xtables_args args = {