diff options
author | 2015-05-13 10:42:46 +0000 | |
---|---|---|
committer | 2015-05-13 10:42:46 +0000 | |
commit | 64a3f76c072dd81169df444ff036aa23170dc855 (patch) | |
tree | db48aba5bb3c00b3a39e7e31fd32bbec39bd06f6 /sys/netinet/ip_output.c | |
parent | Get rid of the last "#if NTRUNK" by overwriting trunk ports' output (diff) | |
download | wireguard-openbsd-64a3f76c072dd81169df444ff036aa23170dc855.tar.xz wireguard-openbsd-64a3f76c072dd81169df444ff036aa23170dc855.zip |
test mbuf pointers against NULL not 0
ok krw@ miod@
Diffstat (limited to 'sys/netinet/ip_output.c')
-rw-r--r-- | sys/netinet/ip_output.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index 92a45e5bcc8..4ec5b23e667 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_output.c,v 1.279 2015/04/17 11:04:01 mikeb Exp $ */ +/* $OpenBSD: ip_output.c,v 1.280 2015/05/13 10:42:46 jsg Exp $ */ /* $NetBSD: ip_output.c,v 1.28 1996/02/13 23:43:07 christos Exp $ */ /* @@ -750,7 +750,7 @@ ip_fragment(struct mbuf *m, struct ifnet *ifp, u_long mtu) mhlen = sizeof (struct ip); for (off = hlen + len; off < ntohs(ip->ip_len); off += len) { MGETHDR(m, M_DONTWAIT, MT_HEADER); - if (m == 0) { + if (m == NULL) { ipstat.ips_odropped++; error = ENOBUFS; goto sendorfree; @@ -848,7 +848,7 @@ ip_insertoptions(struct mbuf *m, struct mbuf *opt, int *phlen) ip->ip_dst = p->ipopt_dst; if (m->m_flags & M_EXT || m->m_data - optlen < m->m_pktdat) { MGETHDR(n, M_DONTWAIT, MT_HEADER); - if (n == 0) + if (n == NULL) return (m); M_MOVE_HDR(n, m); n->m_pkthdr.len += optlen; @@ -1022,7 +1022,7 @@ ip_ctloutput(int op, struct socket *so, int level, int optname, break; case IP_PORTRANGE: - if (m == 0 || m->m_len != sizeof(int)) + if (m == NULL || m->m_len != sizeof(int)) error = EINVAL; else { optval = *mtod(m, int *); @@ -1058,7 +1058,7 @@ ip_ctloutput(int op, struct socket *so, int level, int optname, #ifndef IPSEC error = EOPNOTSUPP; #else - if (m == 0 || m->m_len != sizeof(int)) { + if (m == NULL || m->m_len != sizeof(int)) { error = EINVAL; break; } @@ -1310,7 +1310,7 @@ ip_pcbopts(struct mbuf **pcbopt, struct mbuf *m) if (*pcbopt) (void)m_free(*pcbopt); *pcbopt = 0; - if (m == (struct mbuf *)0 || m->m_len == 0) { + if (m == (struct mbuf *)NULL || m->m_len == 0) { /* * Only turning off any previous options. */ |