diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2015-09-01 21:24:05 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2015-09-01 21:24:05 +0000 |
commit | 98bddd3337aaeb8aeaaf01bdac4e2a4e2610d590 (patch) | |
tree | 08108476b82a5a83b06d4d76a8075957d382ff5c /sys/netinet | |
parent | c1c64599aeaf94710989d5d76f665a48e34b5eee (diff) |
Replace sockaddr casts with the proper satosin(), ... calls.
From David Hill; OK mpi@; tested kspillner@; tweaks bluhm@
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/in_pcb.c | 4 | ||||
-rw-r--r-- | sys/netinet/ip_divert.c | 5 | ||||
-rw-r--r-- | sys/netinet/ip_icmp.c | 8 | ||||
-rw-r--r-- | sys/netinet/ip_mroute.c | 4 | ||||
-rw-r--r-- | sys/netinet/tcp_subr.c | 5 |
5 files changed, 12 insertions, 14 deletions
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 000b0459c6c..9043a1def91 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in_pcb.c,v 1.174 2015/08/22 20:18:50 deraadt Exp $ */ +/* $OpenBSD: in_pcb.c,v 1.175 2015/09/01 21:24:04 bluhm Exp $ */ /* $NetBSD: in_pcb.c,v 1.25 1996/02/13 23:41:53 christos Exp $ */ /* @@ -895,7 +895,7 @@ in_selectsrc(struct in_addr **insrc, struct sockaddr_in *sin, * It is important to zero out the rest of the * struct sockaddr_in when mixing v6 & v4! */ - sin2 = (struct sockaddr_in *)&ro->ro_dst; + sin2 = satosin(&ro->ro_dst); memset(sin2->sin_zero, 0, sizeof(sin2->sin_zero)); } /* diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c index 7f834db15fc..1494b5bf84e 100644 --- a/sys/netinet/ip_divert.c +++ b/sys/netinet/ip_divert.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_divert.c,v 1.36 2015/08/14 18:07:28 bluhm Exp $ */ +/* $OpenBSD: ip_divert.c,v 1.37 2015/09/01 21:24:04 bluhm Exp $ */ /* * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org> @@ -225,8 +225,7 @@ divert_packet(struct mbuf *m, int dir, u_int16_t divert_port) if (inp) { sa = inp->inp_socket; - if (sbappendaddr(&sa->so_rcv, (struct sockaddr *)&addr, - m, NULL) == 0) { + if (sbappendaddr(&sa->so_rcv, sintosa(&addr), m, NULL) == 0) { divstat.divs_fullsock++; m_freem(m); return (0); diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c index c8cd1f70b70..bdcc12feeb7 100644 --- a/sys/netinet/ip_icmp.c +++ b/sys/netinet/ip_icmp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_icmp.c,v 1.137 2015/08/14 18:07:28 bluhm Exp $ */ +/* $OpenBSD: ip_icmp.c,v 1.138 2015/09/01 21:24:04 bluhm Exp $ */ /* $NetBSD: ip_icmp.c,v 1.19 1996/02/13 23:42:22 christos Exp $ */ /* @@ -1034,10 +1034,10 @@ icmp_mtudisc_timeout(struct rtentry *rt, struct rttimer *r) if ((rt->rt_flags & (RTF_DYNAMIC | RTF_HOST)) == (RTF_DYNAMIC | RTF_HOST)) { void *(*ctlfunc)(int, struct sockaddr *, u_int, void *); - struct sockaddr_in sa; + struct sockaddr_in sin; int s; - sa = *satosin(rt_key(rt)); + sin = *satosin(rt_key(rt)); s = splsoftnet(); rtdeletemsg(rt, r->rtt_tableid); @@ -1045,7 +1045,7 @@ icmp_mtudisc_timeout(struct rtentry *rt, struct rttimer *r) /* Notify TCP layer of increased Path MTU estimate */ ctlfunc = inetsw[ip_protox[IPPROTO_TCP]].pr_ctlinput; if (ctlfunc) - (*ctlfunc)(PRC_MTUINC,(struct sockaddr *)&sa, + (*ctlfunc)(PRC_MTUINC, sintosa(&sin), r->rtt_tableid, NULL); splx(s); } else diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c index f55e79c606a..20c3fbedd8b 100644 --- a/sys/netinet/ip_mroute.c +++ b/sys/netinet/ip_mroute.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_mroute.c,v 1.80 2015/08/24 14:00:29 bluhm Exp $ */ +/* $OpenBSD: ip_mroute.c,v 1.81 2015/09/01 21:24:04 bluhm Exp $ */ /* $NetBSD: ip_mroute.c,v 1.85 2004/04/26 01:31:57 matt Exp $ */ /* @@ -2201,7 +2201,7 @@ pim_input(struct mbuf *m, ...) reg_vif_num); } /* NB: vifp was collected above; can it change on us? */ - looutput(vifp, m, (struct sockaddr *)&dst, NULL); + looutput(vifp, m, sintosa(&dst), NULL); /* prepare the register head to send to the mrouting daemon */ m = mcp; diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 4a61fef5fa6..b547a77844a 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_subr.c,v 1.146 2015/08/27 20:56:16 bluhm Exp $ */ +/* $OpenBSD: tcp_subr.c,v 1.147 2015/09/01 21:24:04 bluhm Exp $ */ /* $NetBSD: tcp_subr.c,v 1.22 1996/02/13 23:44:00 christos Exp $ */ /* @@ -850,8 +850,7 @@ tcp_ctlinput(int cmd, struct sockaddr *sa, u_int rdomain, void *v) sin.sin_family = AF_INET; sin.sin_port = th->th_sport; sin.sin_addr = ip->ip_src; - syn_cache_unreach((struct sockaddr *)&sin, - sa, th, rdomain); + syn_cache_unreach(sintosa(&sin), sa, th, rdomain); } } else in_pcbnotifyall(&tcbtable, sa, rdomain, errno, notify); |