diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-09-12 14:52:20 -0400 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-09-12 14:52:20 -0400 |
| commit | eaf5150f58bf38a7903387c7fd701c3a0349beb6 (patch) | |
| tree | 7c267a6d1fc2cbec7dc1a802f3203e6fa87fcae4 | |
| parent | 25b9cb0cc834df7966338f76746e90bca8586161 (diff) | |
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 <sharpd@cumulusnetworks.com>
| -rw-r--r-- | zebra/zebra_vty.c | 20 |
1 files changed, 17 insertions, 3 deletions
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: |
