diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c index 9a4e2412d934..9beb3b9babf2 100644 --- a/sys/netinet6/icmp6.c +++ b/sys/netinet6/icmp6.c @@ -1,4 +1,4 @@ -/* $NetBSD: icmp6.c,v 1.193 2016/07/15 07:33:41 ozaki-r Exp $ */ +/* $NetBSD: icmp6.c,v 1.194 2016/07/15 07:40:09 ozaki-r Exp $ */ /* $KAME: icmp6.c,v 1.217 2001/06/20 15:03:29 jinmei Exp $ */ /* @@ -62,7 +62,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: icmp6.c,v 1.193 2016/07/15 07:33:41 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: icmp6.c,v 1.194 2016/07/15 07:40:09 ozaki-r Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -1080,7 +1080,7 @@ icmp6_notify_error(struct mbuf *m, int off, int icmp6len, int code) ctlfunc = (void (*)(int, struct sockaddr *, void *)) (inet6sw[ip6_protox[nxt]].pr_ctlinput); if (ctlfunc) { - (void) (*ctlfunc)(code, (struct sockaddr *)&icmp6dst, + (void) (*ctlfunc)(code, sin6tosa(&icmp6dst), &ip6cp); } } @@ -1150,7 +1150,7 @@ icmp6_mtudisc_update(struct ip6ctlparam *ip6cp, int validated) } m_put_rcvif(rcvif, &s); - rt = icmp6_mtudisc_clone((struct sockaddr *)&sin6); + rt = icmp6_mtudisc_clone(sin6tosa(&sin6)); if (rt && (rt->rt_flags & RTF_HOST) && !(rt->rt_rmx.rmx_locks & RTV_MTU) && @@ -1220,7 +1220,7 @@ ni6_input(struct mbuf *m, int off) */ sockaddr_in6_init(&sin6, &ip6->ip6_dst, 0, 0, 0); /* XXX scopeid */ - if (ifa_ifwithaddr((struct sockaddr *)&sin6)) + if (ifa_ifwithaddr(sin6tosa(&sin6))) ; /* unicast/anycast, fine */ else if (IN6_IS_ADDR_MC_LINKLOCAL(&sin6.sin6_addr)) ; /* link-local multicast, fine */ @@ -1935,8 +1935,7 @@ icmp6_rip6_input(struct mbuf **mp, int off) /* strip intermediate headers */ m_adj(n, off); if (sbappendaddr(&last->in6p_socket->so_rcv, - (struct sockaddr *)&rip6src, - n, opts) == 0) { + sin6tosa(&rip6src), n, opts) == 0) { /* should notify about lost packet */ m_freem(n); if (opts) @@ -1954,7 +1953,7 @@ icmp6_rip6_input(struct mbuf **mp, int off) /* strip intermediate headers */ m_adj(m, off); if (sbappendaddr(&last->in6p_socket->so_rcv, - (struct sockaddr *)&rip6src, m, opts) == 0) { + sin6tosa(&rip6src), m, opts) == 0) { m_freem(m); if (opts) m_freem(opts); @@ -2220,7 +2219,7 @@ icmp6_redirect_input(struct mbuf *m, int off) struct in6_addr *gw6; sockaddr_in6_init(&sin6, &reddst6, 0, 0, 0); - rt = rtalloc1((struct sockaddr *)&sin6, 0); + rt = rtalloc1(sin6tosa(&sin6), 0); if (rt) { if (rt->rt_gateway == NULL || rt->rt_gateway->sa_family != AF_INET6) { @@ -2335,9 +2334,8 @@ icmp6_redirect_input(struct mbuf *m, int off) bcopy(&redtgt6, &sgw.sin6_addr, sizeof(struct in6_addr)); bcopy(&reddst6, &sdst.sin6_addr, sizeof(struct in6_addr)); bcopy(&src6, &ssrc.sin6_addr, sizeof(struct in6_addr)); - rtredirect((struct sockaddr *)&sdst, (struct sockaddr *)&sgw, - NULL, RTF_GATEWAY | RTF_HOST, - (struct sockaddr *)&ssrc, + rtredirect(sin6tosa(&sdst), sin6tosa(&sgw), NULL, + RTF_GATEWAY | RTF_HOST, sin6tosa(&ssrc), &newrt); if (newrt) { @@ -2351,10 +2349,10 @@ icmp6_redirect_input(struct mbuf *m, int off) struct sockaddr_in6 sdst; sockaddr_in6_init(&sdst, &reddst6, 0, 0, 0); - pfctlinput(PRC_REDIRECT_HOST, (struct sockaddr *)&sdst); + pfctlinput(PRC_REDIRECT_HOST, sin6tosa(&sdst)); #if defined(IPSEC) if (ipsec_used) - key_sa_routechange((struct sockaddr *)&sdst); + key_sa_routechange(sin6tosa(&sdst)); #endif } diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index c07ca984e6f0..d14cd15f02c0 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -1,4 +1,4 @@ -/* $NetBSD: in6.c,v 1.208 2016/07/08 06:18:29 ozaki-r Exp $ */ +/* $NetBSD: in6.c,v 1.209 2016/07/15 07:40:09 ozaki-r Exp $ */ /* $KAME: in6.c,v 1.198 2001/07/18 09:12:38 itojun Exp $ */ /* @@ -62,7 +62,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.208 2016/07/08 06:18:29 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.209 2016/07/15 07:40:09 ozaki-r Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -911,7 +911,7 @@ in6_update_ifa1(struct ifnet *ifp, struct in6_aliasreq *ifra, memset(ia, 0, sizeof(*ia)); LIST_INIT(&ia->ia6_memberships); /* Initialize the address and masks, and put time stamp */ - ia->ia_ifa.ifa_addr = (struct sockaddr *)&ia->ia_addr; + ia->ia_ifa.ifa_addr = sin6tosa(&ia->ia_addr); ia->ia_addr.sin6_family = AF_INET6; ia->ia_addr.sin6_len = sizeof(ia->ia_addr); ia->ia6_createtime = time_uptime; @@ -920,13 +920,11 @@ in6_update_ifa1(struct ifnet *ifp, struct in6_aliasreq *ifra, * XXX: some functions expect that ifa_dstaddr is not * NULL for p2p interfaces. */ - ia->ia_ifa.ifa_dstaddr = - (struct sockaddr *)&ia->ia_dstaddr; + ia->ia_ifa.ifa_dstaddr = sin6tosa(&ia->ia_dstaddr); } else { ia->ia_ifa.ifa_dstaddr = NULL; } - ia->ia_ifa.ifa_netmask = - (struct sockaddr *)&ia->ia_prefixmask; + ia->ia_ifa.ifa_netmask = sin6tosa(&ia->ia_prefixmask); ia->ia_ifp = ifp; IN6_ADDRLIST_ENTRY_INIT(ia); @@ -1105,7 +1103,7 @@ in6_update_ifa1(struct ifnet *ifp, struct in6_aliasreq *ifra, * actually do not need the routes, since they usually specify * the outgoing interface. */ - rt = rtalloc1((struct sockaddr *)&mltaddr, 0); + rt = rtalloc1(sin6tosa(&mltaddr), 0); if (rt) { if (memcmp(&mltaddr.sin6_addr, &satocsin6(rt_getkey(rt))->sin6_addr, @@ -1128,13 +1126,10 @@ in6_update_ifa1(struct ifnet *ifp, struct in6_aliasreq *ifra, struct rt_addrinfo info; memset(&info, 0, sizeof(info)); - info.rti_info[RTAX_DST] = (struct sockaddr *)&mltaddr; - info.rti_info[RTAX_GATEWAY] = - (struct sockaddr *)&ia->ia_addr; - info.rti_info[RTAX_NETMASK] = - (struct sockaddr *)&mltmask; - info.rti_info[RTAX_IFA] = - (struct sockaddr *)&ia->ia_addr; + info.rti_info[RTAX_DST] = sin6tosa(&mltaddr); + info.rti_info[RTAX_GATEWAY] = sin6tosa(&ia->ia_addr); + info.rti_info[RTAX_NETMASK] = sin6tosa(&mltmask); + info.rti_info[RTAX_IFA] = sin6tosa(&ia->ia_addr); /* XXX: we need RTF_CONNECTED to fake nd6_rtrequest */ info.rti_flags = RTF_UP | RTF_CONNECTED; error = rtrequest1(RTM_ADD, &info, NULL); @@ -1188,7 +1183,7 @@ in6_update_ifa1(struct ifnet *ifp, struct in6_aliasreq *ifra, goto cleanup; /* XXX: should not fail */ /* XXX: again, do we really need the route? */ - rt = rtalloc1((struct sockaddr *)&mltaddr, 0); + rt = rtalloc1(sin6tosa(&mltaddr), 0); if (rt) { /* 32bit came from "mltmask" */ if (memcmp(&mltaddr.sin6_addr, @@ -1212,13 +1207,10 @@ in6_update_ifa1(struct ifnet *ifp, struct in6_aliasreq *ifra, struct rt_addrinfo info; memset(&info, 0, sizeof(info)); - info.rti_info[RTAX_DST] = (struct sockaddr *)&mltaddr; - info.rti_info[RTAX_GATEWAY] = - (struct sockaddr *)&ia->ia_addr; - info.rti_info[RTAX_NETMASK] = - (struct sockaddr *)&mltmask; - info.rti_info[RTAX_IFA] = - (struct sockaddr *)&ia->ia_addr; + info.rti_info[RTAX_DST] = sin6tosa(&mltaddr); + info.rti_info[RTAX_GATEWAY] = sin6tosa(&ia->ia_addr); + info.rti_info[RTAX_NETMASK] = sin6tosa(&mltmask); + info.rti_info[RTAX_IFA] = sin6tosa(&ia->ia_addr); info.rti_flags = RTF_UP | RTF_CONNECTED; error = rtrequest1(RTM_ADD, &info, NULL); if (error) @@ -2621,5 +2613,5 @@ in6_sin_2_v4mapsin6_in_sock(struct sockaddr **nam) sin_p = (struct sockaddr_in *)*nam; in6_sin_2_v4mapsin6(sin_p, sin6_p); free(*nam, M_SONAME); - *nam = (struct sockaddr *)sin6_p; + *nam = sin6tosa(sin6_p); } diff --git a/sys/netinet6/in6_gif.c b/sys/netinet6/in6_gif.c index 2eedc977d72d..6472c42766ac 100644 --- a/sys/netinet6/in6_gif.c +++ b/sys/netinet6/in6_gif.c @@ -1,4 +1,4 @@ -/* $NetBSD: in6_gif.c,v 1.78 2016/07/06 00:30:55 ozaki-r Exp $ */ +/* $NetBSD: in6_gif.c,v 1.79 2016/07/15 07:40:09 ozaki-r Exp $ */ /* $KAME: in6_gif.c,v 1.62 2001/07/29 04:27:25 itojun Exp $ */ /* @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: in6_gif.c,v 1.78 2016/07/06 00:30:55 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: in6_gif.c,v 1.79 2016/07/15 07:40:09 ozaki-r Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -381,7 +381,7 @@ in6_gif_attach(struct gif_softc *sc) if (!sc->gif_psrc || !sc->gif_pdst) return EINVAL; sc->encap_cookie6 = encap_attach(AF_INET6, -1, sc->gif_psrc, - (struct sockaddr *)&mask6, sc->gif_pdst, (struct sockaddr *)&mask6, + sin6tosa(&mask6), sc->gif_pdst, sin6tosa(&mask6), (const void *)&in6_gif_encapsw, sc); #else sc->encap_cookie6 = encap_attach_func(AF_INET6, -1, gif_encapcheck, diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index 05304f324a9b..750a4200c42d 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -1,4 +1,4 @@ -/* $NetBSD: in6_pcb.c,v 1.146 2016/07/15 07:33:41 ozaki-r Exp $ */ +/* $NetBSD: in6_pcb.c,v 1.147 2016/07/15 07:40:09 ozaki-r Exp $ */ /* $KAME: in6_pcb.c,v 1.84 2001/02/08 18:02:08 itojun Exp $ */ /* @@ -62,7 +62,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: in6_pcb.c,v 1.146 2016/07/15 07:33:41 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: in6_pcb.c,v 1.147 2016/07/15 07:40:09 ozaki-r Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -240,7 +240,7 @@ in6_pcbbind_addr(struct in6pcb *in6p, struct sockaddr_in6 *sin6, struct lwp *l) struct ifaddr *ia = NULL; if ((in6p->in6p_flags & IN6P_FAITH) == 0 && - (ia = ifa_ifwithaddr((struct sockaddr *)sin6)) == NULL) + (ia = ifa_ifwithaddr(sin6tosa(sin6))) == NULL) return (EADDRNOTAVAIL); /* diff --git a/sys/netinet6/in6_src.c b/sys/netinet6/in6_src.c index cc759ceaf600..bb39f43a20f2 100644 --- a/sys/netinet6/in6_src.c +++ b/sys/netinet6/in6_src.c @@ -1,4 +1,4 @@ -/* $NetBSD: in6_src.c,v 1.64 2016/07/15 07:33:41 ozaki-r Exp $ */ +/* $NetBSD: in6_src.c,v 1.65 2016/07/15 07:40:09 ozaki-r Exp $ */ /* $KAME: in6_src.c,v 1.159 2005/10/19 01:40:32 t-momose Exp $ */ /* @@ -66,7 +66,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: in6_src.c,v 1.64 2016/07/15 07:33:41 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: in6_src.c,v 1.65 2016/07/15 07:40:09 ozaki-r Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -240,7 +240,7 @@ in6_selectsrc(struct sockaddr_in6 *dstsock, struct ip6_pktopts *opts, goto exit; } - ia6 = ifatoia6(ifa_ifwithaddr((struct sockaddr *)(&srcsock))); + ia6 = ifatoia6(ifa_ifwithaddr(sin6tosa(&srcsock))); if (ia6 == NULL || (ia6->ia6_flags & (IN6_IFF_ANYCAST | IN6_IFF_NOTREADY))) { *errorp = EADDRNOTAVAIL; diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c index 91b65187fad3..99a1e229e1d7 100644 --- a/sys/netinet6/ip6_mroute.c +++ b/sys/netinet6/ip6_mroute.c @@ -1,4 +1,4 @@ -/* $NetBSD: ip6_mroute.c,v 1.111 2016/06/21 03:28:27 ozaki-r Exp $ */ +/* $NetBSD: ip6_mroute.c,v 1.112 2016/07/15 07:40:09 ozaki-r Exp $ */ /* $KAME: ip6_mroute.c,v 1.49 2001/07/25 09:21:18 jinmei Exp $ */ /* @@ -117,7 +117,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ip6_mroute.c,v 1.111 2016/06/21 03:28:27 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ip6_mroute.c,v 1.112 2016/07/15 07:40:09 ozaki-r Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -1016,8 +1016,7 @@ static int socket_send(struct socket *s, struct mbuf *mm, struct sockaddr_in6 *src) { if (s) { - if (sbappendaddr(&s->so_rcv, - (struct sockaddr *)src, mm, NULL) != 0) { + if (sbappendaddr(&s->so_rcv, sin6tosa(src), mm, NULL) != 0) { sorwakeup(s); return 0; } @@ -1909,8 +1908,8 @@ pim6_input(struct mbuf **mp, int *offp, int proto) } #endif - looutput(mif6table[reg_mif_num].m6_ifp, m, - (struct sockaddr *)__UNCONST(&dst), NULL); + looutput(mif6table[reg_mif_num].m6_ifp, m, sin6tocsa(&dst), + NULL); /* prepare the register head to send to the mrouting daemon */ m = mcp; diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index 35016c91adcf..a40ce48f6748 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -1,4 +1,4 @@ -/* $NetBSD: nd6.c,v 1.203 2016/07/11 07:37:00 ozaki-r Exp $ */ +/* $NetBSD: nd6.c,v 1.204 2016/07/15 07:40:09 ozaki-r Exp $ */ /* $KAME: nd6.c,v 1.279 2002/06/08 11:16:51 itojun Exp $ */ /* @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.203 2016/07/11 07:37:00 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.204 2016/07/15 07:40:09 ozaki-r Exp $"); #ifdef _KERNEL_OPT #include "opt_net_mpsafe.h" @@ -951,7 +951,7 @@ nd6_is_new_addr_neighbor(const struct sockaddr_in6 *addr, struct ifnet *ifp) if (!(pr->ndpr_stateflags & NDPRF_ONLINK)) { struct rtentry *rt; - rt = rtalloc1((struct sockaddr *)&pr->ndpr_prefix, 0); + rt = rtalloc1(sin6tosa(&pr->ndpr_prefix), 0); if (rt == NULL) continue; /* @@ -979,7 +979,7 @@ nd6_is_new_addr_neighbor(const struct sockaddr_in6 *addr, struct ifnet *ifp) * If the address is assigned on the node of the other side of * a p2p interface, the address should be a neighbor. */ - dstaddr = ifa_ifwithdstaddr((const struct sockaddr *)addr); + dstaddr = ifa_ifwithdstaddr(sin6tocsa(addr)); if (dstaddr != NULL) { if (dstaddr->ifa_ifp == ifp) { #ifdef __FreeBSD__ @@ -2387,7 +2387,7 @@ nd6_add_ifa_lle(struct in6_ifaddr *ia) IF_AFDATA_WLOCK(ifp); ln = lla_create(LLTABLE6(ifp), LLE_IFADDR | LLE_EXCLUSIVE, - (struct sockaddr *)&ia->ia_addr); + sin6tosa(&ia->ia_addr)); IF_AFDATA_WUNLOCK(ifp); if (ln == NULL) return ENOBUFS; @@ -2413,8 +2413,8 @@ nd6_rem_ifa_lle(struct in6_ifaddr *ia) memcpy(&addr, &ia->ia_addr, sizeof(ia->ia_addr)); memcpy(&mask, &ia->ia_prefixmask, sizeof(ia->ia_prefixmask)); - lltable_prefix_free(AF_INET6, (struct sockaddr *)&addr, - (struct sockaddr *)&mask, LLE_STATIC); + lltable_prefix_free(AF_INET6, sin6tosa(&addr), sin6tosa(&mask), + LLE_STATIC); } int diff --git a/sys/netinet6/nd6_nbr.c b/sys/netinet6/nd6_nbr.c index 1ef022e0a0c5..a3ee9b9b0e18 100644 --- a/sys/netinet6/nd6_nbr.c +++ b/sys/netinet6/nd6_nbr.c @@ -1,4 +1,4 @@ -/* $NetBSD: nd6_nbr.c,v 1.122 2016/07/01 05:22:33 ozaki-r Exp $ */ +/* $NetBSD: nd6_nbr.c,v 1.123 2016/07/15 07:40:09 ozaki-r Exp $ */ /* $KAME: nd6_nbr.c,v 1.61 2001/02/10 16:06:14 jinmei Exp $ */ /* @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: nd6_nbr.c,v 1.122 2016/07/01 05:22:33 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: nd6_nbr.c,v 1.123 2016/07/15 07:40:09 ozaki-r Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -233,7 +233,7 @@ nd6_ns_input(struct mbuf *m, int off, int icmp6len) sockaddr_in6_init(&tsin6, &taddr6, 0, 0, 0); - rt = rtalloc1((struct sockaddr *)&tsin6, 0); + rt = rtalloc1(sin6tosa(&tsin6), 0); if (rt && (rt->rt_flags & RTF_ANNOUNCE) != 0 && rt->rt_gateway->sa_family == AF_LINK) { /* diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c index 89a6438ee66c..9c0a20e0c8ab 100644 --- a/sys/netinet6/nd6_rtr.c +++ b/sys/netinet6/nd6_rtr.c @@ -1,4 +1,4 @@ -/* $NetBSD: nd6_rtr.c,v 1.115 2016/07/07 09:32:03 ozaki-r Exp $ */ +/* $NetBSD: nd6_rtr.c,v 1.116 2016/07/15 07:40:09 ozaki-r Exp $ */ /* $KAME: nd6_rtr.c,v 1.95 2001/02/07 08:09:47 itojun Exp $ */ /* @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: nd6_rtr.c,v 1.115 2016/07/07 09:32:03 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: nd6_rtr.c,v 1.116 2016/07/15 07:40:09 ozaki-r Exp $"); #include #include @@ -1683,8 +1683,8 @@ nd6_prefix_onlink(struct nd_prefix *pr) */ rtflags &= ~RTF_CONNECTED; } - error = rtrequest_newmsg(RTM_ADD, (struct sockaddr *)&pr->ndpr_prefix, - ifa->ifa_addr, (struct sockaddr *)&mask6, rtflags); + error = rtrequest_newmsg(RTM_ADD, sin6tosa(&pr->ndpr_prefix), + ifa->ifa_addr, sin6tosa(&mask6), rtflags); if (error == 0) { nd6_numroutes++; pr->ndpr_stateflags |= NDPRF_ONLINK; @@ -1718,8 +1718,8 @@ nd6_prefix_offlink(struct nd_prefix *pr) sockaddr_in6_init(&sa6, &pr->ndpr_prefix.sin6_addr, 0, 0, 0); sockaddr_in6_init(&mask6, &pr->ndpr_mask, 0, 0, 0); - error = rtrequest_newmsg(RTM_DELETE, (struct sockaddr *)&sa6, NULL, - (struct sockaddr *)&mask6, 0); + error = rtrequest_newmsg(RTM_DELETE, sin6tosa(&sa6), NULL, + sin6tosa(&mask6), 0); if (error == 0) { pr->ndpr_stateflags &= ~NDPRF_ONLINK; nd6_numroutes--; diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c index af5ac8f1da15..8470352d137c 100644 --- a/sys/netinet6/raw_ip6.c +++ b/sys/netinet6/raw_ip6.c @@ -1,4 +1,4 @@ -/* $NetBSD: raw_ip6.c,v 1.147 2016/07/15 07:33:41 ozaki-r Exp $ */ +/* $NetBSD: raw_ip6.c,v 1.148 2016/07/15 07:40:09 ozaki-r Exp $ */ /* $KAME: raw_ip6.c,v 1.82 2001/07/23 18:57:56 jinmei Exp $ */ /* @@ -62,7 +62,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: raw_ip6.c,v 1.147 2016/07/15 07:33:41 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: raw_ip6.c,v 1.148 2016/07/15 07:40:09 ozaki-r Exp $"); #ifdef _KERNEL_OPT #include "opt_ipsec.h" @@ -213,7 +213,7 @@ rip6_input(struct mbuf **mp, int *offp, int proto) /* strip intermediate headers */ m_adj(n, *offp); if (sbappendaddr(&last->in6p_socket->so_rcv, - (struct sockaddr *)&rip6src, n, opts) == 0) { + sin6tosa(&rip6src), n, opts) == 0) { /* should notify about lost packet */ m_freem(n); if (opts) @@ -246,7 +246,7 @@ rip6_input(struct mbuf **mp, int *offp, int proto) /* strip intermediate headers */ m_adj(m, *offp); if (sbappendaddr(&last->in6p_socket->so_rcv, - (struct sockaddr *)&rip6src, m, opts) == 0) { + sin6tosa(&rip6src), m, opts) == 0) { m_freem(m); if (opts) m_freem(opts); @@ -365,7 +365,7 @@ rip6_ctlinput(int cmd, const struct sockaddr *sa, void *d) } (void) in6_pcbnotify(&raw6cbtable, sa, 0, - (const struct sockaddr *)sa6_src, 0, cmd, cmdarg, notify); + sin6tocsa(sa6_src), 0, cmd, cmdarg, notify); return NULL; } @@ -693,7 +693,7 @@ rip6_bind(struct socket *so, struct sockaddr *nam, struct lwp *l) if (IN6_IS_ADDR_V4MAPPED(&addr->sin6_addr)) return EADDRNOTAVAIL; if (!IN6_IS_ADDR_UNSPECIFIED(&addr->sin6_addr) && - (ia = ifa_ifwithaddr((struct sockaddr *)addr)) == 0) + (ia = ifa_ifwithaddr(sin6tosa(addr))) == 0) return EADDRNOTAVAIL; if (ia && ifatoia6(ia)->ia6_flags & (IN6_IFF_ANYCAST|IN6_IFF_NOTREADY| diff --git a/sys/netinet6/sctp6_usrreq.c b/sys/netinet6/sctp6_usrreq.c index be1da3f41709..1c358757254f 100644 --- a/sys/netinet6/sctp6_usrreq.c +++ b/sys/netinet6/sctp6_usrreq.c @@ -1,5 +1,5 @@ /* $KAME: sctp6_usrreq.c,v 1.38 2005/08/24 08:08:56 suz Exp $ */ -/* $NetBSD: sctp6_usrreq.c,v 1.6 2016/07/07 09:32:03 ozaki-r Exp $ */ +/* $NetBSD: sctp6_usrreq.c,v 1.7 2016/07/15 07:40:09 ozaki-r Exp $ */ /* * Copyright (c) 2001, 2002, 2003, 2004 Cisco Systems, Inc. @@ -33,7 +33,7 @@ * SUCH DAMAGE. */ #include -__KERNEL_RCSID(0, "$NetBSD: sctp6_usrreq.c,v 1.6 2016/07/07 09:32:03 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sctp6_usrreq.c,v 1.7 2016/07/15 07:40:09 ozaki-r Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -462,8 +462,8 @@ sctp6_ctlinput(int cmd, const struct sockaddr *pktdst, void *d) final.sin6_addr = ((const struct sockaddr_in6 *)pktdst)->sin6_addr; final.sin6_port = sh.dest_port; s = splsoftnet(); - stcb = sctp_findassociation_addr_sa((struct sockaddr *)ip6cp->ip6c_src, - (struct sockaddr *)&final, + stcb = sctp_findassociation_addr_sa(sin6tosa(ip6cp->ip6c_src), + sin6tosa(&final), &inp, &net, 1); /* inp's ref-count increased && stcb locked */ if (stcb != NULL && inp && (inp->sctp_socket != NULL)) { @@ -480,8 +480,7 @@ sctp6_ctlinput(int cmd, const struct sockaddr *pktdst, void *d) } else { cm = inet6ctlerrmap[cmd]; } - sctp_notify(inp, cm, &sh, - (struct sockaddr *)&final, + sctp_notify(inp, cm, &sh, sin6tosa(&final), stcb, net); /* inp's ref-count reduced && stcb unlocked */ } diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c index 35ad47cd9596..a6887efc6aeb 100644 --- a/sys/netinet6/udp6_usrreq.c +++ b/sys/netinet6/udp6_usrreq.c @@ -1,4 +1,4 @@ -/* $NetBSD: udp6_usrreq.c,v 1.123 2016/06/10 13:31:44 ozaki-r Exp $ */ +/* $NetBSD: udp6_usrreq.c,v 1.124 2016/07/15 07:40:09 ozaki-r Exp $ */ /* $KAME: udp6_usrreq.c,v 1.86 2001/05/27 17:33:00 itojun Exp $ */ /* @@ -62,7 +62,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: udp6_usrreq.c,v 1.123 2016/06/10 13:31:44 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: udp6_usrreq.c,v 1.124 2016/07/15 07:40:09 ozaki-r Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -289,11 +289,11 @@ udp6_ctlinput(int cmd, const struct sockaddr *sa, void *d) } (void) in6_pcbnotify(&udbtable, sa, uh.uh_dport, - (const struct sockaddr *)sa6_src, uh.uh_sport, cmd, cmdarg, + sin6tocsa(sa6_src), uh.uh_sport, cmd, cmdarg, notify); } else { (void) in6_pcbnotify(&udbtable, sa, 0, - (const struct sockaddr *)sa6_src, 0, cmd, cmdarg, notify); + sin6tocsa(sa6_src), 0, cmd, cmdarg, notify); } return NULL; } @@ -464,8 +464,7 @@ udp6_realinput(int af, struct sockaddr_in6 *src, struct sockaddr_in6 *dst, continue; } - udp6_sendup(m, off, (struct sockaddr *)src, - in6p->in6p_socket); + udp6_sendup(m, off, sin6tosa(src), in6p->in6p_socket); rcvcnt++; /* @@ -493,7 +492,7 @@ udp6_realinput(int af, struct sockaddr_in6 *src, struct sockaddr_in6 *dst, return rcvcnt; } - udp6_sendup(m, off, (struct sockaddr *)src, in6p->in6p_socket); + udp6_sendup(m, off, sin6tosa(src), in6p->in6p_socket); rcvcnt++; }