summaryrefslogtreecommitdiffstats
path: root/bgpd
diff options
context:
space:
mode:
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. */