From: Hannes Frederic Sowa <hannes@stressinduktion.org>
To: Alexander Duyck <alexander.h.duyck@redhat.com>,
Zang MingJie <zealot0630@gmail.com>
Cc: Alexander Duyck <alexander.duyck@gmail.com>,
Daniel Borkmann <daniel@iogearbox.net>,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
Stephen Hemminger <stephen@networkplumber.org>,
David Miller <davem@davemloft.net>
Subject: Re: [BUG] net/ipv4: inconsistent routing table
Date: Fri, 07 Aug 2015 19:00:24 +0200 [thread overview]
Message-ID: <878u9njaon.fsf@stressinduktion.org> (raw)
In-Reply-To: <55C4D803.3090108@redhat.com>
Hello,
Alexander Duyck <alexander.h.duyck@redhat.com> writes:
> On 08/07/2015 01:23 AM, Zang MingJie wrote:
>> IMO, the routing decision is determined, given a specific routing
>> table and local network the result MUST be determined, independence of
>> how/what order the routing entry is added.
>>
>> Now there are two ways to configure the system resulting EXACTLY the
>> same routing table and local addresses, but the routing decision is
>> totally different.
>>
>> SAME routing table, DIFFERENT routing decision, there MUST be bugs in kernel
>
> I wasn't arguing that the behavior is undesirable, but the likelihood of
> having a default route assigned to a local address should be pretty
> low. If the system is the default route of others then it should have a
> different default gateway than itself. For example an office router
> would end up pointing to the ISP as the gateway, and the ISP would
> either point to some other provider or run a BGP configuration. So in
> the case of the default route transitioning to us we should end up
> having to delete and update the default route anyway. This is likely
> one of the reasons why there hasn't been any issues reported with this
> behavior until now.
>
> I'm just wondering if the work involved to fix it is going to be worth
> it. We have to keep in mind that this will result in a change of
> behavior for existing users and we don't know if anyone might be
> expecting this type of behavior.
>
> We basically are looking at one of three options. The first one is to
> just delete the route if you add the gateway as a local address or
> remove it. That would be consistent with what you might see if the
> address was the sole address on an interface of its own. The second
> option is to update the nh_scope which I believe should be transitioned
> between RT_SCOPE_HOST to RT_SCOPE_LINK if I am understanding things
> correctly. The third option is we don't change the behavior and just
> document it. This would then require manually deleting and restoring
> any routes that use a recently modified address as their gateway.
>
> Based on your feedback I'm assuming you would probably prefer the second
> option. I'm just waiting to see if there are any other opinions on the
> matter before I act.
The semantics behind this are not easy and the result might well break
other people's system. I would leave the current resolution logic as-is
and merely change the way iproute presents those information.
Currently we resolve the nexthop during route setup time and install the
resulting information into the FIB. This is very common on other OS, too.
In case we would reevaluate the nexthop part of a route during local
address changes on one of the interfaces, we could get the system very
well in a situation where it would have to remove its default route
because the network would not be reachable via ip subnetting any more,
but neighboring information would still keep the machine connected. And
this could happen with setups where someone did not configure their
routes to their own addresses, which are much more widespread.
The change wouldn't be in contradiction with weak end system behavior,
but I very much don't want to make other people's machines unreachable
because of such a change.
If we could rewind time, we could make local nexthops -EINVAL.
Bye,
Hannes
next prev parent reply other threads:[~2015-08-07 17:00 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAOrge3qi=7YPRO+VeCDvHsm_7SFC4Y=+JpwQtwAV3zk_q4fEAw@mail.gmail.com>
2015-08-05 9:06 ` [BUG] net/ipv4: inconsistent routing table Daniel Borkmann
2015-08-05 17:45 ` Alexander Duyck
2015-08-06 10:13 ` Zang MingJie
2015-08-06 19:43 ` Alexander Duyck
2015-08-07 8:23 ` Zang MingJie
2015-08-07 16:08 ` Alexander Duyck
2015-08-07 17:00 ` Hannes Frederic Sowa [this message]
[not found] ` <CAOrge3qxOb_XrspuvYjV0pDDxUUoqGE3690KUQGoxZMxuD-NRQ@mail.gmail.com>
2015-08-08 10:36 ` Zang MingJie
2015-08-10 9:16 ` Hannes Frederic Sowa
2015-08-10 10:51 ` Zang MingJie
2015-08-10 11:50 ` Hannes Frederic Sowa
2015-08-11 20:52 ` Alexander Duyck
2015-08-11 21:15 ` David Miller
2015-08-12 8:14 ` Zang MingJie
2015-08-12 15:23 ` Stephen Hemminger
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=878u9njaon.fsf@stressinduktion.org \
--to=hannes@stressinduktion.org \
--cc=alexander.duyck@gmail.com \
--cc=alexander.h.duyck@redhat.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
--cc=zealot0630@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).