]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: fix resolvedPrefix in show nexthop json output 17409/head
authorKrishnasamy R <krishnasamyr@nvidia.com>
Mon, 11 Nov 2024 09:59:31 +0000 (01:59 -0800)
committerKrishnasamy R <krishnasamyr@nvidia.com>
Mon, 11 Nov 2024 09:59:31 +0000 (01:59 -0800)
While populating  the nexthop info for "show bgp nexthop json", resolvedPrefix
is added in parent json object instead of json_nexthop object.
This results in displaying wrong resolvedPrefix for nexthops.
Fixing the same by adding resolvedPrefix to json_nexthop object, so that
the proper resolvedPrefix would be displayed for the respective nexthop

Signed-off-by: Krishnasamy R <krishnasamyr@nvidia.com>
bgpd/bgp_nexthop.c

index 401549c4e859382929cc637911a5062e7b96a513..357d5292dabb9cce5f29b1bd1fc9c90793fc985f 100644 (file)
@@ -1001,7 +1001,7 @@ static void bgp_show_nexthop(struct vty *vty, struct bgp *bgp,
                        if (bnc->is_evpn_gwip_nexthop)
                                json_object_boolean_true_add(json_nexthop,
                                                             "isEvpnGatewayIp");
-                       json_object_string_addf(json, "resolvedPrefix", "%pFX",
+                       json_object_string_addf(json_nexthop, "resolvedPrefix", "%pFX",
                                                &bnc->resolved_prefix);
                } else {
                        vty_out(vty, " %s valid [IGP metric %d], #paths %d",