summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ip_output.c
diff options
context:
space:
mode:
authorkrw <krw@openbsd.org>2015-06-07 01:25:27 +0000
committerkrw <krw@openbsd.org>2015-06-07 01:25:27 +0000
commit6d50da9dc49b3eb06c83c28255aab12d13329024 (patch)
treea5a9c2e3d52cd75f2ccb056cb96dcaab619994d4 /sys/netinet/ip_output.c
parentAdd some changes from Patrick Wildt in bitrig that are required to make (diff)
downloadwireguard-openbsd-6d50da9dc49b3eb06c83c28255aab12d13329024.tar.xz
wireguard-openbsd-6d50da9dc49b3eb06c83c28255aab12d13329024.zip
Replace a bunch of == 0 with == NULL in pointer tests. Nuke some
annoying trailing, leading and embedded whitespace. No change to .o files. ok deraadt@
Diffstat (limited to 'sys/netinet/ip_output.c')
-rw-r--r--sys/netinet/ip_output.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c
index 625c69578a1..960fc284624 100644
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_output.c,v 1.281 2015/05/23 12:52:59 markus Exp $ */
+/* $OpenBSD: ip_output.c,v 1.282 2015/06/07 01:25:27 krw Exp $ */
/* $NetBSD: ip_output.c,v 1.28 1996/02/13 23:43:07 christos Exp $ */
/*
@@ -164,7 +164,7 @@ ip_output(struct mbuf *m0, struct mbuf *opt, struct route *ro, int flags,
}
donerouting = 1;
- if (ro == 0) {
+ if (ro == NULL) {
ro = &iproute;
memset(ro, 0, sizeof(*ro));
}
@@ -182,7 +182,7 @@ ip_output(struct mbuf *m0, struct mbuf *opt, struct route *ro, int flags,
ro->ro_rt = NULL;
}
- if (ro->ro_rt == 0) {
+ if (ro->ro_rt == NULL) {
dst->sin_family = AF_INET;
dst->sin_len = sizeof(*dst);
dst->sin_addr = ip->ip_dst;
@@ -195,11 +195,11 @@ ip_output(struct mbuf *m0, struct mbuf *opt, struct route *ro, int flags,
mtu = ifp->if_mtu;
IFP_TO_IA(ifp, ia);
} else {
- if (ro->ro_rt == 0)
+ if (ro->ro_rt == NULL)
ro->ro_rt = rtalloc_mpath(&ro->ro_dst,
NULL, ro->ro_tableid);
- if (ro->ro_rt == 0) {
+ if (ro->ro_rt == NULL) {
ipstat.ips_noroute++;
error = EHOSTUNREACH;
goto bad;
@@ -297,7 +297,7 @@ reroute:
mtu = ifp->if_mtu;
ro->ro_rt = NULL;
} else if (donerouting == 0) {
- if (ro == 0) {
+ if (ro == NULL) {
ro = &iproute;
memset(ro, 0, sizeof(*ro));
}
@@ -315,7 +315,7 @@ reroute:
ro->ro_rt = NULL;
}
- if (ro->ro_rt == 0) {
+ if (ro->ro_rt == NULL) {
dst->sin_family = AF_INET;
dst->sin_len = sizeof(*dst);
dst->sin_addr = ip->ip_dst;
@@ -328,11 +328,11 @@ reroute:
mtu = ifp->if_mtu;
IFP_TO_IA(ifp, ia);
} else {
- if (ro->ro_rt == 0)
+ if (ro->ro_rt == NULL)
ro->ro_rt = rtalloc_mpath(&ro->ro_dst,
&ip->ip_src.s_addr, ro->ro_tableid);
- if (ro->ro_rt == 0) {
+ if (ro->ro_rt == NULL) {
ipstat.ips_noroute++;
error = EHOSTUNREACH;
goto bad;
@@ -1295,7 +1295,7 @@ ip_pcbopts(struct mbuf **pcbopt, struct mbuf *m)
if (*pcbopt)
(void)m_free(*pcbopt);
*pcbopt = 0;
- if (m == (struct mbuf *)NULL || m->m_len == 0) {
+ if (m == NULL || m->m_len == 0) {
/*
* Only turning off any previous options.
*/
@@ -1365,7 +1365,7 @@ ip_pcbopts(struct mbuf **pcbopt, struct mbuf *m)
*/
memmove((caddr_t)&cp[IPOPT_OFFSET+1],
(caddr_t)(&cp[IPOPT_OFFSET+1] +
- sizeof(struct in_addr)),
+ sizeof(struct in_addr)),
(unsigned)cnt - (IPOPT_OFFSET+1));
break;
}