]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: always display vrf in show ip route json
authorChristophe Gouault <christophe.gouault@6wind.com>
Thu, 20 Aug 2020 09:15:33 +0000 (11:15 +0200)
committerChristophe Gouault <christophe.gouault@6wind.com>
Mon, 21 Sep 2020 08:07:56 +0000 (10:07 +0200)
In route json outputs, always display the vrf even if it is the
default vrf.

Signed-off-by: Christophe Gouault <christophe.gouault@6wind.com>
zebra/zebra_vty.c

index 77a2ce4ae768ac272f17d3dcaa065c74dd8335cf..fc0df09df89cc5917b584d7cd37903c5342d4bcf 100644 (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");