summaryrefslogtreecommitdiff
path: root/bgpd
diff options
context:
space:
mode:
authorChirag Shah <chirag@nvidia.com>2025-02-03 12:00:41 -0800
committerChirag Shah <chirag@nvidia.com>2025-02-03 20:58:45 -0800
commit892704d07f5286464728720648ad392b485a9966 (patch)
treed76e518e3ce6ad4a02644fce0715ffb7a5f63fc9 /bgpd
parentf54241a34624b55fef3cb717c1fddebf62bef11d (diff)
bgpd: fix route-distinguisher in vrf leak json cmd
For auto configured value RD value comes as NULL, switching back to original change will ensure to cover for both auto and user configured RD value in JSON. tor-11# show bgp vrf blue ipv4 unicast route-leak json { "vrf":"blue", "afiSafi":"ipv4Unicast", "importFromVrfs":[ "purple" ], "importRts":"10.10.3.11:6", "exportToVrfs":[ "purple" ], "routeDistinguisher":"(null)", <<<<< "exportRts":"10.10.3.11:10" } Signed-off-by: Chirag Shah <chirag@nvidia.com>
Diffstat (limited to 'bgpd')
-rw-r--r--bgpd/bgp_vty.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index e18f6443b5..bf9219611e 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -16686,9 +16686,9 @@ static int bgp_show_route_leak_vty(struct vty *vty, const char *name,
json_object_new_string(vname));
json_object_object_add(json, "exportToVrfs",
json_export_vrfs);
- json_object_string_addf(
- json, "routeDistinguisher", "%s",
- bgp->vpn_policy[afi].tovpn_rd_pretty);
+ json_object_string_addf(json, "routeDistinguisher",
+ BGP_RD_AS_FORMAT(bgp->asnotation),
+ &bgp->vpn_policy[afi].tovpn_rd);
dir = BGP_VPN_POLICY_DIR_TOVPN;
if (bgp->vpn_policy[afi].rtlist[dir]) {
ecom_str = ecommunity_ecom2str(