summaryrefslogtreecommitdiffstats
path: root/lib/nexthop.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-11-30 22:07:34 +0100
committerDonald Sharp <sharpd@cumulusnetworks.com>2018-11-30 22:07:34 +0100
commit1d74ea6ea0cf427185438f46ff44bd08e0835f9a (patch)
tree3e1088e2f9678467ed93435afb846552ad0e4a0a /lib/nexthop.c
parentMerge pull request #3396 from opensourcerouting/feature/topotests-docker (diff)
downloadfrr-1d74ea6ea0cf427185438f46ff44bd08e0835f9a.tar.xz
frr-1d74ea6ea0cf427185438f46ff44bd08e0835f9a.zip
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>
Diffstat (limited to 'lib/nexthop.c')
-rw-r--r--lib/nexthop.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/lib/nexthop.c b/lib/nexthop.c
index 3603050f0..d25b47027 100644
--- a/lib/nexthop.c
+++ b/lib/nexthop.c
@@ -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);