From: Donald Sharp Date: Tue, 12 Sep 2017 18:52:20 +0000 (-0400) Subject: zebra: Modify 'show ip route ...' to show duplicated nexthops X-Git-Tag: frr-4.0-dev~311^2~1 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=eaf5150f58bf38a7903387c7fd701c3a0349beb6;p=mirror%2Ffrr.git zebra: Modify 'show ip route ...' to show duplicated nexthops Add the ability for person issuing 'show ip route...' commands to see if we've suppressed adding a nexthop to the kernel. Signed-off-by: Donald Sharp --- diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c index 1573646adc..0b7543e43a 100644 --- a/zebra/zebra_vty.c +++ b/zebra/zebra_vty.c @@ -440,7 +440,8 @@ static void vty_show_ip_route_detail(struct vty *vty, struct route_node *rn, vty_out(vty, " %c%s", CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_FIB) - ? '*' + ? CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_DUPLICATE) + ? ' ' : '*' : ' ', nexthop->rparent ? " " : ""); @@ -489,6 +490,9 @@ static void vty_show_ip_route_detail(struct vty *vty, struct route_node *rn, default: break; } + if (CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_DUPLICATE)) + vty_out(vty, " (duplicate nexthop removed)"); + if (!CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_ACTIVE)) vty_out(vty, " inactive"); @@ -608,6 +612,10 @@ static void vty_show_ip_route(struct vty *vty, struct route_node *rn, for (ALL_NEXTHOPS(re->nexthop, nexthop)) { json_nexthop = json_object_new_object(); + if (CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_DUPLICATE)) + json_object_boolean_true_add(json_nexthop, + "duplicate"); + if (CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_FIB)) json_object_boolean_true_add(json_nexthop, "fib"); @@ -687,6 +695,10 @@ static void vty_show_ip_route(struct vty *vty, struct route_node *rn, break; } + if (CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_DUPLICATE)) + json_object_boolean_true_add(json_nexthop, + "duplicate"); + if (CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_ACTIVE)) json_object_boolean_true_add(json_nexthop, "active"); @@ -774,12 +786,14 @@ static void vty_show_ip_route(struct vty *vty, struct route_node *rn, if (re->type != ZEBRA_ROUTE_CONNECT) len += vty_out(vty, " [%d/%d]", re->distance, re->metric); - } else + } else { vty_out(vty, " %c%*c", CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_FIB) - ? '*' + ? CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_DUPLICATE) + ? ' ' : '*' : ' ', len - 3 + (2 * nexthop_level(nexthop)), ' '); + } switch (nexthop->type) { case NEXTHOP_TYPE_IPV4: