From patchwork Tue Oct 16 20:00:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 191881 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id CFA442C00A6 for ; Wed, 17 Oct 2012 07:00:24 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755675Ab2JPUAX (ORCPT ); Tue, 16 Oct 2012 16:00:23 -0400 Received: from mail-ee0-f46.google.com ([74.125.83.46]:59204 "EHLO mail-ee0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755308Ab2JPUAW (ORCPT ); Tue, 16 Oct 2012 16:00:22 -0400 Received: by mail-ee0-f46.google.com with SMTP id b15so3712418eek.19 for ; Tue, 16 Oct 2012 13:00:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:from:to:cc:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer:content-transfer-encoding; bh=5EjBleFMAR/JXDCutU61X948b/YY9pAACZDKEaNW1vw=; b=m6wzV1sfQEZ8wwiqe0s10+CN8LwB1FNbW+40vd1jTaqYVI8vzQymPICpE4EFZ50sco U1IakIdeZrLUY6W/Yg1ROhUC+9yqM90eImm49gKioSxCI5U8XE/TomzRDnhrkmTeclP0 2HYjORH5gZVOC11Jukp8TMIwiKBRZ5YKOSg8/qiC7s0aphDzxdSBzrrfMxaN31VMrA+d bb3xjqEiQP0ny69SPiWafw8XvVpc4bTyBGtBMvCCKqKAspYjqOM8zhLnknBSS8uVe0BF rKp5eVZtvss4p5RP/J/fFYZznqaXGvbOwth4K3J546UrN31lPIxl3IMh5DZH4SdP94em xcOQ== Received: by 10.14.203.70 with SMTP id e46mr23406064eeo.2.1350417621430; Tue, 16 Oct 2012 13:00:21 -0700 (PDT) Received: from [172.28.90.64] ([172.28.90.64]) by mx.google.com with ESMTPS id s1sm31644659eem.9.2012.10.16.13.00.19 (version=SSLv3 cipher=OTHER); Tue, 16 Oct 2012 13:00:20 -0700 (PDT) Subject: Re: TEE broken in 3.6 From: Eric Dumazet To: Torsten Luettgert Cc: netfilter-devel@vger.kernel.org In-Reply-To: <20121016211319.3f07a7e3@goldlack.enda.eu> References: <20121016211319.3f07a7e3@goldlack.enda.eu> Date: Tue, 16 Oct 2012 22:00:18 +0200 Message-ID: <1350417618.3954.1494.camel@edumazet-glaptop> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org 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 > 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 > Tested-by: Vijay Subramanian > > 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 ? --- To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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;