Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fib_trie: Only display main table in /proc/net/route

When we merged the tries for local and main I had overlooked the iterator
for /proc/net/route. As a result it was outputting both local and main
when the two tries were merged.

This patch resolves that by only providing output for aliases that are
actually in the main trie. As a result we should go back to the original
behavior which I assume will be necessary to maintain legacy support.

Fixes: 0ddcf43d5 ("ipv4: FIB Local/MAIN table collapse")
Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Alexander Duyck and committed by
David S. Miller
654eff45 388a8357

+5
+5
net/ipv4/fib_trie.c
··· 2539 2539 */ 2540 2540 static int fib_route_seq_show(struct seq_file *seq, void *v) 2541 2541 { 2542 + struct fib_route_iter *iter = seq->private; 2543 + struct fib_table *tb = iter->main_tb; 2542 2544 struct fib_alias *fa; 2543 2545 struct key_vector *l = v; 2544 2546 __be32 prefix; ··· 2561 2559 2562 2560 if ((fa->fa_type == RTN_BROADCAST) || 2563 2561 (fa->fa_type == RTN_MULTICAST)) 2562 + continue; 2563 + 2564 + if (fa->tb_id != tb->tb_id) 2564 2565 continue; 2565 2566 2566 2567 seq_setwidth(seq, 127);