]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: Allow json output to give a bit more data 3928/head
authorDonald Sharp <sharpd@cumulusnetworks.com>
Sun, 10 Mar 2019 01:28:49 +0000 (20:28 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Sun, 10 Mar 2019 01:28:49 +0000 (20:28 -0500)
The dest->selected_fib should be reported in json output
so that we can debug subtle conditions a bit better in the
future.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
zebra/zebra_vty.c

index 537820f7ea71dd8ec2f3633438d682c240242b06..b0884f22cfee050d6931814460ae3f4f823e88bf 100644 (file)
@@ -383,6 +383,7 @@ static void vty_show_ip_route(struct vty *vty, struct route_node *rn,
        json_object *json_labels = NULL;
        time_t uptime;
        struct tm *tm;
+       rib_dest_t *dest = rib_dest_from_rnode(rn);
 
        uptime = time(NULL);
        uptime -= re->uptime;
@@ -407,6 +408,10 @@ static void vty_show_ip_route(struct vty *vty, struct route_node *rn,
                if (CHECK_FLAG(re->flags, ZEBRA_FLAG_SELECTED))
                        json_object_boolean_true_add(json_route, "selected");
 
+               if (dest->selected_fib == re)
+                       json_object_boolean_true_add(json_route,
+                                                    "destSelected");
+
                json_object_int_add(json_route, "distance",
                                    re->distance);
                json_object_int_add(json_route, "metric", re->metric);