From 6be9a2087f9f5ff1502bef5f1a8f03c9233ad787 Mon Sep 17 00:00:00 2001 From: Mitesh Kanjariya Date: Thu, 2 Nov 2017 16:33:10 -0700 Subject: [PATCH] bgpd: adjust show bgp l2vpn evpn vni command to avoid sanity breakages Signed-off-by: Mitesh Kanjariya --- bgpd/bgp_evpn_vty.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/bgpd/bgp_evpn_vty.c b/bgpd/bgp_evpn_vty.c index b1b3aa94ab..fe0d4c0ca9 100644 --- a/bgpd/bgp_evpn_vty.c +++ b/bgpd/bgp_evpn_vty.c @@ -607,9 +607,8 @@ static void show_vni_entry(struct hash_backet *backet, void *args[]) json_vni, "rd", prefix_rd2str(&vpn->prd, buf2, sizeof(buf2))); } else { - vty_out(vty, "%-1s %-10u %-15s %-37s %-21s", buf1, vpn->vni, + vty_out(vty, "%-1s %-10u %-15s %-21s", buf1, vpn->vni, inet_ntoa(vpn->originator_ip), - vrf_id_to_name(vpn->tenant_vrf_id), prefix_rd2str(&vpn->prd, buf2, RD_ADDRSTRLEN)); } @@ -662,6 +661,9 @@ static void show_vni_entry(struct hash_backet *backet, void *args[]) break; } + if (!json) + vty_out(vty, "%-37s", vrf_id_to_name(vpn->tenant_vrf_id)); + if (json) { char vni_str[VNI_STR_LEN]; @@ -2170,9 +2172,9 @@ static void evpn_show_all_vnis(struct vty *vty, struct bgp *bgp, } else { vty_out(vty, "Number of VNIs: %u\n", num_vnis); vty_out(vty, "Flags: * - Kernel\n"); - vty_out(vty, " %-10s %-15s %-37s %-21s %-25s %-25s\n", "VNI", - "Orig IP", "Tenant-Vrf", "RD", "Import RT", - "Export RT"); + vty_out(vty, " %-10s %-15s %-21s %-25s %-25s %-37s\n", "VNI", + "Orig IP", "RD", "Import RT", + "Export RT", "Tenant-Vrf"); } args[0] = vty; -- 2.39.5