aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorPedro F. Giffuni <pfg@FreeBSD.org>2016-04-15 17:30:33 +0000
committerPedro F. Giffuni <pfg@FreeBSD.org>2016-04-15 17:30:33 +0000
commit155d72c498e67b24097e8444a289a77be6eccf85 (patch)
tree98ee835e82a915a778aa14e68e7285dcd4e077f6 /sys
parent0d3e502f9213fcfd816ff4075505b41e978f106f (diff)
downloadsrc-155d72c498e67b24097e8444a289a77be6eccf85.tar.gz
src-155d72c498e67b24097e8444a289a77be6eccf85.zip
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/net/bpf_filter.c8
-rw-r--r--sys/net/if.c6
-rw-r--r--sys/net/if_arcsubr.c16
-rw-r--r--sys/net/if_atmsubr.c4
-rw-r--r--sys/net/if_bridge.c4
-rw-r--r--sys/net/if_disc.c2
-rw-r--r--sys/net/if_ethersubr.c4
-rw-r--r--sys/net/if_fddisubr.c8
-rw-r--r--sys/net/if_fwsubr.c12
-rw-r--r--sys/net/if_iso88025subr.c8
-rw-r--r--sys/net/if_loop.c2
-rw-r--r--sys/net/if_spppsubr.c6
-rw-r--r--sys/net/radix.c18
-rw-r--r--sys/net/raw_usrreq.c2
-rw-r--r--sys/netgraph/atm/ccatm/ng_ccatm.c2
-rw-r--r--sys/netgraph/ng_socket.c4
-rw-r--r--sys/netgraph/ng_source.c2
-rw-r--r--sys/netinet6/in6.c2
-rw-r--r--sys/netinet6/ip6_output.c10
-rw-r--r--sys/netinet6/nd6_rtr.c2
-rw-r--r--sys/netinet6/raw_ip6.c2
-rw-r--r--sys/netinet6/udp6_usrreq.c4
-rw-r--r--sys/netipsec/ipsec_mbuf.c2
-rw-r--r--sys/netipsec/key.c12
-rw-r--r--sys/netipsec/keysock.c8
-rw-r--r--sys/netipsec/xform_ipcomp.c2
26 files changed, 76 insertions, 76 deletions
diff --git a/sys/net/bpf_filter.c b/sys/net/bpf_filter.c
index 40498a9e603f..ab3198ab3ea0 100644
--- a/sys/net/bpf_filter.c
+++ b/sys/net/bpf_filter.c
@@ -99,7 +99,7 @@ m_xword(struct mbuf *m, bpf_u_int32 k, int *err)
while (k >= len) {
k -= len;
m = m->m_next;
- if (m == 0)
+ if (m == NULL)
goto bad;
len = m->m_len;
}
@@ -109,7 +109,7 @@ m_xword(struct mbuf *m, bpf_u_int32 k, int *err)
return (EXTRACT_LONG(cp));
}
m0 = m->m_next;
- if (m0 == 0 || m0->m_len + len - k < 4)
+ if (m0 == NULL || m0->m_len + len - k < 4)
goto bad;
*err = 0;
np = mtod(m0, u_char *);
@@ -148,7 +148,7 @@ m_xhalf(struct mbuf *m, bpf_u_int32 k, int *err)
while (k >= len) {
k -= len;
m = m->m_next;
- if (m == 0)
+ if (m == NULL)
goto bad;
len = m->m_len;
}
@@ -158,7 +158,7 @@ m_xhalf(struct mbuf *m, bpf_u_int32 k, int *err)
return (EXTRACT_SHORT(cp));
}
m0 = m->m_next;
- if (m0 == 0)
+ if (m0 == NULL)
goto bad;
*err = 0;
return ((cp[0] << 8) | mtod(m0, u_char *)[0]);
diff --git a/sys/net/if.c b/sys/net/if.c
index 2c44c87b009d..1a110932339a 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1948,8 +1948,8 @@ link_rtrequest(int cmd, struct rtentry *rt, struct rt_addrinfo *info)
struct sockaddr *dst;
struct ifnet *ifp;
- if (cmd != RTM_ADD || ((ifa = rt->rt_ifa) == 0) ||
- ((ifp = ifa->ifa_ifp) == 0) || ((dst = rt_key(rt)) == 0))
+ if (cmd != RTM_ADD || ((ifa = rt->rt_ifa) == NULL) ||
+ ((ifp = ifa->ifa_ifp) == NULL) || ((dst = rt_key(rt)) == NULL))
return;
ifa = ifaof_ifpforaddr(dst, ifp);
if (ifa) {
@@ -2139,7 +2139,7 @@ if_qflush(struct ifnet *ifp)
ALTQ_PURGE(ifq);
#endif
n = ifq->ifq_head;
- while ((m = n) != 0) {
+ while ((m = n) != NULL) {
n = m->m_nextpkt;
m_freem(m);
}
diff --git a/sys/net/if_arcsubr.c b/sys/net/if_arcsubr.c
index 16adba4e6cbf..14026b40351e 100644
--- a/sys/net/if_arcsubr.c
+++ b/sys/net/if_arcsubr.c
@@ -210,7 +210,7 @@ arc_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
isphds = arc_isphds(atype);
M_PREPEND(m, isphds ? ARC_HDRNEWLEN : ARC_HDRLEN, M_NOWAIT);
- if (m == 0)
+ if (m == NULL)
senderr(ENOBUFS);
ah = mtod(m, struct arc_header *);
ah->arc_type = atype;
@@ -261,12 +261,12 @@ arc_frag_next(struct ifnet *ifp)
struct arc_header *ah;
ac = (struct arccom *)ifp->if_l2com;
- if ((m = ac->curr_frag) == 0) {
+ if ((m = ac->curr_frag) == NULL) {
int tfrags;
/* dequeue new packet */
IF_DEQUEUE(&ifp->if_snd, m);
- if (m == 0)
+ if (m == NULL)
return 0;
ah = mtod(m, struct arc_header *);
@@ -296,7 +296,7 @@ arc_frag_next(struct ifnet *ifp)
}
M_PREPEND(m, ARC_HDRNEWLEN, M_NOWAIT);
- if (m == 0) {
+ if (m == NULL) {
m_freem(ac->curr_frag);
ac->curr_frag = 0;
return 0;
@@ -315,7 +315,7 @@ arc_frag_next(struct ifnet *ifp)
ac->curr_frag = 0;
M_PREPEND(m, ARC_HDRNEWLEN_EXC, M_NOWAIT);
- if (m == 0)
+ if (m == NULL)
return 0;
ah = mtod(m, struct arc_header *);
@@ -328,7 +328,7 @@ arc_frag_next(struct ifnet *ifp)
ac->curr_frag = 0;
M_PREPEND(m, ARC_HDRNEWLEN, M_NOWAIT);
- if (m == 0)
+ if (m == NULL)
return 0;
ah = mtod(m, struct arc_header *);
@@ -740,7 +740,7 @@ arc_resolvemulti(struct ifnet *ifp, struct sockaddr **llsa,
sdl = (struct sockaddr_dl *)sa;
if (*LLADDR(sdl) != arcbroadcastaddr)
return EADDRNOTAVAIL;
- *llsa = 0;
+ *llsa = NULL;
return 0;
#ifdef INET
case AF_INET:
@@ -763,7 +763,7 @@ arc_resolvemulti(struct ifnet *ifp, struct sockaddr **llsa,
* (This is used for multicast routers.)
*/
ifp->if_flags |= IFF_ALLMULTI;
- *llsa = 0;
+ *llsa = NULL;
return 0;
}
if (!IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr))
diff --git a/sys/net/if_atmsubr.c b/sys/net/if_atmsubr.c
index e1c4a6753973..2d38b8ada7e9 100644
--- a/sys/net/if_atmsubr.c
+++ b/sys/net/if_atmsubr.c
@@ -192,7 +192,7 @@ atm_output(struct ifnet *ifp, struct mbuf *m0, const struct sockaddr *dst,
if (atm_flags & ATM_PH_LLCSNAP)
sz += 8; /* sizeof snap == 8 */
M_PREPEND(m, sz, M_NOWAIT);
- if (m == 0)
+ if (m == NULL)
senderr(ENOBUFS);
ad = mtod(m, struct atm_pseudohdr *);
*ad = atmdst;
@@ -295,7 +295,7 @@ atm_input(struct ifnet *ifp, struct atm_pseudohdr *ah, struct mbuf *m,
struct atmllc *alc;
if (m->m_len < sizeof(*alc) &&
- (m = m_pullup(m, sizeof(*alc))) == 0)
+ (m = m_pullup(m, sizeof(*alc))) == NULL)
return; /* failed */
alc = mtod(m, struct atmllc *);
if (bcmp(alc, ATMLLC_HDR, 6)) {
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c
index c6bcfdf80fe0..6b037117ab93 100644
--- a/sys/net/if_bridge.c
+++ b/sys/net/if_bridge.c
@@ -3248,7 +3248,7 @@ bridge_pfil(struct mbuf **mp, struct ifnet *bifp, struct ifnet *ifp, int dir)
if (hlen < sizeof(struct ip))
goto bad;
if (hlen > (*mp)->m_len) {
- if ((*mp = m_pullup(*mp, hlen)) == 0)
+ if ((*mp = m_pullup(*mp, hlen)) == NULL)
goto bad;
ip = mtod(*mp, struct ip *);
if (ip == NULL)
@@ -3366,7 +3366,7 @@ bridge_ip_checkbasic(struct mbuf **mp)
goto bad;
}
if (hlen > m->m_len) {
- if ((m = m_pullup(m, hlen)) == 0) {
+ if ((m = m_pullup(m, hlen)) == NULL) {
KMOD_IPSTAT_INC(ips_badhlen);
goto bad;
}
diff --git a/sys/net/if_disc.c b/sys/net/if_disc.c
index b6e1d203d214..d7ea59ed426f 100644
--- a/sys/net/if_disc.c
+++ b/sys/net/if_disc.c
@@ -216,7 +216,7 @@ discioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
break;
case SIOCADDMULTI:
case SIOCDELMULTI:
- if (ifr == 0) {
+ if (ifr == NULL) {
error = EAFNOSUPPORT; /* XXX */
break;
}
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c
index 2d652ad8fc31..8698647a8603 100644
--- a/sys/net/if_ethersubr.c
+++ b/sys/net/if_ethersubr.c
@@ -1075,7 +1075,7 @@ ether_resolvemulti(struct ifnet *ifp, struct sockaddr **llsa,
e_addr = LLADDR(sdl);
if (!ETHER_IS_MULTICAST(e_addr))
return EADDRNOTAVAIL;
- *llsa = 0;
+ *llsa = NULL;
return 0;
#ifdef INET
@@ -1100,7 +1100,7 @@ ether_resolvemulti(struct ifnet *ifp, struct sockaddr **llsa,
* (This is used for multicast routers.)
*/
ifp->if_flags |= IFF_ALLMULTI;
- *llsa = 0;
+ *llsa = NULL;
return 0;
}
if (!IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr))
diff --git a/sys/net/if_fddisubr.c b/sys/net/if_fddisubr.c
index 84ee669ae254..1ebd4da44d6f 100644
--- a/sys/net/if_fddisubr.c
+++ b/sys/net/if_fddisubr.c
@@ -235,7 +235,7 @@ fddi_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
if (type != 0) {
struct llc *l;
M_PREPEND(m, LLC_SNAPFRAMELEN, M_NOWAIT);
- if (m == 0)
+ if (m == NULL)
senderr(ENOBUFS);
l = mtod(m, struct llc *);
l->llc_control = LLC_UI;
@@ -251,7 +251,7 @@ fddi_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
* allocate another.
*/
M_PREPEND(m, FDDI_HDR_LEN, M_NOWAIT);
- if (m == 0)
+ if (m == NULL)
senderr(ENOBUFS);
fh = mtod(m, struct fddi_header *);
fh->fddi_fc = FDDIFC_LLC_ASYNC|FDDIFC_LLC_PRIO4;
@@ -607,7 +607,7 @@ fddi_resolvemulti(ifp, llsa, sa)
e_addr = LLADDR(sdl);
if ((e_addr[0] & 1) != 1)
return (EADDRNOTAVAIL);
- *llsa = 0;
+ *llsa = NULL;
return (0);
#ifdef INET
@@ -634,7 +634,7 @@ fddi_resolvemulti(ifp, llsa, sa)
* (This is used for multicast routers.)
*/
ifp->if_flags |= IFF_ALLMULTI;
- *llsa = 0;
+ *llsa = NULL;
return (0);
}
if (!IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr))
diff --git a/sys/net/if_fwsubr.c b/sys/net/if_fwsubr.c
index a070f6176023..c2253d4ef0ae 100644
--- a/sys/net/if_fwsubr.c
+++ b/sys/net/if_fwsubr.c
@@ -132,7 +132,7 @@ firewire_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
}
destfw = (struct fw_hwaddr *)(mtag + 1);
} else {
- destfw = 0;
+ destfw = NULL;
}
switch (dst->sa_family) {
@@ -269,7 +269,7 @@ firewire_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
mtail = m_split(m, fsize, M_NOWAIT);
m_tag_copy_chain(mtail, m, M_NOWAIT);
} else {
- mtail = 0;
+ mtail = NULL;
}
/*
@@ -701,7 +701,7 @@ firewire_resolvemulti(struct ifnet *ifp, struct sockaddr **llsa,
/*
* No mapping needed.
*/
- *llsa = 0;
+ *llsa = NULL;
return 0;
#ifdef INET
@@ -709,7 +709,7 @@ firewire_resolvemulti(struct ifnet *ifp, struct sockaddr **llsa,
sin = (struct sockaddr_in *)sa;
if (!IN_MULTICAST(ntohl(sin->sin_addr.s_addr)))
return EADDRNOTAVAIL;
- *llsa = 0;
+ *llsa = NULL;
return 0;
#endif
#ifdef INET6
@@ -722,12 +722,12 @@ firewire_resolvemulti(struct ifnet *ifp, struct sockaddr **llsa,
* (This is used for multicast routers.)
*/
ifp->if_flags |= IFF_ALLMULTI;
- *llsa = 0;
+ *llsa = NULL;
return 0;
}
if (!IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr))
return EADDRNOTAVAIL;
- *llsa = 0;
+ *llsa = NULL;
return 0;
#endif
diff --git a/sys/net/if_iso88025subr.c b/sys/net/if_iso88025subr.c
index 466784fb075f..a96e2b9c6946 100644
--- a/sys/net/if_iso88025subr.c
+++ b/sys/net/if_iso88025subr.c
@@ -328,7 +328,7 @@ iso88025_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
if (snap_type != 0) {
struct llc *l;
M_PREPEND(m, LLC_SNAPFRAMELEN, M_NOWAIT);
- if (m == 0)
+ if (m == NULL)
senderr(ENOBUFS);
l = mtod(m, struct llc *);
l->llc_control = LLC_UI;
@@ -344,7 +344,7 @@ iso88025_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
* allocate another.
*/
M_PREPEND(m, ISO88025_HDR_LEN + rif_len, M_NOWAIT);
- if (m == 0)
+ if (m == NULL)
senderr(ENOBUFS);
th = mtod(m, struct iso88025_header *);
bcopy((caddr_t)edst, (caddr_t)&gen_th.iso88025_dhost, ISO88025_ADDR_LEN);
@@ -638,7 +638,7 @@ iso88025_resolvemulti (ifp, llsa, sa)
if ((e_addr[0] & 1) != 1) {
return (EADDRNOTAVAIL);
}
- *llsa = 0;
+ *llsa = NULL;
return (0);
#ifdef INET
@@ -664,7 +664,7 @@ iso88025_resolvemulti (ifp, llsa, sa)
* (This is used for multicast routers.)
*/
ifp->if_flags |= IFF_ALLMULTI;
- *llsa = 0;
+ *llsa = NULL;
return (0);
}
if (!IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr)) {
diff --git a/sys/net/if_loop.c b/sys/net/if_loop.c
index 1291f7b44d91..1623732ee420 100644
--- a/sys/net/if_loop.c
+++ b/sys/net/if_loop.c
@@ -380,7 +380,7 @@ loioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
case SIOCADDMULTI:
case SIOCDELMULTI:
- if (ifr == 0) {
+ if (ifr == NULL) {
error = EAFNOSUPPORT; /* XXX */
break;
}
diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c
index 841a0f20741e..092106e49d9d 100644
--- a/sys/net/if_spppsubr.c
+++ b/sys/net/if_spppsubr.c
@@ -4835,7 +4835,7 @@ sppp_get_ip_addrs(struct sppp *sp, u_long *src, u_long *dst, u_long *srcmask)
* Pick the first AF_INET address from the list,
* aliases don't make any sense on a p2p link anyway.
*/
- si = 0;
+ si = NULL;
if_addr_rlock(ifp);
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link)
if (ifa->ifa_addr->sa_family == AF_INET) {
@@ -4877,7 +4877,7 @@ sppp_set_ip_addr(struct sppp *sp, u_long src)
* Pick the first AF_INET address from the list,
* aliases don't make any sense on a p2p link anyway.
*/
- si = 0;
+ si = NULL;
if_addr_rlock(ifp);
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family == AF_INET) {
@@ -5055,7 +5055,7 @@ sppp_params(struct sppp *sp, u_long cmd, void *data)
struct spppreq *spr;
int rv = 0;
- if ((spr = malloc(sizeof(struct spppreq), M_TEMP, M_NOWAIT)) == 0)
+ if ((spr = malloc(sizeof(struct spppreq), M_TEMP, M_NOWAIT)) == NULL)
return (EAGAIN);
/*
* ifr->ifr_data is supposed to point to a struct spppreq.
diff --git a/sys/net/radix.c b/sys/net/radix.c
index 2b4b9542b58f..b17858e4a016 100644
--- a/sys/net/radix.c
+++ b/sys/net/radix.c
@@ -519,11 +519,11 @@ rn_addmask(void *n_arg, struct radix_mask_head *maskhead, int search, int skip)
*addmask_key = mlen;
x = rn_search(addmask_key, maskhead->head.rnh_treetop);
if (bcmp(addmask_key, x->rn_key, mlen) != 0)
- x = 0;
+ x = NULL;
if (x || search)
return (x);
R_Zalloc(x, struct radix_node *, RADIX_MAX_KEY_LEN + 2 * sizeof (*x));
- if ((saved_x = x) == 0)
+ if ((saved_x = x) == NULL)
return (0);
netmask = cp = (unsigned char *)(x + 2);
bcopy(addmask_key, cp, mlen);
@@ -599,7 +599,7 @@ rn_addroute(void *v_arg, void *n_arg, struct radix_head *head,
struct radix_node treenodes[2])
{
caddr_t v = (caddr_t)v_arg, netmask = (caddr_t)n_arg;
- struct radix_node *t, *x = 0, *tt;
+ struct radix_node *t, *x = NULL, *tt;
struct radix_node *saved_tt, *top = head->rnh_treetop;
short b = 0, b_leaf = 0;
int keyduplicated;
@@ -722,7 +722,7 @@ rn_addroute(void *v_arg, void *n_arg, struct radix_head *head,
for (mp = &x->rn_mklist; (m = *mp); mp = &m->rm_mklist)
if (m->rm_bit >= b_leaf)
break;
- t->rn_mklist = m; *mp = 0;
+ t->rn_mklist = m; *mp = NULL;
}
on2:
/* Add new route to highest possible ancestor's list */
@@ -785,7 +785,7 @@ rn_delete(void *v_arg, void *netmask_arg, struct radix_head *head)
vlen = LEN(v);
saved_tt = tt;
top = x;
- if (tt == 0 ||
+ if (tt == NULL ||
bcmp(v + head_off, tt->rn_key + head_off, vlen - head_off))
return (0);
/*
@@ -797,10 +797,10 @@ rn_delete(void *v_arg, void *netmask_arg, struct radix_head *head)
return (0);
netmask = x->rn_key;
while (tt->rn_mask != netmask)
- if ((tt = tt->rn_dupedkey) == 0)
+ if ((tt = tt->rn_dupedkey) == NULL)
return (0);
}
- if (tt->rn_mask == 0 || (saved_m = m = tt->rn_mklist) == 0)
+ if (tt->rn_mask == 0 || (saved_m = m = tt->rn_mklist) == NULL)
goto on1;
if (tt->rn_flags & RNF_NORMAL) {
if (m->rm_leaf != tt || m->rm_refs > 0) {
@@ -829,7 +829,7 @@ rn_delete(void *v_arg, void *netmask_arg, struct radix_head *head)
R_Free(m);
break;
}
- if (m == 0) {
+ if (m == NULL) {
log(LOG_ERR, "rn_delete: couldn't find our annotation\n");
if (tt->rn_flags & RNF_NORMAL)
return (0); /* Dangling ref to us */
@@ -1044,7 +1044,7 @@ rn_walktree_from(struct radix_head *h, void *a, void *m,
rn = rn->rn_left;
next = rn;
/* Process leaves */
- while ((rn = base) != 0) {
+ while ((rn = base) != NULL) {
base = rn->rn_dupedkey;
/* printf("leaf %p\n", rn); */
if (!(rn->rn_flags & RNF_ROOT)
diff --git a/sys/net/raw_usrreq.c b/sys/net/raw_usrreq.c
index 87bcd895a477..9e22528b7e98 100644
--- a/sys/net/raw_usrreq.c
+++ b/sys/net/raw_usrreq.c
@@ -83,7 +83,7 @@ raw_input_ext(struct mbuf *m0, struct sockproto *proto, struct sockaddr *src,
struct mbuf *m = m0;
struct socket *last;
- last = 0;
+ last = NULL;
mtx_lock(&rawcb_mtx);
LIST_FOREACH(rp, &V_rawcb_list, list) {
if (rp->rcb_proto.sp_family != proto->sp_family)
diff --git a/sys/netgraph/atm/ccatm/ng_ccatm.c b/sys/netgraph/atm/ccatm/ng_ccatm.c
index cdbc86f86331..cc3f7519289f 100644
--- a/sys/netgraph/atm/ccatm/ng_ccatm.c
+++ b/sys/netgraph/atm/ccatm/ng_ccatm.c
@@ -441,7 +441,7 @@ send_dump(struct ccdata *data, void *uarg, const char *buf)
m->m_pkthdr.len = 0;
} else {
m = m_getcl(M_NOWAIT, MT_DATA, 0);
- if (m == 0) {
+ if (m == NULL) {
m_freem(priv->dump_first);
return (ENOBUFS);
}
diff --git a/sys/netgraph/ng_socket.c b/sys/netgraph/ng_socket.c
index 38da313b836a..76d6383f0fb8 100644
--- a/sys/netgraph/ng_socket.c
+++ b/sys/netgraph/ng_socket.c
@@ -360,7 +360,7 @@ ngc_bind(struct socket *so, struct sockaddr *nam, struct thread *td)
{
struct ngpcb *const pcbp = sotongpcb(so);
- if (pcbp == 0)
+ if (pcbp == NULL)
return (EINVAL);
return (ng_bind(nam, pcbp));
}
@@ -474,7 +474,7 @@ ngd_connect(struct socket *so, struct sockaddr *nam, struct thread *td)
{
struct ngpcb *const pcbp = sotongpcb(so);
- if (pcbp == 0)
+ if (pcbp == NULL)
return (EINVAL);
return (ng_connect_data(nam, pcbp));
}
diff --git a/sys/netgraph/ng_source.c b/sys/netgraph/ng_source.c
index 1883ec021ac3..8332d20f9f28 100644
--- a/sys/netgraph/ng_source.c
+++ b/sys/netgraph/ng_source.c
@@ -294,7 +294,7 @@ ng_source_newhook(node_p node, hook_p hook, const char *name)
sc->input = hook;
} else if (strcmp(name, NG_SOURCE_HOOK_OUTPUT) == 0) {
sc->output = hook;
- sc->output_ifp = 0;
+ sc->output_ifp = NULL;
bzero(&sc->stats, sizeof(sc->stats));
} else
return (EINVAL);
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c
index 797093a5be1d..48f05e73fbaa 100644
--- a/sys/netinet6/in6.c
+++ b/sys/netinet6/in6.c
@@ -1823,7 +1823,7 @@ in6_ifawithifp(struct ifnet *ifp, struct in6_addr *dst)
{
int dst_scope = in6_addrscope(dst), blen = -1, tlen;
struct ifaddr *ifa;
- struct in6_ifaddr *besta = 0;
+ struct in6_ifaddr *besta = NULL;
struct in6_ifaddr *dep[2]; /* last-resort: deprecated */
dep[0] = dep[1] = NULL;
diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c
index 7895139c6b85..f64d305f626a 100644
--- a/sys/netinet6/ip6_output.c
+++ b/sys/netinet6/ip6_output.c
@@ -256,7 +256,7 @@ ip6_fragment(struct ifnet *ifp, struct mbuf *m0, int hlen, u_char nextproto,
ip6f->ip6f_offlg |= IP6F_MORE_FRAG;
mhip6->ip6_plen = htons((u_short)(mtu + hlen +
sizeof(*ip6f) - sizeof(struct ip6_hdr)));
- if ((m_frgpart = m_copy(m0, off, mtu)) == 0) {
+ if ((m_frgpart = m_copy(m0, off, mtu)) == NULL) {
IP6STAT_INC(ip6s_odropped);
return (ENOBUFS);
}
@@ -503,7 +503,7 @@ ip6_output(struct mbuf *m0, struct ip6_pktopts *opt,
/*
* Route packet.
*/
- if (ro == 0) {
+ if (ro == NULL) {
ro = &ip6route;
bzero((caddr_t)ro, sizeof(*ro));
}
@@ -1116,7 +1116,7 @@ ip6_insert_jumboopt(struct ip6_exthdrs *exthdrs, u_int32_t plen)
* jumbo payload option, allocate a cluster to store the whole options.
* Otherwise, use it to store the options.
*/
- if (exthdrs->ip6e_hbh == 0) {
+ if (exthdrs->ip6e_hbh == NULL) {
mopt = m_get(M_NOWAIT, MT_DATA);
if (mopt == NULL)
return (ENOBUFS);
@@ -1198,7 +1198,7 @@ ip6_insertfraghdr(struct mbuf *m0, struct mbuf *m, int hlen,
if (hlen > sizeof(struct ip6_hdr)) {
n = m_copym(m0, sizeof(struct ip6_hdr),
hlen - sizeof(struct ip6_hdr), M_NOWAIT);
- if (n == 0)
+ if (n == NULL)
return (ENOBUFS);
m->m_next = n;
} else
@@ -2515,7 +2515,7 @@ int
ip6_setpktopts(struct mbuf *control, struct ip6_pktopts *opt,
struct ip6_pktopts *stickyopt, struct ucred *cred, int uproto)
{
- struct cmsghdr *cm = 0;
+ struct cmsghdr *cm = NULL;
if (control == NULL || opt == NULL)
return (EINVAL);
diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c
index 6fee83013ff5..aa7baad85402 100644
--- a/sys/netinet6/nd6_rtr.c
+++ b/sys/netinet6/nd6_rtr.c
@@ -1510,7 +1510,7 @@ pfxlist_onlink_check()
find_pfxlist_reachable_router(pr) == NULL)
pr->ndpr_stateflags |= NDPRF_DETACHED;
if ((pr->ndpr_stateflags & NDPRF_DETACHED) != 0 &&
- find_pfxlist_reachable_router(pr) != 0)
+ find_pfxlist_reachable_router(pr) != NULL)
pr->ndpr_stateflags &= ~NDPRF_DETACHED;
}
} else {
diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c
index 972eb9f1d9ee..2b95e4811fec 100644
--- a/sys/netinet6/raw_ip6.c
+++ b/sys/netinet6/raw_ip6.c
@@ -163,7 +163,7 @@ rip6_input(struct mbuf **mp, int *offp, int proto)
struct mbuf *m = *mp;
register struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *);
register struct inpcb *in6p;
- struct inpcb *last = 0;
+ struct inpcb *last = NULL;
struct mbuf *opts = NULL;
struct sockaddr_in6 fromsa;
diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c
index ebcf6d6738b9..03479fdbdb40 100644
--- a/sys/netinet6/udp6_usrreq.c
+++ b/sys/netinet6/udp6_usrreq.c
@@ -1212,9 +1212,9 @@ udp6_send(struct socket *so, int flags, struct mbuf *m,
#ifdef INET
if ((inp->inp_flags & IN6P_IPV6_V6ONLY) == 0) {
int hasv4addr;
- struct sockaddr_in6 *sin6 = 0;
+ struct sockaddr_in6 *sin6 = NULL;
- if (addr == 0)
+ if (addr == NULL)
hasv4addr = (inp->inp_vflag & INP_IPV4);
else {
sin6 = (struct sockaddr_in6 *)addr;
diff --git a/sys/netipsec/ipsec_mbuf.c b/sys/netipsec/ipsec_mbuf.c
index b3df0e01cc50..7111210d1159 100644
--- a/sys/netipsec/ipsec_mbuf.c
+++ b/sys/netipsec/ipsec_mbuf.c
@@ -202,7 +202,7 @@ m_pad(struct mbuf *m, int n)
if (pad > M_TRAILINGSPACE(m0)) {
/* Add an mbuf to the chain. */
MGET(m1, M_NOWAIT, MT_DATA);
- if (m1 == 0) {
+ if (m1 == NULL) {
m_freem(m0);
DPRINTF(("%s: unable to get extra mbuf\n", __func__));
return NULL;
diff --git a/sys/netipsec/key.c b/sys/netipsec/key.c
index 865a63084bcc..7070c1df4510 100644
--- a/sys/netipsec/key.c
+++ b/sys/netipsec/key.c
@@ -4923,8 +4923,8 @@ key_update(struct socket *so, struct mbuf *m, const struct sadb_msghdr *mhp)
dport = (struct sadb_x_nat_t_port *)
mhp->ext[SADB_X_EXT_NAT_T_DPORT];
} else {
- type = 0;
- sport = dport = 0;
+ type = NULL;
+ sport = dport = NULL;
}
if (mhp->ext[SADB_X_EXT_NAT_T_OAI] != NULL &&
mhp->ext[SADB_X_EXT_NAT_T_OAR] != NULL) {
@@ -4949,7 +4949,7 @@ key_update(struct socket *so, struct mbuf *m, const struct sadb_msghdr *mhp)
frag = (struct sadb_x_nat_t_frag *)
mhp->ext[SADB_X_EXT_NAT_T_FRAG];
} else {
- frag = 0;
+ frag = NULL;
}
#endif
@@ -5215,7 +5215,7 @@ key_add(struct socket *so, struct mbuf *m, const struct sadb_msghdr *mhp)
KEY_PORTTOSADDR(&saidx.dst,
dport->sadb_x_nat_t_port_port);
} else {
- type = 0;
+ type = NULL;
}
if (mhp->ext[SADB_X_EXT_NAT_T_OAI] != NULL &&
mhp->ext[SADB_X_EXT_NAT_T_OAR] != NULL) {
@@ -5240,7 +5240,7 @@ key_add(struct socket *so, struct mbuf *m, const struct sadb_msghdr *mhp)
frag = (struct sadb_x_nat_t_frag *)
mhp->ext[SADB_X_EXT_NAT_T_FRAG];
} else {
- frag = 0;
+ frag = NULL;
}
#endif
@@ -6599,7 +6599,7 @@ key_acquire2(struct socket *so, struct mbuf *m, const struct sadb_msghdr *mhp)
static int
key_register(struct socket *so, struct mbuf *m, const struct sadb_msghdr *mhp)
{
- struct secreg *reg, *newreg = 0;
+ struct secreg *reg, *newreg = NULL;
IPSEC_ASSERT(so != NULL, ("null socket"));
IPSEC_ASSERT(m != NULL, ("null mbuf"));
diff --git a/sys/netipsec/keysock.c b/sys/netipsec/keysock.c
index 4d1295764b6e..73e54bb3de32 100644
--- a/sys/netipsec/keysock.c
+++ b/sys/netipsec/keysock.c
@@ -92,7 +92,7 @@ key_output(struct mbuf *m, struct socket *so, ...)
struct sadb_msg *msg;
int len, error = 0;
- if (m == 0)
+ if (m == NULL)
panic("%s: NULL pointer was passed.\n", __func__);
PFKEYSTAT_INC(out_total);
@@ -106,7 +106,7 @@ key_output(struct mbuf *m, struct socket *so, ...)
}
if (m->m_len < sizeof(struct sadb_msg)) {
- if ((m = m_pullup(m, sizeof(struct sadb_msg))) == 0) {
+ if ((m = m_pullup(m, sizeof(struct sadb_msg))) == NULL) {
PFKEYSTAT_INC(out_nomem);
error = ENOBUFS;
goto end;
@@ -178,7 +178,7 @@ key_sendup(struct socket *so, struct sadb_msg *msg, u_int len, int target)
int tlen;
/* sanity check */
- if (so == 0 || msg == 0)
+ if (so == NULL || msg == NULL)
panic("%s: NULL pointer was passed.\n", __func__);
KEYDEBUG(KEYDEBUG_KEY_DUMP,
@@ -388,7 +388,7 @@ key_attach(struct socket *so, int proto, struct thread *td)
/* XXX */
kp = malloc(sizeof *kp, M_PCB, M_WAITOK | M_ZERO);
- if (kp == 0)
+ if (kp == NULL)
return ENOBUFS;
so->so_pcb = (caddr_t)kp;
diff --git a/sys/netipsec/xform_ipcomp.c b/sys/netipsec/xform_ipcomp.c
index 122fc7261378..ae19d8d05e64 100644
--- a/sys/netipsec/xform_ipcomp.c
+++ b/sys/netipsec/xform_ipcomp.c
@@ -283,7 +283,7 @@ ipcomp_input_cb(struct cryptop *crp)
/* In case it's not done already, adjust the size of the mbuf chain */
m->m_pkthdr.len = clen + hlen + skip;
- if (m->m_len < skip + hlen && (m = m_pullup(m, skip + hlen)) == 0) {
+ if (m->m_len < skip + hlen && (m = m_pullup(m, skip + hlen)) == NULL) {
IPCOMPSTAT_INC(ipcomps_hdrops); /*XXX*/
DPRINTF(("%s: m_pullup failed\n", __func__));
error = EINVAL; /*XXX*/