summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Gouault <christophe.gouault@6wind.com>2020-08-20 11:15:33 +0200
committerChristophe Gouault <christophe.gouault@6wind.com>2020-09-21 10:07:56 +0200
commitd58b6f7568dab83e07fe144915b7c33e093a8abd (patch)
treec7f2f1d91fdad61bd58898647de8efe2d6a3b6a3
parent6ac940417795da8dd73fc7817e509295b13fa7af (diff)
zebra: always display vrf in show ip route json
In route json outputs, always display the vrf even if it is the default vrf. Signed-off-by: Christophe Gouault <christophe.gouault@6wind.com>
-rw-r--r--zebra/zebra_vty.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c
index 77a2ce4ae7..fc0df09df8 100644
--- a/zebra/zebra_vty.c
+++ b/zebra/zebra_vty.c
@@ -830,11 +830,9 @@ static void vty_show_ip_route(struct vty *vty, struct route_node *rn,
json_object_int_add(json_route, "instance",
re->instance);
- if (re->vrf_id) {
- json_object_int_add(json_route, "vrfId", re->vrf_id);
- json_object_string_add(json_route, "vrfName",
- vrf_id_to_name(re->vrf_id));
- }
+ json_object_int_add(json_route, "vrfId", re->vrf_id);
+ json_object_string_add(json_route, "vrfName",
+ vrf_id_to_name(re->vrf_id));
if (CHECK_FLAG(re->flags, ZEBRA_FLAG_SELECTED))
json_object_boolean_true_add(json_route, "selected");