All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Torsten Luettgert <ml-netfilter@enda.eu>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: TEE broken in 3.6
Date: Tue, 16 Oct 2012 22:00:18 +0200	[thread overview]
Message-ID: <1350417618.3954.1494.camel@edumazet-glaptop> (raw)
In-Reply-To: <20121016211319.3f07a7e3@goldlack.enda.eu>

On Tue, 2012-10-16 at 21:13 +0200, Torsten Luettgert wrote:
> Hi,
> 
> today, I found that the TEE target doesn't work any longer in 3.6 and
> following kernels. The problem is that it tries to ARP-lookup the
> original destination address of the forwarded packet, not the address
> of the gateway.
> 
> I git bisected and found that this commit broke it:
> 
> commit f8126f1d5136be1ca1a3536d43ad7a710b5620f8
> Author: David S. Miller <davem@davemloft.net>
> Date:   Fri Jul 13 05:03:45 2012 -0700
> 
>     ipv4: Adjust semantics of rt->rt_gateway.
>     
>     In order to allow prefixed routes, we have to adjust how rt_gateway
>     is set and interpreted.
>     
>     The new interpretation is:
>     
>     1) rt_gateway == 0, destination is on-link, nexthop is iph->daddr
>     
>     2) rt_gateway != 0, destination requires a nexthop gateway
>     
>     Abstract the fetching of the proper nexthop value using a new
>     inline helper, rt_nexthop(), as suggested by Joe Perches.
>     
>     Signed-off-by: David S. Miller <davem@davemloft.net>
>     Tested-by: Vijay Subramanian <subramanian.vijay@gmail.com>
> 
> which seems plausible. I'm not versed enough in netfilter/routing code
> to fix it myself. Could any of you wizards help?

Hmm...

Could you try latest tree, with the following patch ?

diff --git a/net/netfilter/xt_TEE.c b/net/netfilter/xt_TEE.c
index ee2e5bc..bd93e51 100644
--- a/net/netfilter/xt_TEE.c
+++ b/net/netfilter/xt_TEE.c
@@ -70,6 +70,7 @@ tee_tg_route4(struct sk_buff *skb, const struct xt_tee_tginfo *info)
 	fl4.daddr = info->gw.ip;
 	fl4.flowi4_tos = RT_TOS(iph->tos);
 	fl4.flowi4_scope = RT_SCOPE_UNIVERSE;
+	fl4.flowi4_flags = FLOWI_FLAG_KNOWN_NH;
 	rt = ip_route_output_key(net, &fl4);
 	if (IS_ERR(rt))
 		return false;





  reply	other threads:[~2012-10-16 20:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-16 19:13 TEE broken in 3.6 Torsten Luettgert
2012-10-16 20:00 ` Eric Dumazet [this message]
2012-10-17  7:45   ` Torsten Luettgert
2012-10-17  7:48     ` Eric Dumazet
2012-10-17  8:15       ` Pablo Neira Ayuso
2012-10-17  8:33         ` [PATCH] netfilter: xt_TEE: dont use destination address found in header Eric Dumazet
2012-10-17  8:23       ` TEE broken in 3.6 Pablo Neira Ayuso
2012-10-17  8:34         ` Eric Dumazet

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=1350417618.3954.1494.camel@edumazet-glaptop \
    --to=eric.dumazet@gmail.com \
    --cc=ml-netfilter@enda.eu \
    --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.