]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: Allow json output to give a bit more data
authorDonald Sharp <sharpd@cumulusnetworks.com>
Sun, 10 Mar 2019 01:28:49 +0000 (20:28 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 15 Mar 2019 13:38:55 +0000 (09:38 -0400)
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 2672c7b8a77a440d0dc5fd0025bc481fc10c4774..3348f82032ffd3a4513332b3e1d3763d10a7a742 100644 (file)
@@ -374,6 +374,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;
@@ -398,6 +399,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);