diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2013-03-28 12:06:56 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2013-03-28 12:06:56 +0000 |
commit | 9efd0f3534a333b6ec869aaadab31ddf7a7bbd21 (patch) | |
tree | 74fbe07c4efd008ac112b2106d93a702ac9308e7 /sys/netinet | |
parent | 813f81ff28ebe684e9e8000017a775801e85afbb (diff) |
Replace some casts to struct in_ifaddr pointer by ifatoia() or NULL.
ok millert@, haesbaert@, bluhm@
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/in_pcb.c | 5 | ||||
-rw-r--r-- | sys/netinet/ip_input.c | 9 |
2 files changed, 6 insertions, 8 deletions
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index cc83efeafbf..b0882f574bb 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in_pcb.c,v 1.132 2013/03/28 00:32:11 bluhm Exp $ */ +/* $OpenBSD: in_pcb.c,v 1.133 2013/03/28 12:06:55 mpi Exp $ */ /* $NetBSD: in_pcb.c,v 1.25 1996/02/13 23:41:53 christos Exp $ */ /* @@ -789,9 +789,8 @@ in_selectsrc(struct sockaddr_in *sin, struct route *ro, int soopts, struct ip_moptions *mopts, int *errorp, u_int rtableid) { struct sockaddr_in *sin2; - struct in_ifaddr *ia; + struct in_ifaddr *ia = NULL; - ia = (struct in_ifaddr *)0; /* * If the destination address is multicast and an outgoing * interface has been set as a multicast option, use the diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index 3d8f38a3137..7c7aa4924e2 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_input.c,v 1.203 2013/03/28 00:32:11 bluhm Exp $ */ +/* $OpenBSD: ip_input.c,v 1.204 2013/03/28 12:06:55 mpi Exp $ */ /* $NetBSD: ip_input.c,v 1.30 1996/03/16 23:53:58 christos Exp $ */ /* @@ -688,8 +688,7 @@ in_ouraddr(struct in_addr ina, struct mbuf *m) sin.sin_len = sizeof(sin); sin.sin_family = AF_INET; sin.sin_addr = ina; - ia = (struct in_ifaddr *)ifa_ifwithaddr(sintosa(&sin), - m->m_pkthdr.rdomain); + ia = ifatoia(ifa_ifwithaddr(sintosa(&sin), m->m_pkthdr.rdomain)); if (ia == NULL) { /* @@ -745,7 +744,7 @@ in_iawithaddr(struct in_addr ina, u_int rdomain) sin.sin_len = sizeof(sin); sin.sin_family = AF_INET; sin.sin_addr = ina; - ia = (struct in_ifaddr *)ifa_ifwithaddr(sintosa(&sin), rdomain); + ia = ifatoia(ifa_ifwithaddr(sintosa(&sin), rdomain)); if (ia == NULL || ina.s_addr == ia->ia_addr.sin_addr.s_addr) return (ia); @@ -1256,7 +1255,7 @@ ip_rtaddr(struct in_addr dst, u_int rtableid) rtableid); } if (ipforward_rt.ro_rt == 0) - return ((struct in_ifaddr *)0); + return (NULL); return (ifatoia(ipforward_rt.ro_rt->rt_ifa)); } |