All of lore.kernel.org
 help / color / mirror / Atom feed
From: Louis Sautier <sautier.louis@gmail.com>
To: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH] xtables-compat-restore: fix translation of mangle's OUTPUT
Date: Sun, 10 Sep 2017 20:35:23 +0200	[thread overview]
Message-ID: <603ee036-ea61-e797-7828-a7b0bd3a9bd9@gmail.com> (raw)
In-Reply-To: <90185d38-8713-2a2a-6d47-c3db17f83dcb@gmail.com>


[-- Attachment #1.1.1: Type: text/plain, Size: 511 bytes --]

On 10/09/17 02:39, Louis Sautier wrote:
> Hello,
> I noticed that the iptables-restore-translate tool does not properly
> translate the OUTPUT chain from the mangle table. It creates a filter
> chain when it should be creating a route chain.
> Here is a rather simple patch that should fix the issue.
>
> Please CC me, I'm not subscribed.
>
> Kind regards,
>
> Louis

I made a typo in the commit message, it is related to xtables-translate,
not xtables-compat-restore. Here is the fixed patch.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.1.2: 0001-xtables-translate-fix-translation-of-mangle-s-OUTPUT.patch --]
[-- Type: text/x-patch; name="0001-xtables-translate-fix-translation-of-mangle-s-OUTPUT.patch", Size: 923 bytes --]

From d9f0f601e0a8be841650541382787cf80bd28e5f Mon Sep 17 00:00:00 2001
From: Louis Sautier <sautier.louis@gmail.com>
Date: Sun, 10 Sep 2017 02:13:18 +0200
Subject: [PATCH] xtables-translate: fix translation of mangle's OUTPUT chain

This chain should be translated as a route chain, not as a filter chain.
---
 iptables/xtables-translate.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/iptables/xtables-translate.c b/iptables/xtables-translate.c
index 3e6c7051..4f6a9caf 100644
--- a/iptables/xtables-translate.c
+++ b/iptables/xtables-translate.c
@@ -357,6 +357,8 @@ static int xlate_chain_set(struct nft_handle *h, const char *table,
 
 	if (strcmp(table, "nat") == 0)
 		type = "nat";
+	else if (strcmp(table, "mangle") == 0 && strcmp(chain, "OUTPUT") == 0)
+		type = "route";
 
 	printf("add chain %s %s %s { type %s ",
 	       family2str[h->family], table, chain, type);
-- 
2.14.1


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2017-09-10 18:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-10  0:39 [PATCH] xtables-compat-restore: fix translation of mangle's OUTPUT Louis Sautier
2017-09-10 18:35 ` Louis Sautier [this message]
2017-09-10 20:05   ` Pablo Neira Ayuso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=603ee036-ea61-e797-7828-a7b0bd3a9bd9@gmail.com \
    --to=sautier.louis@gmail.com \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.