Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932178AbbHLPXx (ORCPT ); Wed, 12 Aug 2015 11:23:53 -0400 Received: from mail-pd0-f180.google.com ([209.85.192.180]:35491 "EHLO mail-pd0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753827AbbHLPXt (ORCPT ); Wed, 12 Aug 2015 11:23:49 -0400 Date: Wed, 12 Aug 2015 08:23:52 -0700 From: Stephen Hemminger To: Zang MingJie Cc: Alexander Duyck , Hannes Frederic Sowa , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [BUG] net/ipv4: inconsistent routing table Message-ID: <20150812082352.56075327@urahara> In-Reply-To: References: <55C1D207.3040905@iogearbox.net> <55C24BAE.7090702@gmail.com> <55C3B8C8.9030507@redhat.com> <55C4D803.3090108@redhat.com> <878u9njaon.fsf@stressinduktion.org> <878u9jijuc.fsf@stressinduktion.org> <87y4hjgy6p.fsf@stressinduktion.org> <55CA608B.1070302@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2478 Lines: 62 On Wed, 12 Aug 2015 16:14:33 +0800 Zang MingJie wrote: > On Wed, Aug 12, 2015 at 4:52 AM, Alexander Duyck > wrote: > > On 08/10/2015 04:50 AM, Hannes Frederic Sowa wrote: > >> > >> Hello, > >> > >> Zang MingJie writes: > >> > >>> Here comes several options: > >>> > >>> 1. reject local next hop w/ EINVAL > >>> 2. delete route when local next hop removed > >> > >> Will also cause some people to complain. > >> > >>> 3. transition between RT_SCOPE_HOST amd RT_SCOPE_LINK > >> > >> I don't understand the scope transition. I know Alex mentioned it for > >> the first time. Maybe he can explain? > > > > > > If I am not mistaken part of the issue in terms of the behaviour being seen > > is due to the fact that the nexthop scope is recorded only when the route is > > added, and there is code in place in rt_set_nexthop which will only use the > > gateway if the scope is RT_SCOPE_LINK. So what we would probably need to do > > is go through and audit any routes on a given interface every time an > > address is added or removed and if the nh_gw is equal to the address added > > or removed would would need to transition between RT_SCOPE_LINK and > > RT_SCOPE_HOST since the gateway is transitioning between the local system > > and somewhere on the other side of the link. > > > > The problem is that this would still be a behaviour change and there may be > > somebody that has heartburn about it. > > That's why I'm going to introduce a sysconf entry, with the entry > unset, keep compatibility; with the entry set, fix the bug. > > > > >>> 4. document it > >> > >> I prefer that one :) > > > > > > Yeah, me too. The fact is things have worked this way up until now and I > > suspect the reason why this hasn't been reported until now is simply because > > in many cases it works since routes are usually updated if you are moving > > the gateway onto the local system. Most people doing any router use routing protocols suites like Quagga or Bird which have a routing management daemon. This is the kind of change that the routing services portion manages. When a route or interface change is detected it updates the FIB based on the bigger RIB. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/