netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bill Fink <billfink@mindspring.com>
To: Stephen Hemminger <shemminger@vyatta.com>
Cc: Diego Woitasen <diego@woitasen.com.ar>, netdev@vger.kernel.org
Subject: Re: ip route show shows the routes in the inverse order?
Date: Tue, 13 Mar 2012 02:15:29 -0400	[thread overview]
Message-ID: <20120313021529.97514922.billfink@mindspring.com> (raw)
In-Reply-To: <20120312193204.5be5b4b8@nehalam.linuxnetplumber.net>

On Mon, 12 Mar 2012, Stephen Hemminger wrote:

> On Mon, 12 Mar 2012 22:18:48 -0300
> Diego Woitasen <diego@woitasen.com.ar> wrote:
> 
> > Hi,
> >  I've noticed that iproute and the old route command show the routes
> > in the inverse order. This new behavior looks related to the removal
> > of fib_hash (replaceed by fib_trie). I think that the old behavior
> > should be recovered. More specific routes in the first place looks
> > more natural for me and it's been the behavior for years. It doesn't
> > make any sense to change it.
> > 
> >  Sorry if this was already discussed, I couldn't find anything in the archives.
> > 
> > Regards,
> >  Diego
> > 
> 
> The kerne never guaranteed any order in returned values. If you want a given
> order than you need to sort them your self.

I understand the kernel doesn't guarantee any order to the routes.
But it does make sense for the userspace tools like ip to do this
for the user since the kernel is no longer doing this.  And having
more specific routes first also makes sense.  Some scripts may depend
on this plus its much more efficent that way if trying to find a
matching route since you can quit on the first match instead of
having to scan the entire routing table.

						-Bill

  reply	other threads:[~2012-03-13  6:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-13  1:18 ip route show shows the routes in the inverse order? Diego Woitasen
2012-03-13  2:32 ` Stephen Hemminger
2012-03-13  6:15   ` Bill Fink [this message]
2012-03-13  6:52     ` David Miller
2012-03-13 14:26       ` Diego Woitasen
2012-03-13 16:47         ` Eric Dumazet
2012-03-13 15:37       ` Ben Greear
2012-03-14  5:30         ` Bill Fink
2012-03-14  5:32           ` 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=20120313021529.97514922.billfink@mindspring.com \
    --to=billfink@mindspring.com \
    --cc=diego@woitasen.com.ar \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@vyatta.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).