netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robert Olsson <Robert.Olsson@data.slu.se>
To: David Miller <davem@davemloft.net>
Cc: Robert.Olsson@data.slu.se, ebiederm@xmission.com,
	netdev@vger.kernel.org, robert.olsson@its.uu.se
Subject: Re: [PATCH] net: Fix the fib trie iterator to work with a single entry routing tables
Date: Fri, 26 Jan 2007 13:56:29 +0100	[thread overview]
Message-ID: <17849.64125.710251.587076@robur.slu.se> (raw)
In-Reply-To: <20070124.144254.78492493.davem@davemloft.net>


David Miller writes:

 > > Yes the case when the trie is just a single leaf got wrong with the
 > > iterator and your patchs cures it. I think we have a similar problem
 > > with /proc/net/fib_trie
 > 
 > I'm happy to review a fix for that :-)
 
When main table is just a single leaf this gets printed as belonging to the 
local table in /proc/net/fib_trie. A fix is below.

Cheers.
						--ro


Signed-off-by: Robert Olsson <robert.olsson@its.uu.se>


--- net-2.6.20/net/ipv4/fib_trie.c.orig	2007-01-26 13:18:13.000000000 +0100
+++ net-2.6.20/net/ipv4/fib_trie.c	2007-01-26 13:19:36.000000000 +0100
@@ -2290,16 +2290,17 @@
 	if (v == SEQ_START_TOKEN)
 		return 0;
 
+	if (!NODE_PARENT(n)) {
+		if (iter->trie == trie_local)
+			seq_puts(seq, "<local>:\n");
+		else
+			seq_puts(seq, "<main>:\n");
+	} 
+
 	if (IS_TNODE(n)) {
 		struct tnode *tn = (struct tnode *) n;
 		__be32 prf = htonl(MASK_PFX(tn->key, tn->pos));
 
-		if (!NODE_PARENT(n)) {
-			if (iter->trie == trie_local)
-				seq_puts(seq, "<local>:\n");
-			else
-				seq_puts(seq, "<main>:\n");
-		} 
 		seq_indent(seq, iter->depth-1);
 		seq_printf(seq, "  +-- %d.%d.%d.%d/%d %d %d %d\n",
 			   NIPQUAD(prf), tn->pos, tn->bits, tn->full_children, 
 

 

  parent reply	other threads:[~2007-01-26 12:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-24 19:56 [PATCH] net: Fix the fib trie iterator to work with a single entry routing tables Eric W. Biederman
2007-01-24 21:43 ` Robert Olsson
2007-01-24 22:42   ` David Miller
2007-01-25  2:11     ` Eric W. Biederman
2007-01-26 12:56     ` Robert Olsson [this message]
2007-01-26 15:42       ` Eric W. Biederman
2007-01-27  3:06         ` David Miller

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=17849.64125.710251.587076@robur.slu.se \
    --to=robert.olsson@data.slu.se \
    --cc=davem@davemloft.net \
    --cc=ebiederm@xmission.com \
    --cc=netdev@vger.kernel.org \
    --cc=robert.olsson@its.uu.se \
    /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).