Merge pull request #678

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
This commit is contained in:
David Lamparter 2017-06-13 10:03:01 +02:00
commit ea00fb03f0

View File

@ -9375,9 +9375,6 @@ bgp_show_neighbor_vty (struct vty *vty, const char *name,
union sockunion su;
json_object *json = NULL;
if (use_json)
json = json_object_new_object();
if (name)
{
if (strmatch(name, "all"))
@ -9392,6 +9389,7 @@ bgp_show_neighbor_vty (struct vty *vty, const char *name,
{
if (use_json)
{
json = json_object_new_object();
json_object_boolean_true_add(json, "bgpNoSuchInstance");
vty_out (vty, "%s%s", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY), VTY_NEWLINE);
json_object_free(json);
@ -9410,6 +9408,7 @@ bgp_show_neighbor_vty (struct vty *vty, const char *name,
if (bgp)
{
json = json_object_new_object();
if (ip_str)
{
ret = str2sockunion (ip_str, &su);
@ -9422,6 +9421,7 @@ bgp_show_neighbor_vty (struct vty *vty, const char *name,
{
bgp_show_neighbor (vty, bgp, type, NULL, NULL, use_json, json);
}
json_object_free (json);
}
return CMD_SUCCESS;