]> git.puffer.fish Git - matthieu/frr.git/commitdiff
lib: Cleanup nexthop2str code to be consistent
authorDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 30 Nov 2018 21:07:34 +0000 (16:07 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 30 Nov 2018 21:07:34 +0000 (16:07 -0500)
We sometimes store ifindex information in the NEXTHOP_TYPE_IPV[4|6]
so let's let us display that information as well when dumping
a nexthop.

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

index 3603050f06400db885506fb4c0e1f89fb1cae0f7..d25b470277b40167b6064a8a4719f145c555072c 100644 (file)
@@ -248,15 +248,11 @@ const char *nexthop2str(const struct nexthop *nexthop, char *str, int size)
                snprintf(str, size, "if %u", nexthop->ifindex);
                break;
        case NEXTHOP_TYPE_IPV4:
-               snprintf(str, size, "%s", inet_ntoa(nexthop->gate.ipv4));
-               break;
        case NEXTHOP_TYPE_IPV4_IFINDEX:
                snprintf(str, size, "%s if %u", inet_ntoa(nexthop->gate.ipv4),
                         nexthop->ifindex);
                break;
        case NEXTHOP_TYPE_IPV6:
-               snprintf(str, size, "%s", inet6_ntoa(nexthop->gate.ipv6));
-               break;
        case NEXTHOP_TYPE_IPV6_IFINDEX:
                snprintf(str, size, "%s if %u", inet6_ntoa(nexthop->gate.ipv6),
                         nexthop->ifindex);