From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Greear Subject: Re: [RFC] Fix ip routing rules (partially revert b6c69d4b) Date: Tue, 14 Dec 2010 13:28:47 -0800 Message-ID: <4D07E18F.30703@candelatech.com> References: <1292025842-14959-1-git-send-email-greearb@candelatech.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit To: netdev@vger.kernel.org Return-path: Received: from mail.candelatech.com ([208.74.158.172]:54760 "EHLO ns3.lanforge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760160Ab0LNV2s (ORCPT ); Tue, 14 Dec 2010 16:28:48 -0500 Received: from [192.168.100.195] (firewall.candelatech.com [70.89.124.249]) (authenticated bits=0) by ns3.lanforge.com (8.14.2/8.14.2) with ESMTP id oBELSlrv020712 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 14 Dec 2010 13:28:47 -0800 In-Reply-To: <1292025842-14959-1-git-send-email-greearb@candelatech.com> Sender: netdev-owner@vger.kernel.org List-ID: On 12/10/2010 04:04 PM, greearb@candelatech.com wrote: > From: Ben Greear > > Change 4465b469008bc03b98a1b8df4e9ae501b6c69d4b caused rules > to stop matching the input device properly because the > FLOWI_FLAG_MATCH_ANY_IIF is always defined in ip_dev_find(). Any comments on this? I think we should resolve this before .37, since it appears to be a regression bug... > > This breaks rules such as: > > ip rule add pref 512 lookup local > ip rule del pref 0 lookup local > ip link set eth2 up > ip -4 addr add 172.16.0.102/24 broadcast 172.16.0.255 dev eth2 > ip rule add to 172.16.0.102 iif eth2 lookup local pref 10 > ip rule add iif eth2 lookup 10001 pref 20 > ip route add 172.16.0.0/24 dev eth2 table 10001 > ip route add unreachable 0/0 table 10001 > > If you had a second interface 'eth0' that was on a different > subnet, pinging a system on that interface would fail: > > [root@ct503-60 ~]# ping 192.168.100.1 > connect: Invalid argument > > This patch partially reverts the problematic patch by > NOT defining FLOWI_FLAG_MATCH_ANY_IIF. This probably breaks > the feature that the original author intended to add, and > it could easily be that the entire patch should be reverted, > so this needs review before applying. > > Signed-off-by: Ben Greear > --- > :100644 100644 eb6f69a... 5f73819... M net/ipv4/fib_frontend.c > net/ipv4/fib_frontend.c | 1 - > 1 files changed, 0 insertions(+), 1 deletions(-) > > diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c > index eb6f69a..5f73819 100644 > --- a/net/ipv4/fib_frontend.c > +++ b/net/ipv4/fib_frontend.c > @@ -163,7 +163,6 @@ struct net_device *__ip_dev_find(struct net *net, __be32 addr, bool devref) > .daddr = addr > } > }, > - .flags = FLOWI_FLAG_MATCH_ANY_IIF > }; > struct fib_result res = { 0 }; > struct net_device *dev = NULL; -- Ben Greear Candela Technologies Inc http://www.candelatech.com