From 089cd1a830726fae012871a8c7308a7ab492bce7 Mon Sep 17 00:00:00 2001 From: Anuradha Karuppiah Date: Tue, 12 Feb 2019 12:53:40 -0800 Subject: [PATCH] bgpd: display label as part of the PMSI tunnel attribute root@TORS1:~# net show bgp l2vpn evpn route rd 27.0.0.15:4 type multicast EVPN type-2 prefix: [2]:[ESI]:[EthTag]:[MAClen]:[MAC] EVPN type-3 prefix: [3]:[EthTag]:[IPlen]:[OrigIP] EVPN type-5 prefix: [5]:[ESI]:[EthTag]:[IPlen]:[IP] BGP routing table entry for 27.0.0.15:4:[3]:[0]:[32]:[27.0.0.15] Paths: (1 available, best #1) Advertised to non peer-group peers: MSP1(uplink-1) MSP2(uplink-2) Route [3]:[0]:[32]:[27.0.0.15] VNI 1003 Local 27.0.0.15 from 0.0.0.0 (27.0.0.15) Origin IGP, weight 32768, valid, sourced, local, bestpath-from-AS Local, best Extended Community: ET:8 RT:5550:1003 AddPath ID: RX 0, TX 10 Last update: Thu Feb 7 00:17:24 2019 PMSI Tunnel Type: Ingress Replication, label: 1003 >>>>>>>>>>>>> Displayed 1 prefixes (1 paths) with this RD (of requested type) root@TORS1:~# Ticket: CM-23790 Signed-off-by: Anuradha Karuppiah --- bgpd/bgp_route.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 428270f42c2f..feb806ef0439 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -8382,11 +8382,15 @@ void route_vty_out_detail(struct vty *vty, struct bgp *bgp, struct prefix *p, json_pmsi = json_object_new_object(); json_object_string_add(json_pmsi, "tunnelType", str); + json_object_int_add(json_pmsi, + "label", + label2vni(&attr->label)); json_object_object_add(json_path, "pmsi", json_pmsi); } else - vty_out(vty, " PMSI Tunnel Type: %s\n", - str); + vty_out(vty, + " PMSI Tunnel Type: %s, label: %d\n", + str, label2vni(&attr->label)); } }