From e691d16a63ce40bc56ecbc970e8118686d4b0148 Mon Sep 17 00:00:00 2001 From: "Ondrej Zajicek (work)" Date: Tue, 29 Dec 2015 17:12:47 +0100 Subject: Explicit ip4_addr / ip6_addr printf support --- lib/net.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'lib/net.c') diff --git a/lib/net.c b/lib/net.c index 76ecd460..a78111ab 100644 --- a/lib/net.c +++ b/lib/net.c @@ -31,17 +31,16 @@ net_format(const net_addr *N, char *buf, int buflen) { net_addr_union *n = (void *) N; - /* XXXX fix %I vs %R */ switch (n->n.type) { case NET_IP4: - return bsnprintf(buf, buflen, "%R/%d", n->ip4.prefix, n->ip4.pxlen); + return bsnprintf(buf, buflen, "%I4/%d", n->ip4.prefix, n->ip4.pxlen); case NET_IP6: - return bsnprintf(buf, buflen, "%I/%d", n->ip6.prefix, n->ip6.pxlen); + return bsnprintf(buf, buflen, "%I6/%d", n->ip6.prefix, n->ip6.pxlen); case NET_VPN4: - return bsnprintf(buf, buflen, "%u:%u %R/%d", (u32) (n->vpn4.rd >> 32), (u32) n->vpn4.rd, n->vpn4.prefix, n->vpn4.pxlen); + return bsnprintf(buf, buflen, "%u:%u %I4/%d", (u32) (n->vpn4.rd >> 32), (u32) n->vpn4.rd, n->vpn4.prefix, n->vpn4.pxlen); case NET_VPN6: - return bsnprintf(buf, buflen, "%u:%u %I/%d", (u32) (n->vpn6.rd >> 32), (u32) n->vpn6.rd, n->vpn6.prefix, n->vpn6.pxlen); + return bsnprintf(buf, buflen, "%u:%u %I6/%d", (u32) (n->vpn6.rd >> 32), (u32) n->vpn6.rd, n->vpn6.prefix, n->vpn6.pxlen); } return 0; -- cgit v1.2.3