summaryrefslogtreecommitdiff
path: root/zebra/zebra_vty.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/zebra_vty.c')
-rw-r--r--zebra/zebra_vty.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c
index 8c0d6df68a..89a60636cd 100644
--- a/zebra/zebra_vty.c
+++ b/zebra/zebra_vty.c
@@ -942,11 +942,27 @@ static void do_show_route_helper(struct vty *vty, struct zebra_vrf *zvrf,
if (!tableid)
vty_out(vty, "VRF %s:\n",
zvrf_name(zvrf));
- else
- vty_out(vty,
- "VRF %s table %u:\n",
- zvrf_name(zvrf),
- tableid);
+ else {
+ if (vrf_is_backend_netns())
+ vty_out(vty, "VRF %s table %u:\n",
+ zvrf_name(zvrf), tableid);
+ else {
+ vrf_id_t vrf =
+ zebra_vrf_lookup_by_table(tableid,
+ zvrf->zns->ns_id);
+
+ if (vrf == VRF_DEFAULT &&
+ tableid != RT_TABLE_ID_MAIN)
+ vty_out(vty, "table %u:\n", tableid);
+ else {
+ struct zebra_vrf *zvrf2 =
+ zebra_vrf_lookup_by_id(vrf);
+
+ vty_out(vty, "VRF %s table %u:\n",
+ zvrf_name(zvrf2), tableid);
+ }
+ }
+ }
}
ctx->header_done = true;
first = 0;