mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-24 08:54:23 +00:00
lib: Cleanup nexthop2str code to be consistent
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>
This commit is contained in:
parent
d9d759ff7e
commit
1d74ea6ea0
@ -248,15 +248,11 @@ const char *nexthop2str(const struct nexthop *nexthop, char *str, int size)
|
|||||||
snprintf(str, size, "if %u", nexthop->ifindex);
|
snprintf(str, size, "if %u", nexthop->ifindex);
|
||||||
break;
|
break;
|
||||||
case NEXTHOP_TYPE_IPV4:
|
case NEXTHOP_TYPE_IPV4:
|
||||||
snprintf(str, size, "%s", inet_ntoa(nexthop->gate.ipv4));
|
|
||||||
break;
|
|
||||||
case NEXTHOP_TYPE_IPV4_IFINDEX:
|
case NEXTHOP_TYPE_IPV4_IFINDEX:
|
||||||
snprintf(str, size, "%s if %u", inet_ntoa(nexthop->gate.ipv4),
|
snprintf(str, size, "%s if %u", inet_ntoa(nexthop->gate.ipv4),
|
||||||
nexthop->ifindex);
|
nexthop->ifindex);
|
||||||
break;
|
break;
|
||||||
case NEXTHOP_TYPE_IPV6:
|
case NEXTHOP_TYPE_IPV6:
|
||||||
snprintf(str, size, "%s", inet6_ntoa(nexthop->gate.ipv6));
|
|
||||||
break;
|
|
||||||
case NEXTHOP_TYPE_IPV6_IFINDEX:
|
case NEXTHOP_TYPE_IPV6_IFINDEX:
|
||||||
snprintf(str, size, "%s if %u", inet6_ntoa(nexthop->gate.ipv6),
|
snprintf(str, size, "%s if %u", inet6_ntoa(nexthop->gate.ipv6),
|
||||||
nexthop->ifindex);
|
nexthop->ifindex);
|
||||||
|
Loading…
Reference in New Issue
Block a user