summaryrefslogtreecommitdiffstats
path: root/bgpd
diff options
context:
space:
mode:
authorRuss White <russ@riw.us>2022-12-13 14:54:13 +0100
committerGitHub <noreply@github.com>2022-12-13 14:54:13 +0100
commitdaa256700250ec0b4693f8820c7188123c2e0752 (patch)
treea01b7d2b24de32b77686d62fccfc51b8ee226141 /bgpd
parentMerge pull request #12499 from opensourcerouting/ospf-vertex-leak (diff)
parentbgpd: Adding BGP neighbor JSON output for neighbors never established a BGP a... (diff)
downloadfrr-daa256700250ec0b4693f8820c7188123c2e0752.tar.xz
frr-daa256700250ec0b4693f8820c7188123c2e0752.zip
Merge pull request #12447 from karlquan/master
BGP neighbor JSON output always displays hostname, nexthop and related keys
Diffstat (limited to 'bgpd')
-rw-r--r--bgpd/bgp_vty.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index 7b9400118..e51977f0f 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -13003,9 +13003,8 @@ static void bgp_show_peer(struct vty *vty, struct peer *p, bool use_json,
if (p->hostname) {
if (use_json) {
- if (p->hostname)
- json_object_string_add(json_neigh, "hostname",
- p->hostname);
+ json_object_string_add(json_neigh, "hostname",
+ p->hostname);
if (p->domainname)
json_object_string_add(json_neigh, "domainname",
@@ -13017,6 +13016,10 @@ static void bgp_show_peer(struct vty *vty, struct peer *p, bool use_json,
else
vty_out(vty, "Hostname: %s\n", p->hostname);
}
+ } else {
+ if (use_json)
+ json_object_string_add(json_neigh, "hostname",
+ "Unknown");
}
/* Peer-group */
@@ -14578,6 +14581,17 @@ static void bgp_show_peer(struct vty *vty, struct peer *p, bool use_json,
p->shared_network ? "shared network"
: "non shared network");
}
+ } else {
+ if (use_json) {
+ json_object_string_add(json_neigh, "nexthop",
+ "Unknown");
+ json_object_string_add(json_neigh, "nexthopGlobal",
+ "Unknown");
+ json_object_string_add(json_neigh, "nexthopLocal",
+ "Unknown");
+ json_object_string_add(json_neigh, "bgpConnection",
+ "Unknown");
+ }
}
/* Timer information. */