Merge pull request #3404 from donaldsharp/nexthop_cleanup

lib: Cleanup nexthop2str code to be consistent
This commit is contained in:
Renato Westphal 2018-12-03 18:20:27 -02:00 committed by GitHub
commit b0f59f90ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View 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);