summaryrefslogtreecommitdiff
path: root/bgpd
diff options
context:
space:
mode:
authorChirag Shah <chirag@nvidia.com>2025-02-03 12:00:41 -0800
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2025-02-04 12:41:48 +0000
commit4db6d865b97b19c2ddc1f08a836647443469627e (patch)
tree6a720341e6ccae0ce7553f54914d29ec8c73b3a2 /bgpd
parentb56de28f94ab0cf4b917d87ddd4de206e7e85190 (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> (cherry picked from commit 892704d07f5286464728720648ad392b485a9966)
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 80760a632a..9eabfb6da0 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -16464,9 +16464,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(