summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2023-05-23 10:40:46 +0300
committerGitHub <noreply@github.com>2023-05-23 10:40:46 +0300
commitc8b4b93b83a28332ac1046a0859a05fae8c0018a (patch)
tree4b6fd7fd169da2cace2df5924358727ccf9a3e0b
parentb8b30c765b5a2a446bac261f7c3dee88deee50e5 (diff)
parent82465ca7f91c36ea06647f24e218231e6c8854de (diff)
Merge pull request #13577 from raja-rajasekar/frr_dev1
Fixing show bgp all json format and convert evpn to no pretty output
-rw-r--r--bgpd/bgp_evpn_vty.c9
-rw-r--r--bgpd/bgp_route.c9
2 files changed, 17 insertions, 1 deletions
diff --git a/bgpd/bgp_evpn_vty.c b/bgpd/bgp_evpn_vty.c
index 811856bfed..66079cad22 100644
--- a/bgpd/bgp_evpn_vty.c
+++ b/bgpd/bgp_evpn_vty.c
@@ -3217,7 +3217,14 @@ int bgp_evpn_show_all_routes(struct vty *vty, struct bgp *bgp, int type,
evpn_show_all_routes(vty, bgp, type, json, detail, false);
if (use_json)
- vty_json(vty, json);
+ /*
+ * We are using no_pretty here because under extremely high
+ * settings (lots of routes with many different paths) this can
+ * save several minutes of output when FRR is run on older cpu's
+ * or more underperforming routers out there. So for route
+ * scale, we need to use no_pretty json.
+ */
+ vty_json_no_pretty(vty, json);
return CMD_SUCCESS;
}
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index eb51bc1fd6..85f08bbed5 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -13068,6 +13068,15 @@ DEFPY(show_ip_bgp, show_ip_bgp_cmd,
get_afi_safi_str(afi,
safi,
true));
+
+ /* Adding 'routes' key to make
+ * the json output format valid
+ * for evpn
+ */
+ if (safi == SAFI_EVPN)
+ vty_out(vty,
+ "\"routes\":");
+
} else
vty_out(vty,
"\nFor address family: %s\n",