diff --git sys/net/bpf.c sys/net/bpf.c
index 87a9d726423..87418c3dc17 100644
--- sys/net/bpf.c
+++ sys/net/bpf.c
@@ -1019,7 +1019,7 @@ bpf_setf(struct bpf_d *d, struct bpf_program *fp, int wf)
KERNEL_ASSERT_LOCKED();
- if (fp->bf_insns == 0) {
+ if (fp->bf_insns == NULL) {
if (fp->bf_len != 0)
return (EINVAL);
bps = NULL;
diff --git sys/net/if.c sys/net/if.c
index 8fe99eff4df..6bd8899561c 100644
--- sys/net/if.c
+++ sys/net/if.c
@@ -1440,7 +1440,8 @@ ifaof_ifpforaddr(struct sockaddr *addr, struct ifnet *ifp)
continue;
if (ifa_maybe == NULL)
ifa_maybe = ifa;
- if (ifa->ifa_netmask == 0 || ifp->if_flags & IFF_POINTOPOINT) {
+ if (ifa->ifa_netmask == NULL ||
+ ifp->if_flags & IFF_POINTOPOINT) {
if (equal(addr, ifa->ifa_addr) ||
(ifa->ifa_dstaddr && equal(addr, ifa->ifa_dstaddr)))
return (ifa);
diff --git sys/net/if_mpip.c sys/net/if_mpip.c
index a8daeeea314..fe155eb18d8 100644
--- sys/net/if_mpip.c
+++ sys/net/if_mpip.c
@@ -96,7 +96,7 @@ mpip_clone_create(struct if_clone *ifc, int unit)
sc->sc_txhprio = 0;
sc->sc_rxhprio = IF_HDRPRIO_PACKET;
- sc->sc_neighbor = 0;
+ sc->sc_neighbor = NULL;
sc->sc_cword = 0; /* default to no control word */
sc->sc_fword = 0; /* both sides have to agree on FAT first */
sc->sc_flow = arc4random() & 0xfffff;
diff --git sys/net/if_ppp.c sys/net/if_ppp.c
index fb32d9ea9ef..c3b6d9051b7 100644
--- sys/net/if_ppp.c
+++ sys/net/if_ppp.c
@@ -324,21 +324,21 @@ pppdealloc(struct ppp_softc *sc)
sc->sc_rc_state = NULL;
#endif /* PPP_COMPRESS */
#if NBPFILTER > 0
- if (sc->sc_pass_filt.bf_insns != 0) {
+ if (sc->sc_pass_filt.bf_insns != NULL) {
free(sc->sc_pass_filt.bf_insns, M_DEVBUF, 0);
- sc->sc_pass_filt.bf_insns = 0;
+ sc->sc_pass_filt.bf_insns = NULL;
sc->sc_pass_filt.bf_len = 0;
}
- if (sc->sc_active_filt.bf_insns != 0) {
+ if (sc->sc_active_filt.bf_insns != NULL) {
free(sc->sc_active_filt.bf_insns, M_DEVBUF, 0);
- sc->sc_active_filt.bf_insns = 0;
+ sc->sc_active_filt.bf_insns = NULL;
sc->sc_active_filt.bf_len = 0;
}
#endif
#ifdef VJC
- if (sc->sc_comp != 0) {
+ if (sc->sc_comp != NULL) {
free(sc->sc_comp, M_DEVBUF, 0);
- sc->sc_comp = 0;
+ sc->sc_comp = NULL;
}
#endif
NET_UNLOCK();
@@ -538,7 +538,7 @@ pppioctl(struct ppp_softc *sc, u_long cmd, caddr_t data,
int flag,
return EINVAL;
}
} else
- newcode = 0;
+ newcode = NULL;
bp = (cmd == PPPIOCSPASS) ?
&sc->sc_pass_filt : &sc->sc_active_filt;
oldcode = bp->bf_insns;
@@ -546,7 +546,7 @@ pppioctl(struct ppp_softc *sc, u_long cmd, caddr_t data,
int flag,
bp->bf_len = nbp->bf_len;
bp->bf_insns = newcode;
splx(s);
- if (oldcode != 0)
+ if (oldcode != NULL)
free(oldcode, M_DEVBUF, 0);
break;
#endif
@@ -730,7 +730,7 @@ pppoutput(struct ifnet *ifp, struct mbuf *m0, struct
sockaddr *dst,
* but only if it is a data packet.
*/
*mtod(m0, u_char *) = 1; /* indicates outbound */
- if (sc->sc_pass_filt.bf_insns != 0 &&
+ if (sc->sc_pass_filt.bf_insns != NULL &&
bpf_filter(sc->sc_pass_filt.bf_insns, (u_char *)m0,
len, 0) == 0) {
error = 0; /* drop this packet */
@@ -740,7 +740,7 @@ pppoutput(struct ifnet *ifp, struct mbuf *m0, struct
sockaddr *dst,
/*
* Update the time we sent the most recent packet.
*/
- if (sc->sc_active_filt.bf_insns == 0 ||
+ if (sc->sc_active_filt.bf_insns == NULL ||
bpf_filter(sc->sc_active_filt.bf_insns, (u_char *)m0,
len, 0))
sc->sc_last_sent = getuptime();
@@ -1254,7 +1254,7 @@ ppp_inproc(struct ppp_softc *sc, struct mbuf *m)
* See if we have a VJ-compressed packet to uncompress.
*/
if (proto == PPP_VJC_COMP) {
- if ((sc->sc_flags & SC_REJ_COMP_TCP) || sc->sc_comp == 0)
+ if ((sc->sc_flags & SC_REJ_COMP_TCP) || sc->sc_comp == NULL)
goto bad;
xlen = sl_uncompress_tcp_core(cp + PPP_HDRLEN,
@@ -1311,7 +1311,7 @@ ppp_inproc(struct ppp_softc *sc, struct mbuf *m)
ilen += hlen - xlen;
} else if (proto == PPP_VJC_UNCOMP) {
- if ((sc->sc_flags & SC_REJ_COMP_TCP) || sc->sc_comp == 0)
+ if ((sc->sc_flags & SC_REJ_COMP_TCP) || sc->sc_comp == NULL)
goto bad;
xlen = sl_uncompress_tcp_core(cp + PPP_HDRLEN,
@@ -1345,14 +1345,14 @@ ppp_inproc(struct ppp_softc *sc, struct mbuf *m)
*/
adrs = *mtod(m, u_char *); /* save address field */
*mtod(m, u_char *) = 0; /* indicate inbound */
- if (sc->sc_pass_filt.bf_insns != 0 &&
+ if (sc->sc_pass_filt.bf_insns != NULL &&
bpf_filter(sc->sc_pass_filt.bf_insns, (u_char *) m,
ilen, 0) == 0) {
/* drop this packet */
m_freem(m);
return;
}
- if (sc->sc_active_filt.bf_insns == 0 ||
+ if (sc->sc_active_filt.bf_insns == NULL ||
bpf_filter(sc->sc_active_filt.bf_insns, (u_char *)m,
ilen, 0))
sc->sc_last_recv = getuptime();
diff --git sys/net/if_spppsubr.c sys/net/if_spppsubr.c
index ac1dc9a709d..9149c53ca5c 100644
--- sys/net/if_spppsubr.c
+++ sys/net/if_spppsubr.c
@@ -375,7 +375,7 @@ static const struct cp ipv6cp = {
static const struct cp pap = {
PPP_PAP, IDX_PAP, CP_AUTH, "pap",
sppp_null, sppp_null, sppp_pap_open, sppp_pap_close,
- sppp_pap_TO, 0, 0, 0,
+ sppp_pap_TO, NULL, NULL, NULL,
sppp_pap_tlu, sppp_pap_tld, sppp_null, sppp_null,
sppp_pap_scr
};
@@ -383,7 +383,7 @@ static const struct cp pap = {
static const struct cp chap = {
PPP_CHAP, IDX_CHAP, CP_AUTH, "chap",
sppp_null, sppp_null, sppp_chap_open, sppp_chap_close,
- sppp_chap_TO, 0, 0, 0,
+ sppp_chap_TO, NULL, NULL, NULL,
sppp_chap_tlu, sppp_chap_tld, sppp_null, sppp_null,
sppp_chap_scr
};
@@ -993,7 +993,7 @@ sppp_cp_input(const struct cp *cp, struct sppp *sp, struct
mbuf *m)
return;
case STATE_CLOSED:
sppp_cp_send(sp, cp->proto, TERM_ACK, h->ident,
- 0, 0);
+ 0, NULL);
return;
}
rv = (cp->RCR)(sp, h, len);
@@ -1049,7 +1049,8 @@ sppp_cp_input(const struct cp *cp, struct sppp *sp,
struct mbuf *m)
switch (sp->state[cp->protoidx]) {
case STATE_CLOSED:
case STATE_STOPPED:
- sppp_cp_send(sp, cp->proto, TERM_ACK, h->ident, 0, 0);
+ sppp_cp_send(sp, cp->proto, TERM_ACK, h->ident, 0,
+ NULL);
break;
case STATE_CLOSING:
case STATE_STOPPING:
@@ -1101,7 +1102,8 @@ sppp_cp_input(const struct cp *cp, struct sppp *sp,
struct mbuf *m)
switch (sp->state[cp->protoidx]) {
case STATE_CLOSED:
case STATE_STOPPED:
- sppp_cp_send(sp, cp->proto, TERM_ACK, h->ident, 0, 0);
+ sppp_cp_send(sp, cp->proto, TERM_ACK, h->ident, 0,
+ NULL);
break;
case STATE_REQ_SENT:
case STATE_ACK_SENT:
@@ -1145,7 +1147,8 @@ sppp_cp_input(const struct cp *cp, struct sppp *sp,
struct mbuf *m)
if (debug)
log(LOG_DEBUG, SPP_FMT "%s send
terminate-ack\n",
SPP_ARGS(ifp), cp->name);
- sppp_cp_send(sp, cp->proto, TERM_ACK, h->ident, 0, 0);
+ sppp_cp_send(sp, cp->proto, TERM_ACK, h->ident, 0,
+ NULL);
break;
case STATE_OPENED:
sp->rst_counter[cp->protoidx] = 0;
@@ -1473,14 +1476,14 @@ sppp_close_event(const struct cp *cp, struct sppp *sp)
case STATE_OPENED:
sppp_cp_change_state(cp, sp, STATE_CLOSING);
sp->rst_counter[cp->protoidx] = sp->lcp.max_terminate;
- sppp_cp_send(sp, cp->proto, TERM_REQ, ++sp->pp_seq, 0, 0);
+ sppp_cp_send(sp, cp->proto, TERM_REQ, ++sp->pp_seq, 0, NULL);
(cp->tld)(sp);
break;
case STATE_REQ_SENT:
case STATE_ACK_RCVD:
case STATE_ACK_SENT:
sp->rst_counter[cp->protoidx] = sp->lcp.max_terminate;
- sppp_cp_send(sp, cp->proto, TERM_REQ, ++sp->pp_seq, 0, 0);
+ sppp_cp_send(sp, cp->proto, TERM_REQ, ++sp->pp_seq, 0, NULL);
sppp_cp_change_state(cp, sp, STATE_CLOSING);
break;
}
@@ -1534,7 +1537,7 @@ sppp_to_event(const struct cp *cp, struct sppp *sp)
case STATE_CLOSING:
case STATE_STOPPING:
sppp_cp_send(sp, cp->proto, TERM_REQ, ++sp->pp_seq,
- 0, 0);
+ 0, NULL);
sppp_increasing_timeout (cp, sp);
break;
case STATE_REQ_SENT:
@@ -2382,7 +2385,7 @@ sppp_ipcp_RCR(struct sppp *sp, struct lcp_header *h, int
len)
if (sp->ipcp.flags & IPCP_HISADDR_SEEN)
hisaddr = sp->ipcp.req_hisaddr; /* we already agreed on that */
else
- sppp_get_ip_addrs(sp, 0, &hisaddr, 0); /* user configuration */
+ sppp_get_ip_addrs(sp, NULL, &hisaddr, NULL); /* user
configuration */
if (debug)
log(LOG_DEBUG, SPP_FMT "ipcp parse opt values: ",
SPP_ARGS(ifp));
@@ -2613,7 +2616,7 @@ sppp_ipcp_tls(struct sppp *sp)
sp->ipcp.req_myaddr = 0;
sp->ipcp.req_hisaddr = 0;
- sppp_get_ip_addrs(sp, &myaddr, &hisaddr, 0);
+ sppp_get_ip_addrs(sp, &myaddr, &hisaddr, NULL);
/*
* If we don't have his address, this probably means our
* interface doesn't want to talk IP at all. (This could
@@ -2683,7 +2686,7 @@ sppp_ipcp_scr(struct sppp *sp)
/* not sure if this can ever happen */
ouraddr = sp->ipcp.req_myaddr;
else
- sppp_get_ip_addrs(sp, &ouraddr, 0, 0);
+ sppp_get_ip_addrs(sp, &ouraddr, NULL, NULL);
opt[i++] = IPCP_OPT_ADDRESS;
opt[i++] = 6;
opt[i++] = ouraddr >> 24;
@@ -4114,7 +4117,7 @@ sppp_get_ip_addrs(struct sppp *sp, u_int32_t *src,
u_int32_t *dst,
{
struct ifnet *ifp = &sp->pp_if;
struct ifaddr *ifa;
- struct sockaddr_in *si, *sm = 0;
+ struct sockaddr_in *si, *sm = NULL;
u_int32_t ssrc, ddst;
sm = NULL;
@@ -4123,7 +4126,7 @@ sppp_get_ip_addrs(struct sppp *sp, u_int32_t *src,
u_int32_t *dst,
* Pick the first AF_INET address from the list,
* aliases don't make any sense on a p2p link anyway.
*/
- si = 0;
+ si = NULL;
TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list)
{
if (ifa->ifa_addr->sa_family == AF_INET) {
@@ -4206,7 +4209,7 @@ sppp_set_ip_addrs(void *arg1)
* aliases don't make any sense on a p2p link anyway.
*/
- si = 0;
+ si = NULL;
TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list)
{
if (ifa->ifa_addr->sa_family == AF_INET)
@@ -4267,14 +4270,14 @@ sppp_clear_ip_addrs(void *arg1)
if (sp->ipcp.flags & IPCP_HISADDR_DYN)
remote = sp->ipcp.saved_hisaddr;
else
- sppp_get_ip_addrs(sp, 0, &remote, 0);
+ sppp_get_ip_addrs(sp, NULL, &remote, NULL);
/*
* Pick the first AF_INET address from the list,
* aliases don't make any sense on a p2p link anyway.
*/
- si = 0;
+ si = NULL;
TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list) {
if (ifa->ifa_addr->sa_family == AF_INET) {
si = (struct sockaddr_in *)ifa->ifa_addr;
diff --git sys/net/if_vxlan.c sys/net/if_vxlan.c
index 8d7fae6888b..4d1ce983698 100644
--- sys/net/if_vxlan.c
+++ sys/net/if_vxlan.c
@@ -950,7 +950,7 @@ vxlan_output(struct ifnet *ifp, struct mbuf *m)
break;
#ifdef INET6
case AF_INET6:
- error = ip6_output(m, 0, NULL, IPV6_MINMTU, 0, NULL);
+ error = ip6_output(m, NULL, NULL, IPV6_MINMTU, NULL, NULL);
break;
#endif /* INET6 */
default:
diff --git sys/net/pf_table.c sys/net/pf_table.c
index b275cc2c66a..cf9e5307757 100644
--- sys/net/pf_table.c
+++ sys/net/pf_table.c
@@ -2113,7 +2113,7 @@ pfr_kentry_byaddr(struct pfr_ktable *kt, struct pf_addr
*a, sa_family_t af,
kt = pfr_ktable_select_active(kt);
if (kt == NULL)
- return (0);
+ return (NULL);
switch (af) {
case AF_INET:
diff --git sys/net/pfkeyv2.c sys/net/pfkeyv2.c
index 336619f4c89..767a79d8fd8 100644
--- sys/net/pfkeyv2.c
+++ sys/net/pfkeyv2.c
@@ -1232,7 +1232,7 @@ pfkeyv2_send(struct socket *so, void *message, int len)
sa1->tdb_satype = smsg->sadb_msg_satype;
if ((rval = pfkeyv2_get_proto_alg(sa1->tdb_satype,
- &sa1->tdb_sproto, 0)))
+ &sa1->tdb_sproto, NULL)))
goto ret;
import_address(&sa1->tdb_src.sa, headers[SADB_EXT_ADDRESS_SRC]);
@@ -2602,7 +2602,7 @@ pfkeyv2_sysctl_policydumper(struct ipsec_policy *ipo,
void *arg,
unsigned int tableid)
{
struct pfkeyv2_sysctl_walk *w = (struct pfkeyv2_sysctl_walk *)arg;
- void *buffer = 0;
+ void *buffer = NULL;
int i, buflen, error = 0;
if (w->w_where) {
diff --git sys/net/radix.c sys/net/radix.c
index 37dc255537f..d8780cb666d 100644
--- sys/net/radix.c
+++ sys/net/radix.c
@@ -185,7 +185,7 @@ struct radix_node *
rn_lookup(void *v_arg, void *m_arg, struct radix_node_head *head)
{
struct radix_node *x, *tm;
- caddr_t netmask = 0;
+ caddr_t netmask = NULL;
if (m_arg) {
tm = rn_addmask(m_arg, 1, head->rnh_treetop->rn_off);
@@ -450,7 +450,7 @@ rn_addmask(void *n_arg, int search, int skip)
return (tm);
tm = malloc(max_keylen + 2 * sizeof(*tm), M_RTABLE, M_NOWAIT | M_ZERO);
if (tm == NULL)
- return (0);
+ return (NULL);
saved_tm = tm;
netmask = cp = (caddr_t)(tm + 2);
memcpy(cp, addmask_key, mlen);
@@ -514,7 +514,7 @@ rn_new_radix_mask(struct radix_node *tt, struct radix_mask
*next)
m = pool_get(&rtmask_pool, PR_NOWAIT | PR_ZERO);
if (m == NULL) {
log(LOG_ERR, "Mask for route not entered\n");
- return (0);
+ return (NULL);
}
m->rm_b = tt->rn_b;
m->rm_flags = tt->rn_flags;
@@ -730,14 +730,14 @@ rn_fixup_nodes(struct radix_node *tt)
for (mp = &tp->rn_mklist; x; xx = x, x = x->rn_dupedkey) {
if (xx && xx->rn_mklist && xx->rn_mask == x->rn_mask &&
- x->rn_mklist == 0) {
+ x->rn_mklist == NULL) {
/* multipath route */
x->rn_mklist = xx->rn_mklist;
x->rn_mklist->rm_refs++;
}
if (x->rn_mask && (x->rn_b >= b_leaf) &&
- x->rn_mklist == 0) {
- *mp = m = rn_new_radix_mask(x, 0);
+ x->rn_mklist == NULL) {
+ *mp = m = rn_new_radix_mask(x, NULL);
if (m)
mp = &m->rm_mklist;
}
@@ -750,7 +750,7 @@ rn_fixup_nodes(struct radix_node *tt)
if (m->rm_b >= b_leaf)
break;
tp->rn_mklist = m;
- *mp = 0;
+ *mp = NULL;
}
}
@@ -771,8 +771,8 @@ rn_addroute(void *v_arg, void *n_arg, struct
radix_node_head *head,
* nodes and possibly save time in calculating indices.
*/
if (n_arg) {
- if ((tm = rn_addmask(n_arg, 0, top->rn_off)) == 0)
- return (0);
+ if ((tm = rn_addmask(n_arg, 0, top->rn_off)) == NULL)
+ return (NULL);
}
tt = rn_insert(v, head, &keyduplicated, treenodes);
@@ -1017,7 +1017,7 @@ rn_delete(void *v_arg, void *n_arg, struct
radix_node_head *head,
for (m = tp->rn_mklist; m && x; x = x->rn_dupedkey)
if (m == x->rn_mklist) {
struct radix_mask *mm = m->rm_mklist;
- x->rn_mklist = 0;
+ x->rn_mklist = NULL;
if (--(m->rm_refs) < 0)
pool_put(&rtmask_pool, m);
else if (m->rm_flags & RNF_NORMAL)
diff --git sys/net/rtsock.c sys/net/rtsock.c
index a717d112eb9..b544cff795b 100644
--- sys/net/rtsock.c
+++ sys/net/rtsock.c
@@ -697,7 +697,7 @@ route_output(struct mbuf *m, struct socket *so, struct
sockaddr *dstaddr,
u_char vers, type;
if (m == NULL || ((m->m_len < sizeof(int32_t)) &&
- (m = m_pullup(m, sizeof(int32_t))) == 0))
+ (m = m_pullup(m, sizeof(int32_t))) == NULL))
return (ENOBUFS);
if ((m->m_flags & M_PKTHDR) == 0)
panic("route_output");
@@ -1660,7 +1660,7 @@ again:
}
/* align message length to the next natural boundary */
len = ALIGN(len);
- if (cp == 0 && w != NULL && !second_time) {
+ if (cp == NULL && w != NULL && !second_time) {
w->w_needed += len;
if (w->w_needed <= 0 && w->w_where) {
if (w->w_tmemsize < len) {
@@ -1675,7 +1675,7 @@ again:
second_time = 1;
goto again;
} else
- w->w_where = 0;
+ w->w_where = NULL;
}
}
if (cp && w) /* clear the message header */
@@ -2022,7 +2022,7 @@ sysctl_iflist(int af, struct walkarg *w)
continue;
/* Copy the link-layer address first */
info.rti_info[RTAX_IFP] = sdltosa(ifp->if_sadl);
- len = rtm_msg2(RTM_IFINFO, RTM_VERSION, &info, 0, w);
+ len = rtm_msg2(RTM_IFINFO, RTM_VERSION, &info, NULL, w);
if (w->w_where && w->w_tmem && w->w_needed <= 0) {
struct if_msghdr *ifm;
@@ -2045,7 +2045,8 @@ sysctl_iflist(int af, struct walkarg *w)
info.rti_info[RTAX_IFA] = ifa->ifa_addr;
info.rti_info[RTAX_NETMASK] = ifa->ifa_netmask;
info.rti_info[RTAX_BRD] = ifa->ifa_dstaddr;
- len = rtm_msg2(RTM_NEWADDR, RTM_VERSION, &info, 0, w);
+ len = rtm_msg2(RTM_NEWADDR, RTM_VERSION, &info, NULL,
+ w);
if (w->w_where && w->w_tmem && w->w_needed <= 0) {
struct ifa_msghdr *ifam;