From c854765f979eec24e7c5c07df1cd67a27fc342c2 Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Thu, 28 Jan 2021 15:56:33 +0200 Subject: [PATCH] bgpd: Include local AS for JSON output in `show bgp summary json` cmd Signed-off-by: Donatas Abraitis --- bgpd/bgp_vty.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index cd044bcb4b..4d6141ee84 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -10975,6 +10975,11 @@ static int bgp_show_summary(struct vty *vty, struct bgp *bgp, int afi, int safi, peer->domainname); json_object_int_add(json_peer, "remoteAs", peer->as); + json_object_int_add( + json_peer, "localAs", + peer->change_local_as + ? peer->change_local_as + : peer->local_as); json_object_int_add(json_peer, "version", 4); json_object_int_add(json_peer, "msgRcvd", PEER_TOTAL_RX(peer));