summaryrefslogtreecommitdiff
path: root/sys/netinet
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2012-07-08 16:36:59 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2012-07-08 16:36:59 +0000
commitc9ee7a0265cb70748a8592d39507ffe384405694 (patch)
tree23fe605d13e48c5604e4678536374437fc18fbe0 /sys/netinet
parent720db33f11c15bfebc0e7110d31edb1a22bfe22d (diff)
Instead of casting interface address pointers, use the macros NULL
and ifatoia(). No binary diff. OK blambert@ henning@ claudio@
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/in.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/netinet/in.c b/sys/netinet/in.c
index d894227e95d..8044760b498 100644
--- a/sys/netinet/in.c
+++ b/sys/netinet/in.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in.c,v 1.70 2012/01/03 23:41:51 bluhm Exp $ */
+/* $OpenBSD: in.c,v 1.71 2012/07/08 16:36:58 bluhm Exp $ */
/* $NetBSD: in.c,v 1.26 1996/02/13 23:41:39 christos Exp $ */
/*
@@ -192,7 +192,7 @@ int
in_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp)
{
struct ifreq *ifr = (struct ifreq *)data;
- struct in_ifaddr *ia = 0;
+ struct in_ifaddr *ia = NULL;
struct in_aliasreq *ifra = (struct in_aliasreq *)data;
struct sockaddr_in oldaddr;
int error, hostIsNew, maskIsNew;
@@ -231,7 +231,7 @@ in_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp)
ifra->ifra_addr.sin_addr.s_addr)
break;
}
- if (cmd == SIOCDIFADDR && ia == 0)
+ if (cmd == SIOCDIFADDR && ia == NULL)
return (EADDRNOTAVAIL);
/* FALLTHROUGH */
case SIOCSIFADDR:
@@ -242,7 +242,7 @@ in_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp)
if (ifp == 0)
panic("in_control");
- if (ia == (struct in_ifaddr *)0) {
+ if (ia == NULL) {
ia = malloc(sizeof *ia, M_IFADDR, M_WAITOK | M_ZERO);
s = splsoftnet();
TAILQ_INSERT_TAIL(&in_ifaddr, ia, ia_list);
@@ -287,7 +287,7 @@ in_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp)
if (ia2 && ia2->ia_ifp == ifp)
ia = ia2;
}
- if (ia == (struct in_ifaddr *)0)
+ if (ia == NULL)
return (EADDRNOTAVAIL);
break;
}
@@ -585,7 +585,7 @@ in_lifaddr_ioctl(struct socket *so, u_long cmd, caddr_t data,
}
if (!ifa)
return EADDRNOTAVAIL;
- ia = (struct in_ifaddr *)ifa;
+ ia = ifatoia(ifa);
if (cmd == SIOCGLIFADDR) {
/* fill in the if_laddrreq structure */