aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorPedro F. Giffuni <pfg@FreeBSD.org>2016-04-15 15:46:41 +0000
committerPedro F. Giffuni <pfg@FreeBSD.org>2016-04-15 15:46:41 +0000
commit99d628d577710a8236fd8cfca76bad9eb43b22c8 (patch)
tree4a79a438a4050cb2587d8b164209b03fac85a9d6 /sys
parent915c6043b06c1ef2afd4660e18a18d0ed434333d (diff)
downloadsrc-99d628d577710a8236fd8cfca76bad9eb43b22c8.tar.gz
src-99d628d577710a8236fd8cfca76bad9eb43b22c8.zip
netinet: for pointers replace 0 with NULL.
These are mostly cosmetical, no functional change. Found with devel/coccinelle. Reviewed by: ae. tuexen
Notes
Notes: svn path=/head/; revision=298066
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet/if_ether.c2
-rw-r--r--sys/netinet/igmp.c2
-rw-r--r--sys/netinet/in_mcast.c4
-rw-r--r--sys/netinet/ip_divert.c6
-rw-r--r--sys/netinet/ip_icmp.c4
-rw-r--r--sys/netinet/ip_mroute.c2
-rw-r--r--sys/netinet/ip_options.c2
-rw-r--r--sys/netinet/ip_output.c2
-rw-r--r--sys/netinet/libalias/alias_db.c6
-rw-r--r--sys/netinet/raw_ip.c2
-rw-r--r--sys/netinet/sctp_syscalls.c2
-rw-r--r--sys/netinet/sctp_usrreq.c2
-rw-r--r--sys/netinet/udp_usrreq.c4
13 files changed, 20 insertions, 20 deletions
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c
index 7a06beaf7cc0..eac3c1d24782 100644
--- a/sys/netinet/if_ether.c
+++ b/sys/netinet/if_ether.c
@@ -578,7 +578,7 @@ int
arpresolve(struct ifnet *ifp, int is_gw, struct mbuf *m,
const struct sockaddr *dst, u_char *desten, uint32_t *pflags)
{
- struct llentry *la = 0;
+ struct llentry *la = NULL;
if (pflags != NULL)
*pflags = 0;
diff --git a/sys/netinet/igmp.c b/sys/netinet/igmp.c
index 2154149bc7b0..dcadec559e68 100644
--- a/sys/netinet/igmp.c
+++ b/sys/netinet/igmp.c
@@ -1469,7 +1469,7 @@ igmp_input(struct mbuf **mp, int *offp, int proto)
else
minlen += IGMP_MINLEN;
if ((!M_WRITABLE(m) || m->m_len < minlen) &&
- (m = m_pullup(m, minlen)) == 0) {
+ (m = m_pullup(m, minlen)) == NULL) {
IGMPSTAT_INC(igps_rcv_tooshort);
return (IPPROTO_DONE);
}
diff --git a/sys/netinet/in_mcast.c b/sys/netinet/in_mcast.c
index f2a985b79ef5..4037dbfbff4d 100644
--- a/sys/netinet/in_mcast.c
+++ b/sys/netinet/in_mcast.c
@@ -1810,7 +1810,7 @@ inp_getmoptions(struct inpcb *inp, struct sockopt *sopt)
break;
case IP_MULTICAST_TTL:
- if (imo == 0)
+ if (imo == NULL)
optval = coptval = IP_DEFAULT_MULTICAST_TTL;
else
optval = coptval = imo->imo_multicast_ttl;
@@ -1822,7 +1822,7 @@ inp_getmoptions(struct inpcb *inp, struct sockopt *sopt)
break;
case IP_MULTICAST_LOOP:
- if (imo == 0)
+ if (imo == NULL)
optval = coptval = IP_DEFAULT_MULTICAST_LOOP;
else
optval = coptval = imo->imo_multicast_loop;
diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c
index f23a3a87fe23..233d1af7cda9 100644
--- a/sys/netinet/ip_divert.c
+++ b/sys/netinet/ip_divert.c
@@ -205,7 +205,7 @@ divert_packet(struct mbuf *m, int incoming)
}
/* Assure header */
if (m->m_len < sizeof(struct ip) &&
- (m = m_pullup(m, sizeof(struct ip))) == 0)
+ (m = m_pullup(m, sizeof(struct ip))) == NULL)
return;
ip = mtod(m, struct ip *);
@@ -600,7 +600,7 @@ div_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *nam,
/* Packet must have a header (but that's about it) */
if (m->m_len < sizeof (struct ip) &&
- (m = m_pullup(m, sizeof (struct ip))) == 0) {
+ (m = m_pullup(m, sizeof (struct ip))) == NULL) {
KMOD_IPSTAT_INC(ips_toosmall);
m_freem(m);
return EINVAL;
@@ -666,7 +666,7 @@ div_pcblist(SYSCTL_HANDLER_ARGS)
return error;
inp_list = malloc(n * sizeof *inp_list, M_TEMP, M_WAITOK);
- if (inp_list == 0)
+ if (inp_list == NULL)
return ENOMEM;
INP_INFO_RLOCK(&V_divcbinfo);
diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c
index cc3e1f514f93..fee980f4cb5a 100644
--- a/sys/netinet/ip_icmp.c
+++ b/sys/netinet/ip_icmp.c
@@ -674,7 +674,7 @@ icmp_reflect(struct mbuf *m)
struct in_ifaddr *ia;
struct in_addr t;
struct nhop4_extended nh_ext;
- struct mbuf *opts = 0;
+ struct mbuf *opts = NULL;
int optlen = (ip->ip_hl << 2) - sizeof(struct ip);
if (IN_MULTICAST(ntohl(ip->ip_src.s_addr)) ||
@@ -790,7 +790,7 @@ match:
* add on any record-route or timestamp options.
*/
cp = (u_char *) (ip + 1);
- if ((opts = ip_srcroute(m)) == 0 &&
+ if ((opts = ip_srcroute(m)) == NULL &&
(opts = m_gethdr(M_NOWAIT, MT_DATA))) {
opts->m_len = sizeof(struct in_addr);
mtod(opts, struct in_addr *)->s_addr = 0;
diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c
index 69e12c3cd5b5..ba21edccbb1d 100644
--- a/sys/netinet/ip_mroute.c
+++ b/sys/netinet/ip_mroute.c
@@ -2601,7 +2601,7 @@ pim_input(struct mbuf **mp, int *offp, int proto)
* Get the IP and PIM headers in contiguous memory, and
* possibly the PIM REGISTER header.
*/
- if (m->m_len < minlen && (m = m_pullup(m, minlen)) == 0) {
+ if (m->m_len < minlen && (m = m_pullup(m, minlen)) == NULL) {
CTR1(KTR_IPMF, "%s: m_pullup() failed", __func__);
return (IPPROTO_DONE);
}
diff --git a/sys/netinet/ip_options.c b/sys/netinet/ip_options.c
index 5daf653baa8a..b0504234e306 100644
--- a/sys/netinet/ip_options.c
+++ b/sys/netinet/ip_options.c
@@ -608,7 +608,7 @@ ip_pcbopts(struct inpcb *inp, int optname, struct mbuf *m)
/* turn off any old options */
if (*pcbopt)
(void)m_free(*pcbopt);
- *pcbopt = 0;
+ *pcbopt = NULL;
if (m == NULL || m->m_len == 0) {
/*
* Only turning off any previous options.
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c
index afdf1a782782..3a8be2747303 100644
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -1348,7 +1348,7 @@ ip_ctloutput(struct socket *so, struct sockopt *sopt)
caddr_t req = NULL;
size_t len = 0;
- if (m != 0) {
+ if (m != NULL) {
req = mtod(m, caddr_t);
len = m->m_len;
}
diff --git a/sys/netinet/libalias/alias_db.c b/sys/netinet/libalias/alias_db.c
index cceccd56e6e5..4f8159ba753a 100644
--- a/sys/netinet/libalias/alias_db.c
+++ b/sys/netinet/libalias/alias_db.c
@@ -784,9 +784,9 @@ FindNewPortGroup(struct libalias *la,
struct alias_link *search_result;
for (j = 0; j < port_count; j++)
- if (0 != (search_result = FindLinkIn(la, dst_addr, alias_addr,
- dst_port, htons(port_sys + j),
- link_type, 0)))
+ if ((search_result = FindLinkIn(la, dst_addr,
+ alias_addr, dst_port, htons(port_sys + j),
+ link_type, 0)) != NULL)
break;
/* Found a good range, return base */
diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c
index 9f29444cb712..8de3108c8a98 100644
--- a/sys/netinet/raw_ip.c
+++ b/sys/netinet/raw_ip.c
@@ -1046,7 +1046,7 @@ rip_pcblist(SYSCTL_HANDLER_ARGS)
return (error);
inp_list = malloc(n * sizeof *inp_list, M_TEMP, M_WAITOK);
- if (inp_list == 0)
+ if (inp_list == NULL)
return (ENOMEM);
INP_INFO_RLOCK(&V_ripcbinfo);
diff --git a/sys/netinet/sctp_syscalls.c b/sys/netinet/sctp_syscalls.c
index 71e2f722a72e..5c16e8d3555e 100644
--- a/sys/netinet/sctp_syscalls.c
+++ b/sys/netinet/sctp_syscalls.c
@@ -562,7 +562,7 @@ sys_sctp_generic_recvmsg(td, uap)
if (fromlen && uap->from) {
len = fromlen;
- if (len <= 0 || fromsa == 0)
+ if (len <= 0 || fromsa == NULL)
len = 0;
else {
len = MIN(len, fromsa->sa_len);
diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c
index 1b23abca7f10..81d2478294d4 100644
--- a/sys/netinet/sctp_usrreq.c
+++ b/sys/netinet/sctp_usrreq.c
@@ -469,7 +469,7 @@ sctp_attach(struct socket *so, int proto SCTP_UNUSED, struct thread *p SCTP_UNUS
uint32_t vrf_id = SCTP_DEFAULT_VRFID;
inp = (struct sctp_inpcb *)so->so_pcb;
- if (inp != 0) {
+ if (inp != NULL) {
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
return (EINVAL);
}
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c
index 56aa56f5da0a..fdc2e76dbcfb 100644
--- a/sys/netinet/udp_usrreq.c
+++ b/sys/netinet/udp_usrreq.c
@@ -308,7 +308,7 @@ udp_append(struct inpcb *inp, struct ip *ip, struct mbuf *n, int off,
{
struct sockaddr *append_sa;
struct socket *so;
- struct mbuf *opts = 0;
+ struct mbuf *opts = NULL;
#ifdef INET6
struct sockaddr_in6 udp_in6;
#endif
@@ -856,7 +856,7 @@ udp_pcblist(SYSCTL_HANDLER_ARGS)
return (error);
inp_list = malloc(n * sizeof *inp_list, M_TEMP, M_WAITOK);
- if (inp_list == 0)
+ if (inp_list == NULL)
return (ENOMEM);
INP_INFO_RLOCK(&V_udbinfo);