summaryrefslogtreecommitdiff
path: root/lib/vty.c
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2023-10-30 08:55:49 +0200
committerGitHub <noreply@github.com>2023-10-30 08:55:49 +0200
commit73914a3e730f5d8464d72a7228a060183ced8209 (patch)
treec8478cfaada4f791a7fe0a0be43146e7eb45e2d8 /lib/vty.c
parentf969bc0459a0aa530a5a8e2eddd6faf8249d8f21 (diff)
parent28eaac01315d41a3bb7a903b9c4d74da412e4317 (diff)
Merge pull request #13576 from chiragshah6/mdev1
zebra:returns empty dict when evpn is disabled II
Diffstat (limited to 'lib/vty.c')
-rw-r--r--lib/vty.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/vty.c b/lib/vty.c
index ffb7274b90..f395fd3ea1 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -383,11 +383,14 @@ int vty_json_no_pretty(struct vty *vty, struct json_object *json)
return vty_json_helper(vty, json, JSON_C_TO_STRING_NOSLASHESCAPE);
}
-void vty_json_empty(struct vty *vty)
+void vty_json_empty(struct vty *vty, struct json_object *json)
{
- json_object *json = json_object_new_object();
+ json_object *jsonobj = json;
- vty_json(vty, json);
+ if (!json)
+ jsonobj = json_object_new_object();
+
+ vty_json(vty, jsonobj);
}
/* Output current time to the vty. */