summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-06-14 08:08:12 -0400
committerStephen Hemminger <stephen@networkplumber.org>2017-06-15 08:29:30 -0700
commit3dc98cf2f51ffa2ebcc6c592aa95eae78d04d0c7 (patch)
treec7f6fe62b68da221b484b99a419a2df9362ca76f
parenta11b7b71a6eba4ee80e931e4f75321a0cf0116f1 (diff)
downloadiproute2-3dc98cf2f51ffa2ebcc6c592aa95eae78d04d0c7.tar.gz
ip: mroute: Add table output to show command
When the user specifies `table all` or `table 0` to the `ip mroute show` command we dump the entirety of the known mroute tables. Without some sort of divisor to tell us what table we are looking at the command is useless. Add `Table: <vrf name>` to the output of 'ip mroute show table 0' Follow the convention established by 'ip route show table 0' for when to display Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
-rw-r--r--ip/ipmroute.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ip/ipmroute.c b/ip/ipmroute.c
index 84950037..b51c23cc 100644
--- a/ip/ipmroute.c
+++ b/ip/ipmroute.c
@@ -178,6 +178,11 @@ int print_mroute(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
fprintf(fp, ", Age %4i.%.2i", (int)tv.tv_sec,
(int)tv.tv_usec/10000);
}
+
+ if (table && (table != RT_TABLE_MAIN || show_details > 0) && !filter.tb)
+ fprintf(fp, " Table: %s",
+ rtnl_rttable_n2a(table, b1, sizeof(b1)));
+
fprintf(fp, "\n");
fflush(fp);
return 0;