Skip to content

Commit

Permalink
[IPV4]: Fix single-entry /proc/net/fib_trie output.
Browse files Browse the repository at this point in the history
 
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 <[email protected]>
Acked-by: Eric W. Biederman <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Robert Olsson authored and davem330 committed Jan 27, 2007
1 parent 342a0cf commit 095b850
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions net/ipv4/fib_trie.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 095b850

Please sign in to comment.