]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[PATCH] IPV4: Fix single-entry /proc/net/fib_trie output.
authorRobert Olsson <robert.olsson@its.uu.se>
Fri, 2 Feb 2007 20:58:58 +0000 (12:58 -0800)
committerChris Wright <chrisw@sous-sol.org>
Mon, 5 Feb 2007 16:31:44 +0000 (08:31 -0800)
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.

Signed-off-by: Robert Olsson <robert.olsson@its.uu.se>
Acked-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
net/ipv4/fib_trie.c

index c3afc24ce140302a4b5dcbdc35067be34eb18324..1f16c3f2206024ee8146a0a7960801dcfec07bf3 100644 (file)
@@ -2290,16 +2290,17 @@ static int fib_trie_seq_show(struct seq_file *seq, void *v)
        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,