Module Name: src Committed By: christos Date: Mon Jan 16 15:44:47 UTC 2017
Modified Files: src/sys/net: if_llatbl.c if_spppsubr.c src/sys/netinet: dccp_usrreq.c ip_carp.c sctp_asconf.c sctputil.c src/sys/netinet6: icmp6.c in6.c in6_gif.c in6_src.c in6_var.h ip6_forward.c ip6_input.c ip6_mroute.c ip6_output.c mld6.c nd6.c nd6_nbr.c nd6_rtr.c scope6.c src/sys/netipsec: ipsec.c Log Message: ip6_sprintf -> IN6_PRINT so that we pass the size. To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/sys/net/if_llatbl.c cvs rdiff -u -r1.166 -r1.167 src/sys/net/if_spppsubr.c cvs rdiff -u -r1.11 -r1.12 src/sys/netinet/dccp_usrreq.c \ src/sys/netinet/sctputil.c cvs rdiff -u -r1.82 -r1.83 src/sys/netinet/ip_carp.c cvs rdiff -u -r1.8 -r1.9 src/sys/netinet/sctp_asconf.c cvs rdiff -u -r1.205 -r1.206 src/sys/netinet6/icmp6.c cvs rdiff -u -r1.235 -r1.236 src/sys/netinet6/in6.c cvs rdiff -u -r1.84 -r1.85 src/sys/netinet6/in6_gif.c \ src/sys/netinet6/ip6_forward.c cvs rdiff -u -r1.77 -r1.78 src/sys/netinet6/in6_src.c cvs rdiff -u -r1.90 -r1.91 src/sys/netinet6/in6_var.h cvs rdiff -u -r1.172 -r1.173 src/sys/netinet6/ip6_input.c cvs rdiff -u -r1.114 -r1.115 src/sys/netinet6/ip6_mroute.c cvs rdiff -u -r1.181 -r1.182 src/sys/netinet6/ip6_output.c cvs rdiff -u -r1.78 -r1.79 src/sys/netinet6/mld6.c cvs rdiff -u -r1.225 -r1.226 src/sys/netinet6/nd6.c cvs rdiff -u -r1.135 -r1.136 src/sys/netinet6/nd6_nbr.c cvs rdiff -u -r1.130 -r1.131 src/sys/netinet6/nd6_rtr.c cvs rdiff -u -r1.16 -r1.17 src/sys/netinet6/scope6.c cvs rdiff -u -r1.68 -r1.69 src/sys/netipsec/ipsec.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/net/if_llatbl.c diff -u src/sys/net/if_llatbl.c:1.16 src/sys/net/if_llatbl.c:1.17 --- src/sys/net/if_llatbl.c:1.16 Wed Dec 21 03:47:02 2016 +++ src/sys/net/if_llatbl.c Mon Jan 16 10:44:46 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: if_llatbl.c,v 1.16 2016/12/21 08:47:02 ozaki-r Exp $ */ +/* $NetBSD: if_llatbl.c,v 1.17 2017/01/16 15:44:46 christos Exp $ */ /* * Copyright (c) 2004 Luigi Rizzo, Alessandro Cerri. All rights reserved. * Copyright (c) 2004-2008 Qing Li. All rights reserved. @@ -794,7 +794,7 @@ llatbl_lle_show(struct llentry_sa *la) char l3s[INET6_ADDRSTRLEN]; sin6 = (struct sockaddr_in6 *)&la->l3_addr; - ip6_sprintf(l3s, &sin6->sin6_addr); + IN6_PRINT(l3s, &sin6->sin6_addr); db_printf(" l3_addr=%s\n", l3s); break; } Index: src/sys/net/if_spppsubr.c diff -u src/sys/net/if_spppsubr.c:1.166 src/sys/net/if_spppsubr.c:1.167 --- src/sys/net/if_spppsubr.c:1.166 Mon Jan 16 02:33:36 2017 +++ src/sys/net/if_spppsubr.c Mon Jan 16 10:44:46 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: if_spppsubr.c,v 1.166 2017/01/16 07:33:36 ryo Exp $ */ +/* $NetBSD: if_spppsubr.c,v 1.167 2017/01/16 15:44:46 christos Exp $ */ /* * Synchronous PPP/Cisco link level subroutines. @@ -41,7 +41,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.166 2017/01/16 07:33:36 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.167 2017/01/16 15:44:46 christos Exp $"); #if defined(_KERNEL_OPT) #include "opt_inet.h" @@ -3691,7 +3691,7 @@ sppp_ipv6cp_RCR(struct sppp *sp, struct if (debug) { addlog(" %s [%s]", - ip6_sprintf(ip6buf, &desiredaddr), + IN6_PRINT(ip6buf, &desiredaddr), sppp_cp_type_name(type)); } continue; @@ -3713,7 +3713,7 @@ sppp_ipv6cp_RCR(struct sppp *sp, struct memcpy(&p[2], &suggestaddr.s6_addr[8], 8); } if (debug) - addlog(" %s [%s]", ip6_sprintf(ip6buf, &desiredaddr), + addlog(" %s [%s]", IN6_PRINT(ip6buf, &desiredaddr), sppp_cp_type_name(type)); break; } @@ -3740,7 +3740,7 @@ sppp_ipv6cp_RCR(struct sppp *sp, struct if (debug) { addlog(" send %s suggest %s\n", - sppp_cp_type_name(type), ip6_sprintf(ip6buf, &suggestaddr)); + sppp_cp_type_name(type), IN6_PRINT(ip6buf, &suggestaddr)); } sppp_cp_send(sp, PPP_IPV6CP, type, h->ident, rlen, buf); } @@ -3859,7 +3859,7 @@ sppp_ipv6cp_RCN_nak(struct sppp *sp, str sp->ipv6cp.opts |= (1 << IPV6CP_OPT_IFID); if (debug) addlog(" [suggestaddr %s]", - ip6_sprintf(ip6buf, &suggestaddr)); + IN6_PRINT(ip6buf, &suggestaddr)); #ifdef IPV6CP_MYIFID_DYN /* * When doing dynamic address assignment, Index: src/sys/netinet/dccp_usrreq.c diff -u src/sys/netinet/dccp_usrreq.c:1.11 src/sys/netinet/dccp_usrreq.c:1.12 --- src/sys/netinet/dccp_usrreq.c:1.11 Mon Jan 16 02:33:36 2017 +++ src/sys/netinet/dccp_usrreq.c Mon Jan 16 10:44:47 2017 @@ -1,5 +1,5 @@ /* $KAME: dccp_usrreq.c,v 1.67 2005/11/03 16:05:04 nishida Exp $ */ -/* $NetBSD: dccp_usrreq.c,v 1.11 2017/01/16 07:33:36 ryo Exp $ */ +/* $NetBSD: dccp_usrreq.c,v 1.12 2017/01/16 15:44:47 christos Exp $ */ /* * Copyright (c) 2003 Joacim Häggmark, Magnus Erixzon, Nils-Erik Mattsson @@ -67,7 +67,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: dccp_usrreq.c,v 1.11 2017/01/16 07:33:36 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dccp_usrreq.c,v 1.12 2017/01/16 15:44:47 christos Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -379,10 +379,10 @@ dccp_input(struct mbuf *m, ...) if (isipv6) { char ip6buf[INET6_ADDRSTRLEN]; strlcpy(dbuf, "[", sizeof dbuf); - strlcat(dbuf, ip6_sprintf(ip6buf, &ip6->ip6_dst), sizeof dbuf); + strlcat(dbuf, IN6_PRINT(ip6buf, &ip6->ip6_dst), sizeof dbuf); strlcat(dbuf, "]", sizeof dbuf); strlcpy(sbuf, "[", sizeof sbuf); - strlcat(sbuf, ip6_sprintf(ip6buf, &ip6->ip6_src), sizeof sbuf); + strlcat(sbuf, IN6_PRINT(ip6buf, &ip6->ip6_src), sizeof sbuf); strlcat(sbuf, "]", sizeof sbuf); } else #endif Index: src/sys/netinet/sctputil.c diff -u src/sys/netinet/sctputil.c:1.11 src/sys/netinet/sctputil.c:1.12 --- src/sys/netinet/sctputil.c:1.11 Mon Jan 16 02:33:36 2017 +++ src/sys/netinet/sctputil.c Mon Jan 16 10:44:47 2017 @@ -1,5 +1,5 @@ /* $KAME: sctputil.c,v 1.39 2005/06/16 20:54:06 jinmei Exp $ */ -/* $NetBSD: sctputil.c,v 1.11 2017/01/16 07:33:36 ryo Exp $ */ +/* $NetBSD: sctputil.c,v 1.12 2017/01/16 15:44:47 christos Exp $ */ /* * Copyright (c) 2001, 2002, 2003, 2004 Cisco Systems, Inc. @@ -34,7 +34,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: sctputil.c,v 1.11 2017/01/16 07:33:36 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sctputil.c,v 1.12 2017/01/16 15:44:47 christos Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -3054,7 +3054,7 @@ sctp_print_address(const struct sockaddr const struct sockaddr_in6 *sin6; sin6 = (const struct sockaddr_in6 *)sa; printf("IPv6 address: %s:%d scope:%u\n", - ip6_sprintf(ip6buf, &sin6->sin6_addr), ntohs(sin6->sin6_port), + IN6_PRINT(ip6buf, &sin6->sin6_addr), ntohs(sin6->sin6_port), sin6->sin6_scope_id); } else if (sa->sa_family == AF_INET) { const struct sockaddr_in *sin; Index: src/sys/netinet/ip_carp.c diff -u src/sys/netinet/ip_carp.c:1.82 src/sys/netinet/ip_carp.c:1.83 --- src/sys/netinet/ip_carp.c:1.82 Mon Jan 16 02:33:36 2017 +++ src/sys/netinet/ip_carp.c Mon Jan 16 10:44:47 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: ip_carp.c,v 1.82 2017/01/16 07:33:36 ryo Exp $ */ +/* $NetBSD: ip_carp.c,v 1.83 2017/01/16 15:44:47 christos Exp $ */ /* $OpenBSD: ip_carp.c,v 1.113 2005/11/04 08:11:54 mcbride Exp $ */ /* @@ -33,7 +33,7 @@ #endif #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ip_carp.c,v 1.82 2017/01/16 07:33:36 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ip_carp.c,v 1.83 2017/01/16 15:44:47 christos Exp $"); /* * TODO: @@ -706,7 +706,7 @@ carp_proto_input_c(struct mbuf *m, struc case AF_INET6: ip6 = mtod(m, struct ip6_hdr *); CARP_LOG(sc, ("incorrect hash from %s", - ip6_sprintf(ip6buf, &ip6->ip6_src))); + IN6_PRINT(ip6buf, &ip6->ip6_src))); break; default: CARP_LOG(sc, ("incorrect hash")); Index: src/sys/netinet/sctp_asconf.c diff -u src/sys/netinet/sctp_asconf.c:1.8 src/sys/netinet/sctp_asconf.c:1.9 --- src/sys/netinet/sctp_asconf.c:1.8 Mon Jan 16 02:33:36 2017 +++ src/sys/netinet/sctp_asconf.c Mon Jan 16 10:44:47 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: sctp_asconf.c,v 1.8 2017/01/16 07:33:36 ryo Exp $ */ +/* $NetBSD: sctp_asconf.c,v 1.9 2017/01/16 15:44:47 christos Exp $ */ /* $KAME: sctp_asconf.c,v 1.25 2005/06/16 20:44:24 jinmei Exp $ */ /* @@ -30,7 +30,7 @@ * SUCH DAMAGE. */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: sctp_asconf.c,v 1.8 2017/01/16 07:33:36 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sctp_asconf.c,v 1.9 2017/01/16 15:44:47 christos Exp $"); #ifdef _KERNEL_OPT #include "opt_ipsec.h" @@ -981,7 +981,7 @@ sctp_asconf_queue_add(struct sctp_tcb *s memcpy(&aa->ap.addrp.addr, &sin6->sin6_addr, sizeof(struct in6_addr)); #ifdef SCTP_DEBUG - strlcpy(buf, ip6_sprintf(ip6buf, &sin6->sin6_addr), sizeof(buf)); + strlcpy(buf, IN6_PRINT(ip6buf, &sin6->sin6_addr), sizeof(buf)); #endif /* SCTP_DEBUG */ } else if (ifa->ifa_addr->sa_family == AF_INET) { @@ -1672,7 +1672,7 @@ sctp_addr_mgmt_assoc(struct sctp_inpcb * sin6 = (struct sockaddr_in6 *)ifa->ifa_addr; #ifdef SCTP_DEBUG - strlcpy(buf, ip6_sprintf(ip6buf, &sin6->sin6_addr), sizeof(buf)); + strlcpy(buf, IN6_PRINT(ip6buf, &sin6->sin6_addr), sizeof(buf)); #endif /* SCTP_DEBUG */ if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { /* we skip unspecifed addresses */ Index: src/sys/netinet6/icmp6.c diff -u src/sys/netinet6/icmp6.c:1.205 src/sys/netinet6/icmp6.c:1.206 --- src/sys/netinet6/icmp6.c:1.205 Mon Jan 16 02:33:36 2017 +++ src/sys/netinet6/icmp6.c Mon Jan 16 10:44:47 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: icmp6.c,v 1.205 2017/01/16 07:33:36 ryo Exp $ */ +/* $NetBSD: icmp6.c,v 1.206 2017/01/16 15:44:47 christos Exp $ */ /* $KAME: icmp6.c,v 1.217 2001/06/20 15:03:29 jinmei Exp $ */ /* @@ -62,7 +62,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: icmp6.c,v 1.205 2017/01/16 07:33:36 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: icmp6.c,v 1.206 2017/01/16 15:44:47 christos Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -504,7 +504,7 @@ icmp6_input(struct mbuf **mp, int *offp, */ if ((sum = in6_cksum(m, IPPROTO_ICMPV6, off, icmp6len)) != 0) { nd6log(LOG_ERR, "ICMP6 checksum error(%d|%x) %s\n", - icmp6->icmp6_type, sum, ip6_sprintf(ip6buf, &ip6->ip6_src)); + icmp6->icmp6_type, sum, IN6_PRINT(ip6buf, &ip6->ip6_src)); ICMP6_STATINC(ICMP6_STAT_CHECKSUM); icmp6_ifstat_inc(rcvif, ifs6_in_error); goto freeit; @@ -864,8 +864,8 @@ icmp6_input(struct mbuf **mp, int *offp, nd6log(LOG_DEBUG, "unknown type %d(src=%s, dst=%s, ifid=%d)\n", icmp6->icmp6_type, - ip6_sprintf(ip6buf, &ip6->ip6_src), - ip6_sprintf(ip6buf2, &ip6->ip6_dst), + IN6_PRINT(ip6buf, &ip6->ip6_src), + IN6_PRINT(ip6buf2, &ip6->ip6_dst), rcvif ? rcvif->if_index : 0); if (icmp6->icmp6_type < ICMP6_ECHO_REQUEST) { /* ICMPv6 error: MUST deliver it by spec... */ @@ -2136,7 +2136,7 @@ icmp6_reflect(struct mbuf *m, size_t off nd6log(LOG_DEBUG, "source can't be determined: " "dst=%s, error=%d\n", - ip6_sprintf(ip6buf, &sin6.sin6_addr), e); + IN6_PRINT(ip6buf, &sin6.sin6_addr), e); goto bad; } } @@ -2191,8 +2191,8 @@ icmp6_redirect_diag(char *buf, size_t bu char ip6buft[INET6_ADDRSTRLEN]; snprintf(buf, buflen, "(src=%s dst=%s tgt=%s)", - ip6_sprintf(ip6bufs, src6), ip6_sprintf(ip6bufd, dst6), - ip6_sprintf(ip6buft, tgt6)); + IN6_PRINT(ip6bufs, src6), IN6_PRINT(ip6bufd, dst6), + IN6_PRINT(ip6buft, tgt6)); return buf; } @@ -2244,14 +2244,14 @@ icmp6_redirect_input(struct mbuf *m, int if (!IN6_IS_ADDR_LINKLOCAL(&src6)) { nd6log(LOG_ERR, "ICMP6 redirect sent from %s rejected; " - "must be from linklocal\n", ip6_sprintf(ip6buf, &src6)); + "must be from linklocal\n", IN6_PRINT(ip6buf, &src6)); goto bad; } if (ip6->ip6_hlim != 255) { nd6log(LOG_ERR, "ICMP6 redirect sent from %s rejected; " "hlim=%d (must be 255)\n", - ip6_sprintf(ip6buf, &src6), ip6->ip6_hlim); + IN6_PRINT(ip6buf, &src6), ip6->ip6_hlim); goto bad; } { @@ -2278,7 +2278,7 @@ icmp6_redirect_input(struct mbuf *m, int nd6log(LOG_ERR, "ICMP6 redirect rejected; " "not equal to gw-for-src=%s (must be same): %s\n", - ip6_sprintf(ip6buf, gw6), + IN6_PRINT(ip6buf, gw6), icmp6_redirect_diag(diagbuf, sizeof(diagbuf), &src6, &reddst6, &redtgt6)); rt_unref(rt); @@ -2334,7 +2334,7 @@ icmp6_redirect_input(struct mbuf *m, int if (lladdr && ((ifp->if_addrlen + 2 + 7) & ~7) != lladdrlen) { nd6log(LOG_INFO, "lladdrlen mismatch for %s " "(if %d, icmp6 packet %d): %s\n", - ip6_sprintf(ip6buf, &redtgt6), + IN6_PRINT(ip6buf, &redtgt6), ifp->if_addrlen, lladdrlen - 2, icmp6_redirect_diag(diagbuf, sizeof(diagbuf), &src6, &reddst6, &redtgt6)); Index: src/sys/netinet6/in6.c diff -u src/sys/netinet6/in6.c:1.235 src/sys/netinet6/in6.c:1.236 --- src/sys/netinet6/in6.c:1.235 Mon Jan 16 03:26:30 2017 +++ src/sys/netinet6/in6.c Mon Jan 16 10:44:47 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: in6.c,v 1.235 2017/01/16 08:26:30 ozaki-r Exp $ */ +/* $NetBSD: in6.c,v 1.236 2017/01/16 15:44:47 christos Exp $ */ /* $KAME: in6.c,v 1.198 2001/07/18 09:12:38 itojun Exp $ */ /* @@ -62,7 +62,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.235 2017/01/16 08:26:30 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.236 2017/01/16 15:44:47 christos Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -914,7 +914,7 @@ in6_update_ifa1(struct ifnet *ifp, struc * configuration mistake or a tool's bug. */ nd6log(LOG_INFO, "valid lifetime is 0 for %s\n", - ip6_sprintf(ip6buf, &ifra->ifra_addr.sin6_addr)); + IN6_PRINT(ip6buf, &ifra->ifra_addr.sin6_addr)); if (ia == NULL) return 0; /* there's nothing to do */ @@ -974,7 +974,7 @@ in6_update_ifa1(struct ifnet *ifp, struc nd6log(LOG_INFO, "the prefix length of an" " existing (%s) autoconf address should" " not be changed\n", - ip6_sprintf(ip6buf, + IN6_PRINT(ip6buf, &ia->ia_addr.sin6_addr)); error = EINVAL; if (hostIsNew) @@ -1109,7 +1109,7 @@ in6_update_ifa1(struct ifnet *ifp, struc if (!imm) { nd6log(LOG_ERR, "addmulti failed for %s on %s (errno=%d)\n", - ip6_sprintf(ip6buf, &llsol), if_name(ifp), error); + IN6_PRINT(ip6buf, &llsol), if_name(ifp), error); goto cleanup; } LIST_INSERT_HEAD(&ia->ia6_memberships, imm, i6mm_chain); @@ -1170,7 +1170,7 @@ in6_update_ifa1(struct ifnet *ifp, struc if (!imm) { nd6log(LOG_WARNING, "addmulti failed for %s on %s (errno=%d)\n", - ip6_sprintf(ip6buf, &mltaddr.sin6_addr), + IN6_PRINT(ip6buf, &mltaddr.sin6_addr), if_name(ifp), error); goto cleanup; } @@ -1194,7 +1194,7 @@ in6_update_ifa1(struct ifnet *ifp, struc dad_delay)) == NULL) { /* XXX jinmei */ nd6log(LOG_WARNING, "addmulti failed for %s on %s (errno=%d)\n", - ip6_sprintf(ip6buf, &mltaddr.sin6_addr), + IN6_PRINT(ip6buf, &mltaddr.sin6_addr), if_name(ifp), error); /* XXX not very fatal, go on... */ } else { @@ -1251,7 +1251,7 @@ in6_update_ifa1(struct ifnet *ifp, struc if (!imm) { nd6log(LOG_WARNING, "addmulti failed for %s on %s (errno=%d)\n", - ip6_sprintf(ip6buf, &mltaddr.sin6_addr), + IN6_PRINT(ip6buf, &mltaddr.sin6_addr), if_name(ifp), error); goto cleanup; } else { @@ -1873,17 +1873,6 @@ bestia(struct in6_ifaddr *best_ia, struc } /* - * Convert IP6 address to printable (loggable) representation. - * Caller has to make sure that ip6buf is at least INET6_ADDRSTRLEN long. - */ -char * -ip6_sprintf(char *ip6buf, const struct in6_addr *addr) -{ - in6_print(ip6buf, INET6_ADDRSTRLEN, addr); - return ip6buf; -} - -/* * Determine if an address is on a local network. */ int @@ -2126,7 +2115,7 @@ in6_if_link_up(struct ifnet *ifp) if (if_do_dad(ifp)) { ia->ia6_flags |= IN6_IFF_TENTATIVE; nd6log(LOG_ERR, "%s marked tentative\n", - ip6_sprintf(ip6buf, + IN6_PRINT(ip6buf, &ia->ia_addr.sin6_addr)); } else if ((ia->ia6_flags & IN6_IFF_TENTATIVE) == 0) rt_newaddrmsg(RTM_NEWADDR, ifa, 0, NULL); @@ -2216,7 +2205,7 @@ in6_if_link_down(struct ifnet *ifp) */ if (!(ia->ia6_flags & IN6_IFF_DETACHED)) { nd6log(LOG_DEBUG, "%s marked detached\n", - ip6_sprintf(ip6buf, &ia->ia_addr.sin6_addr)); + IN6_PRINT(ip6buf, &ia->ia_addr.sin6_addr)); ia->ia6_flags |= IN6_IFF_DETACHED; ia->ia6_flags &= ~(IN6_IFF_TENTATIVE | IN6_IFF_DUPLICATED); @@ -2444,7 +2433,7 @@ in6_lltable_rtcheck(struct ifnet *ifp, } pserialize_read_exit(s); log(LOG_INFO, "IPv6 address: \"%s\" is not on the network\n", - ip6_sprintf(ip6buf, + IN6_PRINT(ip6buf, &((const struct sockaddr_in6 *)l3addr)->sin6_addr)); if (rt != NULL) rt_unref(rt); Index: src/sys/netinet6/in6_gif.c diff -u src/sys/netinet6/in6_gif.c:1.84 src/sys/netinet6/in6_gif.c:1.85 --- src/sys/netinet6/in6_gif.c:1.84 Mon Jan 16 02:33:36 2017 +++ src/sys/netinet6/in6_gif.c Mon Jan 16 10:44:47 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: in6_gif.c,v 1.84 2017/01/16 07:33:36 ryo Exp $ */ +/* $NetBSD: in6_gif.c,v 1.85 2017/01/16 15:44:47 christos Exp $ */ /* $KAME: in6_gif.c,v 1.62 2001/07/29 04:27:25 itojun Exp $ */ /* @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: in6_gif.c,v 1.84 2017/01/16 07:33:36 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: in6_gif.c,v 1.85 2017/01/16 15:44:47 christos Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -330,7 +330,7 @@ gif_validate6(const struct ip6_hdr *ip6, char ip6buf[INET6_ADDRSTRLEN]; log(LOG_WARNING, "%s: packet from %s dropped " "due to ingress filter\n", if_name(&sc->gif_if), - ip6_sprintf(ip6buf, &u.sin6.sin6_addr)); + IN6_PRINT(ip6buf, &u.sin6.sin6_addr)); #endif if (rt != NULL) rt_unref(rt); Index: src/sys/netinet6/ip6_forward.c diff -u src/sys/netinet6/ip6_forward.c:1.84 src/sys/netinet6/ip6_forward.c:1.85 --- src/sys/netinet6/ip6_forward.c:1.84 Mon Jan 16 02:33:36 2017 +++ src/sys/netinet6/ip6_forward.c Mon Jan 16 10:44:47 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: ip6_forward.c,v 1.84 2017/01/16 07:33:36 ryo Exp $ */ +/* $NetBSD: ip6_forward.c,v 1.85 2017/01/16 15:44:47 christos Exp $ */ /* $KAME: ip6_forward.c,v 1.109 2002/09/11 08:10:17 sakane Exp $ */ /* @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ip6_forward.c,v 1.84 2017/01/16 07:33:36 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ip6_forward.c,v 1.85 2017/01/16 15:44:47 christos Exp $"); #ifdef _KERNEL_OPT #include "opt_gateway.h" @@ -373,8 +373,8 @@ ip6_forward(struct mbuf *m, int srcrt) printf("ip6_forward: outgoing interface is loopback. " "src %s, dst %s, nxt %d, rcvif %s, outif %s\n", - ip6_sprintf(ip6bufs, &ip6->ip6_src), - ip6_sprintf(ip6bufd, &ip6->ip6_dst), + IN6_PRINT(ip6bufs, &ip6->ip6_src), + IN6_PRINT(ip6bufd, &ip6->ip6_dst), ip6->ip6_nxt, if_name(rcvif), if_name(rt->rt_ifp)); } Index: src/sys/netinet6/in6_src.c diff -u src/sys/netinet6/in6_src.c:1.77 src/sys/netinet6/in6_src.c:1.78 --- src/sys/netinet6/in6_src.c:1.77 Mon Jan 16 02:33:36 2017 +++ src/sys/netinet6/in6_src.c Mon Jan 16 10:44:47 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: in6_src.c,v 1.77 2017/01/16 07:33:36 ryo Exp $ */ +/* $NetBSD: in6_src.c,v 1.78 2017/01/16 15:44:47 christos Exp $ */ /* $KAME: in6_src.c,v 1.159 2005/10/19 01:40:32 t-momose Exp $ */ /* @@ -66,7 +66,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: in6_src.c,v 1.77 2017/01/16 07:33:36 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: in6_src.c,v 1.78 2017/01/16 15:44:47 christos Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -141,27 +141,32 @@ static struct in6_addrpolicy *match_addr * If necessary, this function lookups the routing table and returns * an entry to the caller for later use. */ -#if 0 /* diabled ad-hoc */ +#if 0 /* disabled ad-hoc */ #define REPLACE(r) do {\ + char _buf1[INET6_ADDRSTRLEN], _buf2[INET6_ADDRSTRLEN]; \ if ((r) < sizeof(ip6stat.ip6s_sources_rule) / \ sizeof(ip6stat.ip6s_sources_rule[0])) /* check for safety */ \ ip6stat.ip6s_sources_rule[(r)]++; \ - /* printf("in6_selectsrc: replace %s with %s by %d\n", ia_best ? ip6_sprintf(&ia_best->ia_addr.sin6_addr) : "none", ip6_sprintf(&ia->ia_addr.sin6_addr), (r)); */ \ + printf("%s: replace %s with %s by %d\n", __func__, ia_best ? \ + IN6_PRINT(_buf1, &ia_best->ia_addr.sin6_addr) : "none", \ + IN6_PRINT(_buf2, &ia->ia_addr.sin6_addr), (r)); \ goto replace; \ -} while(0) +} while(/*CONSTCOND*/0) #define NEXT(r) do {\ if ((r) < sizeof(ip6stat.ip6s_sources_rule) / \ sizeof(ip6stat.ip6s_sources_rule[0])) /* check for safety */ \ ip6stat.ip6s_sources_rule[(r)]++; \ - /* printf("in6_selectsrc: keep %s against %s by %d\n", ia_best ? ip6_sprintf(&ia_best->ia_addr.sin6_addr) : "none", ip6_sprintf(&ia->ia_addr.sin6_addr), (r)); */ \ + printf("%s: keep %s against %s by %d\n", ia_best ? \ + IN6_PRINT(_buf1, &ia_best->ia_addr.sin6_addr) : "none", \ + IN6_PRINT(_buf2, &ia->ia_addr.sin6_addr), (r)); \ goto next; /* XXX: we can't use 'continue' here */ \ -} while(0) +} while(/*CONSTCOND*/0) #define BREAK(r) do { \ if ((r) < sizeof(ip6stat.ip6s_sources_rule) / \ sizeof(ip6stat.ip6s_sources_rule[0])) /* check for safety */ \ ip6stat.ip6s_sources_rule[(r)]++; \ goto out; /* XXX: we can't use 'break' here */ \ -} while(0) +} while(/*CONSTCOND*/0) #else #define REPLACE(r) goto replace #define NEXT(r) goto next @@ -608,11 +613,11 @@ in6_selectroute(struct sockaddr_in6 *dst !IN6_IS_ADDR_LOOPBACK(&dstsock->sin6_addr)) { char ip6buf[INET6_ADDRSTRLEN]; printf("in6_selectroute: strange destination %s\n", - ip6_sprintf(ip6buf, &dstsock->sin6_addr)); + IN6_PRINT(ip6buf, &dstsock->sin6_addr)); } else { char ip6buf[INET6_ADDRSTRLEN]; printf("in6_selectroute: destination = %s%%%d\n", - ip6_sprintf(ip6buf, &dstsock->sin6_addr), + IN6_PRINT(ip6buf, &dstsock->sin6_addr), dstsock->sin6_scope_id); /* for debug */ } #endif Index: src/sys/netinet6/in6_var.h diff -u src/sys/netinet6/in6_var.h:1.90 src/sys/netinet6/in6_var.h:1.91 --- src/sys/netinet6/in6_var.h:1.90 Mon Jan 16 02:33:36 2017 +++ src/sys/netinet6/in6_var.h Mon Jan 16 10:44:47 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: in6_var.h,v 1.90 2017/01/16 07:33:36 ryo Exp $ */ +/* $NetBSD: in6_var.h,v 1.91 2017/01/16 15:44:47 christos Exp $ */ /* $KAME: in6_var.h,v 1.81 2002/06/08 11:16:51 itojun Exp $ */ /* @@ -806,7 +806,6 @@ struct in6_ifaddr * in6ifa_ifpwithaddr_psref(const struct ifnet *, const struct in6_addr *, struct psref *); struct in6_ifaddr *in6ifa_ifwithaddr(const struct in6_addr *, uint32_t); -char *ip6_sprintf(char *, const struct in6_addr *); int in6_matchlen(struct in6_addr *, struct in6_addr *); int in6_are_prefix_equal(struct in6_addr *, struct in6_addr *, int); void in6_prefixlen2mask(struct in6_addr *, int); Index: src/sys/netinet6/ip6_input.c diff -u src/sys/netinet6/ip6_input.c:1.172 src/sys/netinet6/ip6_input.c:1.173 --- src/sys/netinet6/ip6_input.c:1.172 Mon Jan 16 02:33:36 2017 +++ src/sys/netinet6/ip6_input.c Mon Jan 16 10:44:47 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: ip6_input.c,v 1.172 2017/01/16 07:33:36 ryo Exp $ */ +/* $NetBSD: ip6_input.c,v 1.173 2017/01/16 15:44:47 christos Exp $ */ /* $KAME: ip6_input.c,v 1.188 2001/03/29 05:34:31 itojun Exp $ */ /* @@ -62,7 +62,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ip6_input.c,v 1.172 2017/01/16 07:33:36 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ip6_input.c,v 1.173 2017/01/16 15:44:47 christos Exp $"); #ifdef _KERNEL_OPT #include "opt_gateway.h" @@ -531,8 +531,8 @@ ip6_input(struct mbuf *m, struct ifnet * char ip6bufs[INET6_ADDRSTRLEN]; char ip6bufd[INET6_ADDRSTRLEN]; nd6log(LOG_INFO, "packet to an unready address %s->%s\n", - ip6_sprintf(ip6bufs, &ip6->ip6_src), - ip6_sprintf(ip6bufd, &ip6->ip6_dst)); + IN6_PRINT(ip6bufs, &ip6->ip6_src), + IN6_PRINT(ip6bufd, &ip6->ip6_dst)); goto bad_unref; } Index: src/sys/netinet6/ip6_mroute.c diff -u src/sys/netinet6/ip6_mroute.c:1.114 src/sys/netinet6/ip6_mroute.c:1.115 --- src/sys/netinet6/ip6_mroute.c:1.114 Mon Jan 16 02:33:36 2017 +++ src/sys/netinet6/ip6_mroute.c Mon Jan 16 10:44:47 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: ip6_mroute.c,v 1.114 2017/01/16 07:33:36 ryo Exp $ */ +/* $NetBSD: ip6_mroute.c,v 1.115 2017/01/16 15:44:47 christos Exp $ */ /* $KAME: ip6_mroute.c,v 1.49 2001/07/25 09:21:18 jinmei Exp $ */ /* @@ -117,7 +117,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ip6_mroute.c,v 1.114 2017/01/16 07:33:36 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ip6_mroute.c,v 1.115 2017/01/16 15:44:47 christos Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -800,9 +800,9 @@ add_m6fc(struct mf6cctl *mfccp) #ifdef MRT6DEBUG if (mrt6debug & DEBUG_MFC) log(LOG_DEBUG,"add_m6fc update o %s g %s p %x\n", - ip6_sprintf(ip6bufo, + IN6_PRINT(ip6bufo, &mfccp->mf6cc_origin.sin6_addr), - ip6_sprintf(ip6bufm, + IN6_PRINT(ip6bufm, &mfccp->mf6cc_mcastgrp.sin6_addr), mfccp->mf6cc_parent); #endif @@ -831,9 +831,9 @@ add_m6fc(struct mf6cctl *mfccp) log(LOG_ERR, "add_m6fc: %s o %s g %s p %x dbx %p\n", "multiple kernel entries", - ip6_sprintf(ip6bufo, + IN6_PRINT(ip6bufo, &mfccp->mf6cc_origin.sin6_addr), - ip6_sprintf(ip6bufm, + IN6_PRINT(ip6bufm, &mfccp->mf6cc_mcastgrp.sin6_addr), mfccp->mf6cc_parent, rt->mf6c_stall); @@ -841,9 +841,9 @@ add_m6fc(struct mf6cctl *mfccp) if (mrt6debug & DEBUG_MFC) log(LOG_DEBUG, "add_m6fc o %s g %s p %x dbg %p\n", - ip6_sprintf(ip6bufo, + IN6_PRINT(ip6bufo, &mfccp->mf6cc_origin.sin6_addr), - ip6_sprintf(ip6bufm, + IN6_PRINT(ip6bufm, &mfccp->mf6cc_mcastgrp.sin6_addr), mfccp->mf6cc_parent, rt->mf6c_stall); #endif @@ -886,9 +886,9 @@ add_m6fc(struct mf6cctl *mfccp) log(LOG_DEBUG, "add_mfc no upcall h %ld o %s g %s p %x\n", hash, - ip6_sprintf(ip6bufo, + IN6_PRINT(ip6bufo, &mfccp->mf6cc_origin.sin6_addr), - ip6_sprintf(ip6bufm, + IN6_PRINT(ip6bufm, &mfccp->mf6cc_mcastgrp.sin6_addr), mfccp->mf6cc_parent); #endif @@ -991,8 +991,8 @@ del_m6fc(struct mf6cctl *mfccp) if (mrt6debug & DEBUG_MFC) { char ip6bufo[INET6_ADDRSTRLEN], ip6bufm[INET6_ADDRSTRLEN]; log(LOG_DEBUG,"del_m6fc orig %s mcastgrp %s\n", - ip6_sprintf(ip6bufo, &origin.sin6_addr), - ip6_sprintf(ip6bufm, &mcastgrp.sin6_addr)); + IN6_PRINT(ip6bufo, &origin.sin6_addr), + IN6_PRINT(ip6bufm, &mcastgrp.sin6_addr)); } #endif @@ -1060,8 +1060,8 @@ ip6_mforward(struct ip6_hdr *ip6, struct #ifdef MRT6DEBUG if (mrt6debug & DEBUG_FORWARD) log(LOG_DEBUG, "ip6_mforward: src %s, dst %s, ifindex %d\n", - ip6_sprintf(ip6bufs, &ip6->ip6_src), - ip6_sprintf(ip6bufd, &ip6->ip6_dst), + IN6_PRINT(ip6bufs, &ip6->ip6_src), + IN6_PRINT(ip6bufd, &ip6->ip6_dst), ifp->if_index); #endif @@ -1088,8 +1088,8 @@ ip6_mforward(struct ip6_hdr *ip6, struct log(LOG_DEBUG, "cannot forward " "from %s to %s nxt %d received on %s\n", - ip6_sprintf(ip6bufs, &ip6->ip6_src), - ip6_sprintf(ip6bufd, &ip6->ip6_dst), + IN6_PRINT(ip6bufs, &ip6->ip6_src), + IN6_PRINT(ip6bufd, &ip6->ip6_dst), ip6->ip6_nxt, m->m_pkthdr.rcvif_index ? if_name(m_get_rcvif_NOMPSAFE(m)) : "?"); @@ -1128,8 +1128,8 @@ ip6_mforward(struct ip6_hdr *ip6, struct #ifdef MRT6DEBUG if (mrt6debug & (DEBUG_FORWARD | DEBUG_MFC)) log(LOG_DEBUG, "ip6_mforward: no rte s %s g %s\n", - ip6_sprintf(ip6bufs, &ip6->ip6_src), - ip6_sprintf(ip6bufd, &ip6->ip6_dst)); + IN6_PRINT(ip6bufs, &ip6->ip6_src), + IN6_PRINT(ip6bufd, &ip6->ip6_dst)); #endif /* @@ -1333,9 +1333,9 @@ expire_upcalls(void *unused) char ip6bufm[INET6_ADDRSTRLEN]; log(LOG_DEBUG, "expire_upcalls: expiring (%s %s)\n", - ip6_sprintf(ip6bufo, + IN6_PRINT(ip6bufo, &mfc->mf6c_origin.sin6_addr), - ip6_sprintf(ip6bufm, + IN6_PRINT(ip6bufm, &mfc->mf6c_mcastgrp.sin6_addr)); } #endif @@ -1647,8 +1647,8 @@ phyint_send(struct ip6_hdr *ip6, struct "phyint_send: packet too big on %s o %s g %s" " size %d(discarded)\n", if_name(ifp), - ip6_sprintf(ip6bufs, &ip6->ip6_src), - ip6_sprintf(ip6bufd, &ip6->ip6_dst), + IN6_PRINT(ip6bufs, &ip6->ip6_src), + IN6_PRINT(ip6bufd, &ip6->ip6_dst), mb_copy->m_pkthdr.len); } #endif /* MRT6DEBUG */ @@ -1671,8 +1671,8 @@ register_send(struct ip6_hdr *ip6, struc if (mrt6debug) { char ip6bufs[INET6_ADDRSTRLEN], ip6bufd[INET6_ADDRSTRLEN]; log(LOG_DEBUG, "** IPv6 register_send **\n src %s dst %s\n", - ip6_sprintf(ip6bufs, &ip6->ip6_src), - ip6_sprintf(ip6bufd, &ip6->ip6_dst)); + IN6_PRINT(ip6bufs, &ip6->ip6_src), + IN6_PRINT(ip6bufd, &ip6->ip6_dst)); } #endif PIM6_STATINC(PIM6_STAT_SND_REGISTERS); @@ -1859,7 +1859,7 @@ pim6_input(struct mbuf **mp, int *offp, log(LOG_ERR, "pim6_input: register packet size too " "small %d from %s\n", - pimlen, ip6_sprintf(ip6buf, &ip6->ip6_src)); + pimlen, IN6_PRINT(ip6buf, &ip6->ip6_src)); #endif PIM6_STATINC(PIM6_STAT_RCV_TOOSHORT); PIM6_STATINC(PIM6_STAT_RCV_BADREGISTERS); @@ -1875,8 +1875,8 @@ pim6_input(struct mbuf **mp, int *offp, log(LOG_DEBUG, "pim6_input[register], eip6: %s -> %s, " "eip6 plen %d\n", - ip6_sprintf(ip6bufs, &eip6->ip6_src), - ip6_sprintf(ip6bufd, &eip6->ip6_dst), + IN6_PRINT(ip6bufs, &eip6->ip6_src), + IN6_PRINT(ip6bufd, &eip6->ip6_dst), ntohs(eip6->ip6_plen)); } #endif @@ -1902,7 +1902,7 @@ pim6_input(struct mbuf **mp, int *offp, log(LOG_DEBUG, "pim6_input: inner packet of register " "is not multicast %s\n", - ip6_sprintf(ip6buf, &eip6->ip6_dst)); + IN6_PRINT(ip6buf, &eip6->ip6_dst)); } #endif m_freem(m); @@ -1934,8 +1934,8 @@ pim6_input(struct mbuf **mp, int *offp, log(LOG_DEBUG, "pim6_input: forwarding decapsulated register: " "src %s, dst %s, mif %d\n", - ip6_sprintf(ip6bufs, &eip6->ip6_src), - ip6_sprintf(ip6bufd, &eip6->ip6_dst), + IN6_PRINT(ip6bufs, &eip6->ip6_src), + IN6_PRINT(ip6bufd, &eip6->ip6_dst), reg_mif_num); } #endif Index: src/sys/netinet6/ip6_output.c diff -u src/sys/netinet6/ip6_output.c:1.181 src/sys/netinet6/ip6_output.c:1.182 --- src/sys/netinet6/ip6_output.c:1.181 Mon Jan 16 02:33:36 2017 +++ src/sys/netinet6/ip6_output.c Mon Jan 16 10:44:47 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: ip6_output.c,v 1.181 2017/01/16 07:33:36 ryo Exp $ */ +/* $NetBSD: ip6_output.c,v 1.182 2017/01/16 15:44:47 christos Exp $ */ /* $KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $ */ /* @@ -62,7 +62,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ip6_output.c,v 1.181 2017/01/16 07:33:36 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ip6_output.c,v 1.182 2017/01/16 15:44:47 christos Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -584,7 +584,7 @@ ip6_output( char ip6buf[INET6_ADDRSTRLEN]; nd6log(LOG_ERR, "refusing to send from invalid address %s (pid %d)\n", - ip6_sprintf(ip6buf, &src0), curproc->p_pid); + IN6_PRINT(ip6buf, &src0), curproc->p_pid); IP6_STATINC(IP6_STAT_ODROPPED); in6_ifstat_inc(origifp, ifs6_out_discard); if (error == 1) Index: src/sys/netinet6/mld6.c diff -u src/sys/netinet6/mld6.c:1.78 src/sys/netinet6/mld6.c:1.79 --- src/sys/netinet6/mld6.c:1.78 Mon Jan 16 02:33:36 2017 +++ src/sys/netinet6/mld6.c Mon Jan 16 10:44:47 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: mld6.c,v 1.78 2017/01/16 07:33:36 ryo Exp $ */ +/* $NetBSD: mld6.c,v 1.79 2017/01/16 15:44:47 christos Exp $ */ /* $KAME: mld6.c,v 1.25 2001/01/16 14:14:18 itojun Exp $ */ /* @@ -102,7 +102,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: mld6.c,v 1.78 2017/01/16 07:33:36 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mld6.c,v 1.79 2017/01/16 15:44:47 christos Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -377,8 +377,8 @@ mld_input(struct mbuf *m, int off) char ip6bufm[INET6_ADDRSTRLEN]; log(LOG_INFO, "mld_input: src %s is not link-local (grp=%s)\n", - ip6_sprintf(ip6bufs,&ip6->ip6_src), - ip6_sprintf(ip6bufm, &mldh->mld_addr)); + IN6_PRINT(ip6bufs,&ip6->ip6_src), + IN6_PRINT(ip6bufm, &mldh->mld_addr)); #endif goto out; } Index: src/sys/netinet6/nd6.c diff -u src/sys/netinet6/nd6.c:1.225 src/sys/netinet6/nd6.c:1.226 --- src/sys/netinet6/nd6.c:1.225 Mon Jan 16 02:33:36 2017 +++ src/sys/netinet6/nd6.c Mon Jan 16 10:44:47 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: nd6.c,v 1.225 2017/01/16 07:33:36 ryo Exp $ */ +/* $NetBSD: nd6.c,v 1.226 2017/01/16 15:44:47 christos Exp $ */ /* $KAME: nd6.c,v 1.279 2002/06/08 11:16:51 itojun Exp $ */ /* @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.225 2017/01/16 07:33:36 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.226 2017/01/16 15:44:47 christos Exp $"); #ifdef _KERNEL_OPT #include "opt_net_mpsafe.h" @@ -926,13 +926,13 @@ nd6_assert_purged(struct ifnet *ifp) ND_DEFROUTER_LIST_FOREACH(dr) { KASSERTMSG(dr->ifp != ifp, "defrouter %s remains on %s", - ip6_sprintf(ip6buf, &dr->rtaddr), ifp->if_xname); + IN6_PRINT(ip6buf, &dr->rtaddr), ifp->if_xname); } ND_PREFIX_LIST_FOREACH(pr) { KASSERTMSG(pr->ndpr_ifp != ifp, "prefix %s/%d remains on %s", - ip6_sprintf(ip6buf, &pr->ndpr_prefix.sin6_addr), + IN6_PRINT(ip6buf, &pr->ndpr_prefix.sin6_addr), pr->ndpr_plen, ifp->if_xname); } ND6_UNLOCK(); @@ -1594,7 +1594,7 @@ nd6_rtrequest(int req, struct rtentry *r char ip6buf[INET6_ADDRSTRLEN]; nd6log(LOG_ERR, "%s: failed to join " "%s (errno=%d)\n", if_name(ifp), - ip6_sprintf(ip6buf, &llsol), error); + IN6_PRINT(ip6buf, &llsol), error); } } } @@ -2347,7 +2347,7 @@ nd6_output(struct ifnet *ifp, struct ifn log(LOG_DEBUG, "nd6_output: can't allocate llinfo for %s " "(ln=%p, rt=%p)\n", - ip6_sprintf(ip6buf, &dst->sin6_addr), ln, rt); + IN6_PRINT(ip6buf, &dst->sin6_addr), ln, rt); senderr(EIO); /* XXX: good error? */ } goto sendpkt; /* send anyway */ @@ -2696,7 +2696,7 @@ fill_drlist(void *oldp, size_t *oldlenp, char ip6buf[INET6_ADDRSTRLEN]; log(LOG_ERR, "scope error in router list (%s)\n", - ip6_sprintf(ip6buf, &d->rtaddr.sin6_addr)); + IN6_PRINT(ip6buf, &d->rtaddr.sin6_addr)); /* XXX: press on... */ } d->flags = dr->flags; @@ -2754,7 +2754,7 @@ fill_prlist(void *oldp, size_t *oldlenp, if (sa6_recoverscope(&pfx.prefix)) { log(LOG_ERR, "scope error in prefix list (%s)\n", - ip6_sprintf(ip6buf, &pfx.prefix.sin6_addr)); + IN6_PRINT(ip6buf, &pfx.prefix.sin6_addr)); /* XXX: press on... */ } pfx.raflags = pr->ndpr_raf; @@ -2797,7 +2797,7 @@ fill_prlist(void *oldp, size_t *oldlenp, log(LOG_ERR, "scope error in " "prefix list (%s)\n", - ip6_sprintf(ip6buf, + IN6_PRINT(ip6buf, &pfr->router->rtaddr)); } advrtrs++; Index: src/sys/netinet6/nd6_nbr.c diff -u src/sys/netinet6/nd6_nbr.c:1.135 src/sys/netinet6/nd6_nbr.c:1.136 --- src/sys/netinet6/nd6_nbr.c:1.135 Mon Jan 16 02:33:36 2017 +++ src/sys/netinet6/nd6_nbr.c Mon Jan 16 10:44:47 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: nd6_nbr.c,v 1.135 2017/01/16 07:33:36 ryo Exp $ */ +/* $NetBSD: nd6_nbr.c,v 1.136 2017/01/16 15:44:47 christos Exp $ */ /* $KAME: nd6_nbr.c,v 1.61 2001/02/10 16:06:14 jinmei Exp $ */ /* @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: nd6_nbr.c,v 1.135 2017/01/16 07:33:36 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: nd6_nbr.c,v 1.136 2017/01/16 15:44:47 christos Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -134,8 +134,8 @@ nd6_ns_input(struct mbuf *m, int off, in if (ip6->ip6_hlim != 255) { nd6log(LOG_ERR, "invalid hlim (%d) from %s to %s on %s\n", - ip6->ip6_hlim, ip6_sprintf(ip6buf, &ip6->ip6_src), - ip6_sprintf(ip6buf2, &ip6->ip6_dst), if_name(ifp)); + ip6->ip6_hlim, IN6_PRINT(ip6buf, &ip6->ip6_src), + IN6_PRINT(ip6buf2, &ip6->ip6_dst), if_name(ifp)); goto bad; } @@ -161,7 +161,7 @@ nd6_ns_input(struct mbuf *m, int off, in if (nd6_is_addr_neighbor(&ssin6, ifp) == 0) { nd6log(LOG_INFO, "NS packet from non-neighbor %s on %s\n", - ip6_sprintf(ip6buf, &saddr6), if_name(ifp)); + IN6_PRINT(ip6buf, &saddr6), if_name(ifp)); goto bad; } } @@ -277,14 +277,14 @@ nd6_ns_input(struct mbuf *m, int off, in if (lladdr && ((ifp->if_addrlen + 2 + 7) & ~7) != lladdrlen) { nd6log(LOG_INFO, "lladdrlen mismatch for %s " "(if %d, NS packet %d)\n", - ip6_sprintf(ip6buf, &taddr6), + IN6_PRINT(ip6buf, &taddr6), ifp->if_addrlen, lladdrlen - 2); goto bad; } if (IN6_ARE_ADDR_EQUAL(&myaddr6, &saddr6)) { nd6log(LOG_INFO, "duplicate IP6 address %s\n", - ip6_sprintf(ip6buf, &saddr6)); + IN6_PRINT(ip6buf, &saddr6)); goto freeit; } @@ -352,9 +352,9 @@ nd6_ns_input(struct mbuf *m, int off, in return; bad: - nd6log(LOG_ERR, "src=%s\n", ip6_sprintf(ip6buf, &saddr6)); - nd6log(LOG_ERR, "dst=%s\n", ip6_sprintf(ip6buf, &daddr6)); - nd6log(LOG_ERR, "tgt=%s\n", ip6_sprintf(ip6buf, &taddr6)); + nd6log(LOG_ERR, "src=%s\n", IN6_PRINT(ip6buf, &saddr6)); + nd6log(LOG_ERR, "dst=%s\n", IN6_PRINT(ip6buf, &daddr6)); + nd6log(LOG_ERR, "tgt=%s\n", IN6_PRINT(ip6buf, &taddr6)); ICMP6_STATINC(ICMP6_STAT_BADNS); ifa_release(ifa, &psref_ia); m_put_rcvif_psref(ifp, &psref); @@ -478,7 +478,7 @@ nd6_ns_output(struct ifnet *ifp, const s char ip6buf[INET6_ADDRSTRLEN]; nd6log(LOG_DEBUG, "source can't be " "determined: dst=%s, error=%d\n", - ip6_sprintf(ip6buf, &dst_sa.sin6_addr), + IN6_PRINT(ip6buf, &dst_sa.sin6_addr), error); pserialize_read_exit(s); goto bad; @@ -593,8 +593,8 @@ nd6_na_input(struct mbuf *m, int off, in if (ip6->ip6_hlim != 255) { nd6log(LOG_ERR, "invalid hlim (%d) from %s to %s on %s\n", - ip6->ip6_hlim, ip6_sprintf(ip6buf, &ip6->ip6_src), - ip6_sprintf(ip6buf2, &ip6->ip6_dst), if_name(ifp)); + ip6->ip6_hlim, IN6_PRINT(ip6buf, &ip6->ip6_src), + IN6_PRINT(ip6buf2, &ip6->ip6_dst), if_name(ifp)); goto bad; } @@ -618,7 +618,7 @@ nd6_na_input(struct mbuf *m, int off, in if (IN6_IS_ADDR_MULTICAST(&taddr6)) { nd6log(LOG_ERR, "invalid target address %s\n", - ip6_sprintf(ip6buf, &taddr6)); + IN6_PRINT(ip6buf, &taddr6)); goto bad; } if (is_solicited && IN6_IS_ADDR_MULTICAST(&daddr6)) { @@ -662,7 +662,7 @@ nd6_na_input(struct mbuf *m, int off, in if (ifa) { log(LOG_ERR, "nd6_na_input: duplicate IP6 address %s\n", - ip6_sprintf(ip6buf, &taddr6)); + IN6_PRINT(ip6buf, &taddr6)); ifa_release(ifa, &psref_ia); ifa = NULL; goto freeit; @@ -674,13 +674,13 @@ nd6_na_input(struct mbuf *m, int off, in sockaddr_in6_init(&ssin6, &saddr6, 0, 0, 0); if (nd6_is_addr_neighbor(&ssin6, ifp) == 0) { nd6log(LOG_INFO, "ND packet from non-neighbor %s on %s\n", - ip6_sprintf(ip6buf, &saddr6), if_name(ifp)); + IN6_PRINT(ip6buf, &saddr6), if_name(ifp)); goto bad; } if (lladdr && ((ifp->if_addrlen + 2 + 7) & ~7) != lladdrlen) { nd6log(LOG_INFO, "lladdrlen mismatch for %s " - "(if %d, NA packet %d)\n", ip6_sprintf(ip6buf, &taddr6), + "(if %d, NA packet %d)\n", IN6_PRINT(ip6buf, &taddr6), ifp->if_addrlen, lladdrlen - 2); goto bad; } @@ -976,7 +976,7 @@ nd6_na_output( char ip6buf[INET6_ADDRSTRLEN]; nd6log(LOG_DEBUG, "source can't be " "determined: dst=%s, error=%d\n", - ip6_sprintf(ip6buf, &satocsin6(dst)->sin6_addr), error); + IN6_PRINT(ip6buf, &satocsin6(dst)->sin6_addr), error); goto bad; } nd_na = (struct nd_neighbor_advert *)(ip6 + 1); @@ -1141,7 +1141,7 @@ nd6_dad_start(struct ifaddr *ifa, int xt log(LOG_DEBUG, "nd6_dad_start: called with non-tentative address " "%s(%s)\n", - ip6_sprintf(ip6buf, &ia->ia_addr.sin6_addr), + IN6_PRINT(ip6buf, &ia->ia_addr.sin6_addr), ifa->ifa_ifp ? if_name(ifa->ifa_ifp) : "???"); return; } @@ -1166,7 +1166,7 @@ nd6_dad_start(struct ifaddr *ifa, int xt mutex_exit(&nd6_dad_lock); log(LOG_ERR, "nd6_dad_start: memory allocation failed for " "%s(%s)\n", - ip6_sprintf(ip6buf, &ia->ia_addr.sin6_addr), + IN6_PRINT(ip6buf, &ia->ia_addr.sin6_addr), ifa->ifa_ifp ? if_name(ifa->ifa_ifp) : "???"); return; } @@ -1187,7 +1187,7 @@ nd6_dad_start(struct ifaddr *ifa, int xt TAILQ_INSERT_TAIL(&dadq, (struct dadq *)dp, dad_list); nd6log(LOG_DEBUG, "%s: starting DAD for %s\n", if_name(ifa->ifa_ifp), - ip6_sprintf(ip6buf, &ia->ia_addr.sin6_addr)); + IN6_PRINT(ip6buf, &ia->ia_addr.sin6_addr)); if (xtick == 0) { nd6_dad_ns_output(dp, ifa); @@ -1255,14 +1255,14 @@ nd6_dad_timer(struct ifaddr *ifa) if (ia->ia6_flags & IN6_IFF_DUPLICATED) { log(LOG_ERR, "nd6_dad_timer: called with duplicate address " "%s(%s)\n", - ip6_sprintf(ip6buf, &ia->ia_addr.sin6_addr), + IN6_PRINT(ip6buf, &ia->ia_addr.sin6_addr), ifa->ifa_ifp ? if_name(ifa->ifa_ifp) : "???"); goto done; } if ((ia->ia6_flags & IN6_IFF_TENTATIVE) == 0) { log(LOG_ERR, "nd6_dad_timer: called with non-tentative address " "%s(%s)\n", - ip6_sprintf(ip6buf, &ia->ia_addr.sin6_addr), + IN6_PRINT(ip6buf, &ia->ia_addr.sin6_addr), ifa->ifa_ifp ? if_name(ifa->ifa_ifp) : "???"); goto done; } @@ -1319,7 +1319,7 @@ nd6_dad_timer(struct ifaddr *ifa) nd6log(LOG_DEBUG, "%s: DAD complete for %s - no duplicates found\n", if_name(ifa->ifa_ifp), - ip6_sprintf(ip6buf, &ia->ia_addr.sin6_addr)); + IN6_PRINT(ip6buf, &ia->ia_addr.sin6_addr)); TAILQ_REMOVE(&dadq, dp, dad_list); free(dp, M_IP6NDP); @@ -1359,7 +1359,7 @@ nd6_dad_duplicated(struct ifaddr *ifa) ifp = ifa->ifa_ifp; log(LOG_ERR, "%s: DAD detected duplicate IPv6 address %s: " "NS in/out=%d/%d, NA in=%d\n", - if_name(ifp), ip6_sprintf(ip6buf, &ia->ia_addr.sin6_addr), + if_name(ifp), IN6_PRINT(ip6buf, &ia->ia_addr.sin6_addr), dp->dad_ns_icount, dp->dad_ns_ocount, dp->dad_na_icount); ia->ia6_flags &= ~IN6_IFF_TENTATIVE; @@ -1369,7 +1369,7 @@ nd6_dad_duplicated(struct ifaddr *ifa) nd6_dad_stoptimer(dp); log(LOG_ERR, "%s: DAD complete for %s - duplicate found\n", - if_name(ifp), ip6_sprintf(ip6buf, &ia->ia_addr.sin6_addr)); + if_name(ifp), IN6_PRINT(ip6buf, &ia->ia_addr.sin6_addr)); log(LOG_ERR, "%s: manual intervention required\n", if_name(ifp)); @@ -1465,7 +1465,7 @@ nd6_dad_ns_input(struct ifaddr *ifa) if (dad_ignore_ns) { char ip6buf[INET6_ADDRSTRLEN]; nd6log(LOG_INFO, "ignoring DAD NS packet for " - "address %s(%s)\n", ip6_sprintf(ip6buf, taddr6), + "address %s(%s)\n", IN6_PRINT(ip6buf, taddr6), if_name(ifa->ifa_ifp)); return; } Index: src/sys/netinet6/nd6_rtr.c diff -u src/sys/netinet6/nd6_rtr.c:1.130 src/sys/netinet6/nd6_rtr.c:1.131 --- src/sys/netinet6/nd6_rtr.c:1.130 Mon Jan 16 02:33:36 2017 +++ src/sys/netinet6/nd6_rtr.c Mon Jan 16 10:44:47 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: nd6_rtr.c,v 1.130 2017/01/16 07:33:36 ryo Exp $ */ +/* $NetBSD: nd6_rtr.c,v 1.131 2017/01/16 15:44:47 christos Exp $ */ /* $KAME: nd6_rtr.c,v 1.95 2001/02/07 08:09:47 itojun Exp $ */ /* @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: nd6_rtr.c,v 1.130 2017/01/16 07:33:36 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: nd6_rtr.c,v 1.131 2017/01/16 15:44:47 christos Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -160,8 +160,8 @@ nd6_rs_input(struct mbuf *m, int off, in /* Sanity checks */ if (ip6->ip6_hlim != 255) { nd6log(LOG_ERR, "invalid hlim (%d) from %s to %s on %s\n", - ip6->ip6_hlim, ip6_sprintf(ip6bufs, &ip6->ip6_src), - ip6_sprintf(ip6bufd, &ip6->ip6_dst), if_name(ifp)); + ip6->ip6_hlim, IN6_PRINT(ip6bufs, &ip6->ip6_src), + IN6_PRINT(ip6bufd, &ip6->ip6_dst), if_name(ifp)); goto bad; } @@ -194,7 +194,7 @@ nd6_rs_input(struct mbuf *m, int off, in if (lladdr && ((ifp->if_addrlen + 2 + 7) & ~7) != lladdrlen) { nd6log(LOG_INFO, "lladdrlen mismatch for %s " "(if %d, RS packet %d)\n", - ip6_sprintf(ip6bufs, &saddr6), + IN6_PRINT(ip6bufs, &saddr6), ifp->if_addrlen, lladdrlen - 2); goto bad; } @@ -254,14 +254,14 @@ nd6_ra_input(struct mbuf *m, int off, in if (ip6->ip6_hlim != 255) { nd6log(LOG_ERR, "invalid hlim (%d) from %s to %s on %s\n", - ip6->ip6_hlim, ip6_sprintf(ip6buf, &ip6->ip6_src), - ip6_sprintf(ip6buf2, &ip6->ip6_dst), if_name(ifp)); + ip6->ip6_hlim, IN6_PRINT(ip6buf, &ip6->ip6_src), + IN6_PRINT(ip6buf2, &ip6->ip6_dst), if_name(ifp)); goto bad; } if (!IN6_IS_ADDR_LINKLOCAL(&saddr6)) { nd6log(LOG_ERR, "src %s is not link-local\n", - ip6_sprintf(ip6buf, &saddr6)); + IN6_PRINT(ip6buf, &saddr6)); goto bad; } @@ -312,7 +312,7 @@ nd6_ra_input(struct mbuf *m, int off, in else if (ndi->chlim != nd_ra->nd_ra_curhoplimit) log(LOG_ERR, "nd_ra_input: lower CurHopLimit sent from " "%s on %s (current=%d, received=%d), ignored\n", - ip6_sprintf(ip6buf, &ip6->ip6_src), + IN6_PRINT(ip6buf, &ip6->ip6_src), if_name(ifp), ndi->chlim, nd_ra->nd_ra_curhoplimit); } ND6_WLOCK(); @@ -353,7 +353,7 @@ nd6_ra_input(struct mbuf *m, int off, in || IN6_IS_ADDR_LINKLOCAL(&pi->nd_opt_pi_prefix)) { nd6log(LOG_INFO, "invalid prefix %s, ignored\n", - ip6_sprintf(ip6buf, &pi->nd_opt_pi_prefix)); + IN6_PRINT(ip6buf, &pi->nd_opt_pi_prefix)); continue; } @@ -388,7 +388,7 @@ nd6_ra_input(struct mbuf *m, int off, in if (mtu < IPV6_MMTU) { nd6log(LOG_INFO, "bogus mtu option " "mtu=%lu sent from %s, ignoring\n", - mtu, ip6_sprintf(ip6buf, &ip6->ip6_src)); + mtu, IN6_PRINT(ip6buf, &ip6->ip6_src)); goto skip; } @@ -405,7 +405,7 @@ nd6_ra_input(struct mbuf *m, int off, in nd6log(LOG_INFO, "bogus mtu mtu=%lu sent from %s; " "exceeds maxmtu %lu, ignoring\n", - mtu, ip6_sprintf(ip6buf, &ip6->ip6_src), maxmtu); + mtu, IN6_PRINT(ip6buf, &ip6->ip6_src), maxmtu); } } @@ -425,7 +425,7 @@ nd6_ra_input(struct mbuf *m, int off, in if (lladdr && ((ifp->if_addrlen + 2 + 7) & ~7) != lladdrlen) { nd6log(LOG_INFO, "lladdrlen mismatch for %s " - "(if %d, RA packet %d)\n", ip6_sprintf(ip6buf, &saddr6), + "(if %d, RA packet %d)\n", IN6_PRINT(ip6buf, &saddr6), ifp->if_addrlen, lladdrlen - 2); goto bad; } @@ -1009,7 +1009,7 @@ nd6_prelist_add(struct nd_prefixctl *prc char ip6buf[INET6_ADDRSTRLEN]; nd6log(LOG_ERR, "failed to make " "the prefix %s/%d on-link on %s (errno=%d)\n", - ip6_sprintf(ip6buf, &prc->ndprc_prefix.sin6_addr), + IN6_PRINT(ip6buf, &prc->ndprc_prefix.sin6_addr), prc->ndprc_plen, if_name(prc->ndprc_ifp), e); /* proceed anyway. XXX: is it correct? */ } @@ -1060,7 +1060,7 @@ nd6_prelist_remove(struct nd_prefix *pr) char ip6buf[INET6_ADDRSTRLEN]; nd6log(LOG_ERR, "failed to make %s/%d offlink on %s, errno=%d\n", - ip6_sprintf(ip6buf, &pr->ndpr_prefix.sin6_addr), + IN6_PRINT(ip6buf, &pr->ndpr_prefix.sin6_addr), pr->ndpr_plen, if_name(pr->ndpr_ifp), e); /* what should we do? */ } @@ -1151,7 +1151,7 @@ prelist_update(struct nd_prefixctl *newp "failed to make " "the prefix %s/%d on-link on %s " "(errno=%d)\n", - ip6_sprintf(ip6buf, + IN6_PRINT(ip6buf, &pr->ndpr_prefix.sin6_addr), pr->ndpr_plen, if_name(pr->ndpr_ifp), e); /* proceed anyway. XXX: is it correct? */ @@ -1178,7 +1178,7 @@ prelist_update(struct nd_prefixctl *newp nd6log(LOG_NOTICE, "nd6_prelist_add failed for %s/%d on %s " "errno=%d, returnpr=%p\n", - ip6_sprintf(ip6buf, &newprc->ndprc_prefix.sin6_addr), + IN6_PRINT(ip6buf, &newprc->ndprc_prefix.sin6_addr), newprc->ndprc_plen, if_name(newprc->ndprc_ifp), error, newpr); goto end; /* we should just give up in this case. */ @@ -1572,7 +1572,7 @@ nd6_pfxlist_onlink_check(void) if ((e = nd6_prefix_offlink(pr)) != 0) { nd6log(LOG_ERR, "failed to make %s/%d offlink, errno=%d\n", - ip6_sprintf(ip6buf, + IN6_PRINT(ip6buf, &pr->ndpr_prefix.sin6_addr), pr->ndpr_plen, e); } @@ -1583,7 +1583,7 @@ nd6_pfxlist_onlink_check(void) if ((e = nd6_prefix_onlink(pr)) != 0) { nd6log(LOG_ERR, "failed to make %s/%d onlink, errno=%d\n", - ip6_sprintf(ip6buf, + IN6_PRINT(ip6buf, &pr->ndpr_prefix.sin6_addr), pr->ndpr_plen, e); } @@ -1707,7 +1707,7 @@ nd6_prefix_onlink(struct nd_prefix *pr) /* sanity check */ if ((pr->ndpr_stateflags & NDPRF_ONLINK) != 0) { nd6log(LOG_ERR, "%s/%d is already on-link\n", - ip6_sprintf(ip6buf, &pr->ndpr_prefix.sin6_addr), + IN6_PRINT(ip6buf, &pr->ndpr_prefix.sin6_addr), pr->ndpr_plen); return (EEXIST); } @@ -1759,7 +1759,7 @@ nd6_prefix_onlink(struct nd_prefix *pr) */ nd6log(LOG_NOTICE, "failed to find any ifaddr" " to add route for a prefix(%s/%d) on %s\n", - ip6_sprintf(ip6buf, &pr->ndpr_prefix.sin6_addr), + IN6_PRINT(ip6buf, &pr->ndpr_prefix.sin6_addr), pr->ndpr_plen, if_name(ifp)); curlwp_bindx(bound); return (0); @@ -1793,11 +1793,11 @@ nd6_prefix_onlink(struct nd_prefix *pr) nd6log(LOG_ERR, "failed to add route for a" " prefix (%s/%d) on %s, gw=%s, mask=%s, flags=%lx " "errno = %d\n", - ip6_sprintf(ip6bufp, &pr->ndpr_prefix.sin6_addr), + IN6_PRINT(ip6bufp, &pr->ndpr_prefix.sin6_addr), pr->ndpr_plen, if_name(ifp), - ip6_sprintf(ip6buf, + IN6_PRINT(ip6buf, &((struct sockaddr_in6 *)ifa->ifa_addr)->sin6_addr), - ip6_sprintf(ip6bufm, &mask6.sin6_addr), rtflags, error); + IN6_PRINT(ip6bufm, &mask6.sin6_addr), rtflags, error); } ifa_release(ifa, &psref); curlwp_bindx(bound); @@ -1819,7 +1819,7 @@ nd6_prefix_offlink(struct nd_prefix *pr) /* sanity check */ if ((pr->ndpr_stateflags & NDPRF_ONLINK) == 0) { nd6log(LOG_ERR, "%s/%d is already off-link\n", - ip6_sprintf(ip6buf, &pr->ndpr_prefix.sin6_addr), + IN6_PRINT(ip6buf, &pr->ndpr_prefix.sin6_addr), pr->ndpr_plen); return (EEXIST); } @@ -1862,7 +1862,7 @@ nd6_prefix_offlink(struct nd_prefix *pr) nd6log(LOG_ERR, "failed to " "recover a prefix %s/%d from %s " "to %s (errno = %d)\n", - ip6_sprintf(ip6buf, + IN6_PRINT(ip6buf, &opr->ndpr_prefix.sin6_addr), opr->ndpr_plen, if_name(ifp), if_name(opr->ndpr_ifp), e); @@ -1873,7 +1873,7 @@ nd6_prefix_offlink(struct nd_prefix *pr) /* XXX: can we still set the NDPRF_ONLINK flag? */ nd6log(LOG_ERR, "failed to delete route: " "%s/%d on %s (errno = %d)\n", - ip6_sprintf(ip6buf, &sa6.sin6_addr), pr->ndpr_plen, + IN6_PRINT(ip6buf, &sa6.sin6_addr), pr->ndpr_plen, if_name(ifp), error); } @@ -1992,7 +1992,7 @@ in6_ifadd(struct nd_prefixctl *prc, int if (in6ifa_ifpwithaddr(ifp, &ifra.ifra_addr.sin6_addr) != NULL) { /* this should be rare enough to make an explicit log */ log(LOG_INFO, "in6_ifadd: %s is already configured\n", - ip6_sprintf(ip6buf, &ifra.ifra_addr.sin6_addr)); + IN6_PRINT(ip6buf, &ifra.ifra_addr.sin6_addr)); pserialize_read_exit(s); return (NULL); } @@ -2009,7 +2009,7 @@ in6_ifadd(struct nd_prefixctl *prc, int updateflags |= IN6_IFAUPDATE_DADDELAY; if ((error = in6_update_ifa(ifp, &ifra, updateflags)) != 0) { nd6log(LOG_ERR, "failed to make ifaddr %s on %s (errno=%d)\n", - ip6_sprintf(ip6buf, &ifra.ifra_addr.sin6_addr), if_name(ifp), + IN6_PRINT(ip6buf, &ifra.ifra_addr.sin6_addr), if_name(ifp), error); return (NULL); /* ifaddr must not have been allocated. */ } Index: src/sys/netinet6/scope6.c diff -u src/sys/netinet6/scope6.c:1.16 src/sys/netinet6/scope6.c:1.17 --- src/sys/netinet6/scope6.c:1.16 Mon Jan 16 02:33:36 2017 +++ src/sys/netinet6/scope6.c Mon Jan 16 10:44:47 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: scope6.c,v 1.16 2017/01/16 07:33:36 ryo Exp $ */ +/* $NetBSD: scope6.c,v 1.17 2017/01/16 15:44:47 christos Exp $ */ /* $KAME$ */ /*- @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: scope6.c,v 1.16 2017/01/16 07:33:36 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: scope6.c,v 1.17 2017/01/16 15:44:47 christos Exp $"); #include <sys/param.h> #include <sys/malloc.h> @@ -348,7 +348,7 @@ sa6_recoverscope(struct sockaddr_in6 *si if (sin6->sin6_scope_id != 0) { log(LOG_NOTICE, "sa6_recoverscope: assumption failure (non 0 ID): %s%%%d\n", - ip6_sprintf(ip6buf, &sin6->sin6_addr), sin6->sin6_scope_id); + IN6_PRINT(ip6buf, &sin6->sin6_addr), sin6->sin6_scope_id); /* XXX: proceed anyway... */ } if (IN6_IS_SCOPE_LINKLOCAL(&sin6->sin6_addr) || Index: src/sys/netipsec/ipsec.c diff -u src/sys/netipsec/ipsec.c:1.68 src/sys/netipsec/ipsec.c:1.69 --- src/sys/netipsec/ipsec.c:1.68 Mon Jan 16 02:33:36 2017 +++ src/sys/netipsec/ipsec.c Mon Jan 16 10:44:47 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: ipsec.c,v 1.68 2017/01/16 07:33:36 ryo Exp $ */ +/* $NetBSD: ipsec.c,v 1.69 2017/01/16 15:44:47 christos Exp $ */ /* $FreeBSD: /usr/local/www/cvsroot/FreeBSD/src/sys/netipsec/ipsec.c,v 1.2.2.2 2003/07/01 01:38:13 sam Exp $ */ /* $KAME: ipsec.c,v 1.103 2001/05/24 07:14:18 sakane Exp $ */ @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ipsec.c,v 1.68 2017/01/16 07:33:36 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ipsec.c,v 1.69 2017/01/16 15:44:47 christos Exp $"); /* * IPsec controller part. @@ -2325,7 +2325,7 @@ ipsec_address(const union sockaddr_union #if INET6 case AF_INET6: - return ip6_sprintf(ip6buf, &sa->sin6.sin6_addr); + return IN6_PRINT(ip6buf, &sa->sin6.sin6_addr); #endif /* INET6 */ default: