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>
This commit is contained in:
Christophe Gouault 2020-08-20 11:15:33 +02:00
parent 6ac9404177
commit d58b6f7568

View File

@ -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");