Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 095b8501 authored by Robert Olsson's avatar Robert Olsson Committed by David S. Miller
Browse files

[IPV4]: Fix single-entry /proc/net/fib_trie output.


 
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: default avatarRobert Olsson <robert.olsson@its.uu.se>
Acked-by: default avatarEric W. Biederman <ebiederm@xmission.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 342a0cff
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -2290,16 +2290,17 @@ static int fib_trie_seq_show(struct seq_file *seq, void *v)
	if (v == SEQ_START_TOKEN)
		return 0;

	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");
	}

	if (IS_TNODE(n)) {
		struct tnode *tn = (struct tnode *) n;
		__be32 prf = htonl(MASK_PFX(tn->key, tn->pos));

		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,