diff options
| author | Donatas Abraitis <donatas@opensourcerouting.org> | 2023-10-30 08:55:49 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-30 08:55:49 +0200 |
| commit | 73914a3e730f5d8464d72a7228a060183ced8209 (patch) | |
| tree | c8478cfaada4f791a7fe0a0be43146e7eb45e2d8 /lib/vty.c | |
| parent | f969bc0459a0aa530a5a8e2eddd6faf8249d8f21 (diff) | |
| parent | 28eaac01315d41a3bb7a903b9c4d74da412e4317 (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.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -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. */ |
