sys/net* : for pointers replace 0 with NULL.
Mostly cosmetical, no functional change. Found with devel/coccinelle.
This commit is contained in:
parent
0d3e502f92
commit
155d72c498
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=298075
@ -99,7 +99,7 @@ m_xword(struct mbuf *m, bpf_u_int32 k, int *err)
|
|||||||
while (k >= len) {
|
while (k >= len) {
|
||||||
k -= len;
|
k -= len;
|
||||||
m = m->m_next;
|
m = m->m_next;
|
||||||
if (m == 0)
|
if (m == NULL)
|
||||||
goto bad;
|
goto bad;
|
||||||
len = m->m_len;
|
len = m->m_len;
|
||||||
}
|
}
|
||||||
@ -109,7 +109,7 @@ m_xword(struct mbuf *m, bpf_u_int32 k, int *err)
|
|||||||
return (EXTRACT_LONG(cp));
|
return (EXTRACT_LONG(cp));
|
||||||
}
|
}
|
||||||
m0 = m->m_next;
|
m0 = m->m_next;
|
||||||
if (m0 == 0 || m0->m_len + len - k < 4)
|
if (m0 == NULL || m0->m_len + len - k < 4)
|
||||||
goto bad;
|
goto bad;
|
||||||
*err = 0;
|
*err = 0;
|
||||||
np = mtod(m0, u_char *);
|
np = mtod(m0, u_char *);
|
||||||
@ -148,7 +148,7 @@ m_xhalf(struct mbuf *m, bpf_u_int32 k, int *err)
|
|||||||
while (k >= len) {
|
while (k >= len) {
|
||||||
k -= len;
|
k -= len;
|
||||||
m = m->m_next;
|
m = m->m_next;
|
||||||
if (m == 0)
|
if (m == NULL)
|
||||||
goto bad;
|
goto bad;
|
||||||
len = m->m_len;
|
len = m->m_len;
|
||||||
}
|
}
|
||||||
@ -158,7 +158,7 @@ m_xhalf(struct mbuf *m, bpf_u_int32 k, int *err)
|
|||||||
return (EXTRACT_SHORT(cp));
|
return (EXTRACT_SHORT(cp));
|
||||||
}
|
}
|
||||||
m0 = m->m_next;
|
m0 = m->m_next;
|
||||||
if (m0 == 0)
|
if (m0 == NULL)
|
||||||
goto bad;
|
goto bad;
|
||||||
*err = 0;
|
*err = 0;
|
||||||
return ((cp[0] << 8) | mtod(m0, u_char *)[0]);
|
return ((cp[0] << 8) | mtod(m0, u_char *)[0]);
|
||||||
|
@ -1948,8 +1948,8 @@ link_rtrequest(int cmd, struct rtentry *rt, struct rt_addrinfo *info)
|
|||||||
struct sockaddr *dst;
|
struct sockaddr *dst;
|
||||||
struct ifnet *ifp;
|
struct ifnet *ifp;
|
||||||
|
|
||||||
if (cmd != RTM_ADD || ((ifa = rt->rt_ifa) == 0) ||
|
if (cmd != RTM_ADD || ((ifa = rt->rt_ifa) == NULL) ||
|
||||||
((ifp = ifa->ifa_ifp) == 0) || ((dst = rt_key(rt)) == 0))
|
((ifp = ifa->ifa_ifp) == NULL) || ((dst = rt_key(rt)) == NULL))
|
||||||
return;
|
return;
|
||||||
ifa = ifaof_ifpforaddr(dst, ifp);
|
ifa = ifaof_ifpforaddr(dst, ifp);
|
||||||
if (ifa) {
|
if (ifa) {
|
||||||
@ -2139,7 +2139,7 @@ if_qflush(struct ifnet *ifp)
|
|||||||
ALTQ_PURGE(ifq);
|
ALTQ_PURGE(ifq);
|
||||||
#endif
|
#endif
|
||||||
n = ifq->ifq_head;
|
n = ifq->ifq_head;
|
||||||
while ((m = n) != 0) {
|
while ((m = n) != NULL) {
|
||||||
n = m->m_nextpkt;
|
n = m->m_nextpkt;
|
||||||
m_freem(m);
|
m_freem(m);
|
||||||
}
|
}
|
||||||
|
@ -210,7 +210,7 @@ arc_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
|
|||||||
|
|
||||||
isphds = arc_isphds(atype);
|
isphds = arc_isphds(atype);
|
||||||
M_PREPEND(m, isphds ? ARC_HDRNEWLEN : ARC_HDRLEN, M_NOWAIT);
|
M_PREPEND(m, isphds ? ARC_HDRNEWLEN : ARC_HDRLEN, M_NOWAIT);
|
||||||
if (m == 0)
|
if (m == NULL)
|
||||||
senderr(ENOBUFS);
|
senderr(ENOBUFS);
|
||||||
ah = mtod(m, struct arc_header *);
|
ah = mtod(m, struct arc_header *);
|
||||||
ah->arc_type = atype;
|
ah->arc_type = atype;
|
||||||
@ -261,12 +261,12 @@ arc_frag_next(struct ifnet *ifp)
|
|||||||
struct arc_header *ah;
|
struct arc_header *ah;
|
||||||
|
|
||||||
ac = (struct arccom *)ifp->if_l2com;
|
ac = (struct arccom *)ifp->if_l2com;
|
||||||
if ((m = ac->curr_frag) == 0) {
|
if ((m = ac->curr_frag) == NULL) {
|
||||||
int tfrags;
|
int tfrags;
|
||||||
|
|
||||||
/* dequeue new packet */
|
/* dequeue new packet */
|
||||||
IF_DEQUEUE(&ifp->if_snd, m);
|
IF_DEQUEUE(&ifp->if_snd, m);
|
||||||
if (m == 0)
|
if (m == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
ah = mtod(m, struct arc_header *);
|
ah = mtod(m, struct arc_header *);
|
||||||
@ -296,7 +296,7 @@ arc_frag_next(struct ifnet *ifp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
M_PREPEND(m, ARC_HDRNEWLEN, M_NOWAIT);
|
M_PREPEND(m, ARC_HDRNEWLEN, M_NOWAIT);
|
||||||
if (m == 0) {
|
if (m == NULL) {
|
||||||
m_freem(ac->curr_frag);
|
m_freem(ac->curr_frag);
|
||||||
ac->curr_frag = 0;
|
ac->curr_frag = 0;
|
||||||
return 0;
|
return 0;
|
||||||
@ -315,7 +315,7 @@ arc_frag_next(struct ifnet *ifp)
|
|||||||
ac->curr_frag = 0;
|
ac->curr_frag = 0;
|
||||||
|
|
||||||
M_PREPEND(m, ARC_HDRNEWLEN_EXC, M_NOWAIT);
|
M_PREPEND(m, ARC_HDRNEWLEN_EXC, M_NOWAIT);
|
||||||
if (m == 0)
|
if (m == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
ah = mtod(m, struct arc_header *);
|
ah = mtod(m, struct arc_header *);
|
||||||
@ -328,7 +328,7 @@ arc_frag_next(struct ifnet *ifp)
|
|||||||
ac->curr_frag = 0;
|
ac->curr_frag = 0;
|
||||||
|
|
||||||
M_PREPEND(m, ARC_HDRNEWLEN, M_NOWAIT);
|
M_PREPEND(m, ARC_HDRNEWLEN, M_NOWAIT);
|
||||||
if (m == 0)
|
if (m == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
ah = mtod(m, struct arc_header *);
|
ah = mtod(m, struct arc_header *);
|
||||||
@ -740,7 +740,7 @@ arc_resolvemulti(struct ifnet *ifp, struct sockaddr **llsa,
|
|||||||
sdl = (struct sockaddr_dl *)sa;
|
sdl = (struct sockaddr_dl *)sa;
|
||||||
if (*LLADDR(sdl) != arcbroadcastaddr)
|
if (*LLADDR(sdl) != arcbroadcastaddr)
|
||||||
return EADDRNOTAVAIL;
|
return EADDRNOTAVAIL;
|
||||||
*llsa = 0;
|
*llsa = NULL;
|
||||||
return 0;
|
return 0;
|
||||||
#ifdef INET
|
#ifdef INET
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
@ -763,7 +763,7 @@ arc_resolvemulti(struct ifnet *ifp, struct sockaddr **llsa,
|
|||||||
* (This is used for multicast routers.)
|
* (This is used for multicast routers.)
|
||||||
*/
|
*/
|
||||||
ifp->if_flags |= IFF_ALLMULTI;
|
ifp->if_flags |= IFF_ALLMULTI;
|
||||||
*llsa = 0;
|
*llsa = NULL;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (!IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr))
|
if (!IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr))
|
||||||
|
@ -192,7 +192,7 @@ atm_output(struct ifnet *ifp, struct mbuf *m0, const struct sockaddr *dst,
|
|||||||
if (atm_flags & ATM_PH_LLCSNAP)
|
if (atm_flags & ATM_PH_LLCSNAP)
|
||||||
sz += 8; /* sizeof snap == 8 */
|
sz += 8; /* sizeof snap == 8 */
|
||||||
M_PREPEND(m, sz, M_NOWAIT);
|
M_PREPEND(m, sz, M_NOWAIT);
|
||||||
if (m == 0)
|
if (m == NULL)
|
||||||
senderr(ENOBUFS);
|
senderr(ENOBUFS);
|
||||||
ad = mtod(m, struct atm_pseudohdr *);
|
ad = mtod(m, struct atm_pseudohdr *);
|
||||||
*ad = atmdst;
|
*ad = atmdst;
|
||||||
@ -295,7 +295,7 @@ atm_input(struct ifnet *ifp, struct atm_pseudohdr *ah, struct mbuf *m,
|
|||||||
struct atmllc *alc;
|
struct atmllc *alc;
|
||||||
|
|
||||||
if (m->m_len < sizeof(*alc) &&
|
if (m->m_len < sizeof(*alc) &&
|
||||||
(m = m_pullup(m, sizeof(*alc))) == 0)
|
(m = m_pullup(m, sizeof(*alc))) == NULL)
|
||||||
return; /* failed */
|
return; /* failed */
|
||||||
alc = mtod(m, struct atmllc *);
|
alc = mtod(m, struct atmllc *);
|
||||||
if (bcmp(alc, ATMLLC_HDR, 6)) {
|
if (bcmp(alc, ATMLLC_HDR, 6)) {
|
||||||
|
@ -3248,7 +3248,7 @@ bridge_pfil(struct mbuf **mp, struct ifnet *bifp, struct ifnet *ifp, int dir)
|
|||||||
if (hlen < sizeof(struct ip))
|
if (hlen < sizeof(struct ip))
|
||||||
goto bad;
|
goto bad;
|
||||||
if (hlen > (*mp)->m_len) {
|
if (hlen > (*mp)->m_len) {
|
||||||
if ((*mp = m_pullup(*mp, hlen)) == 0)
|
if ((*mp = m_pullup(*mp, hlen)) == NULL)
|
||||||
goto bad;
|
goto bad;
|
||||||
ip = mtod(*mp, struct ip *);
|
ip = mtod(*mp, struct ip *);
|
||||||
if (ip == NULL)
|
if (ip == NULL)
|
||||||
@ -3366,7 +3366,7 @@ bridge_ip_checkbasic(struct mbuf **mp)
|
|||||||
goto bad;
|
goto bad;
|
||||||
}
|
}
|
||||||
if (hlen > m->m_len) {
|
if (hlen > m->m_len) {
|
||||||
if ((m = m_pullup(m, hlen)) == 0) {
|
if ((m = m_pullup(m, hlen)) == NULL) {
|
||||||
KMOD_IPSTAT_INC(ips_badhlen);
|
KMOD_IPSTAT_INC(ips_badhlen);
|
||||||
goto bad;
|
goto bad;
|
||||||
}
|
}
|
||||||
|
@ -216,7 +216,7 @@ discioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
|
|||||||
break;
|
break;
|
||||||
case SIOCADDMULTI:
|
case SIOCADDMULTI:
|
||||||
case SIOCDELMULTI:
|
case SIOCDELMULTI:
|
||||||
if (ifr == 0) {
|
if (ifr == NULL) {
|
||||||
error = EAFNOSUPPORT; /* XXX */
|
error = EAFNOSUPPORT; /* XXX */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1075,7 +1075,7 @@ ether_resolvemulti(struct ifnet *ifp, struct sockaddr **llsa,
|
|||||||
e_addr = LLADDR(sdl);
|
e_addr = LLADDR(sdl);
|
||||||
if (!ETHER_IS_MULTICAST(e_addr))
|
if (!ETHER_IS_MULTICAST(e_addr))
|
||||||
return EADDRNOTAVAIL;
|
return EADDRNOTAVAIL;
|
||||||
*llsa = 0;
|
*llsa = NULL;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
#ifdef INET
|
#ifdef INET
|
||||||
@ -1100,7 +1100,7 @@ ether_resolvemulti(struct ifnet *ifp, struct sockaddr **llsa,
|
|||||||
* (This is used for multicast routers.)
|
* (This is used for multicast routers.)
|
||||||
*/
|
*/
|
||||||
ifp->if_flags |= IFF_ALLMULTI;
|
ifp->if_flags |= IFF_ALLMULTI;
|
||||||
*llsa = 0;
|
*llsa = NULL;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (!IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr))
|
if (!IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr))
|
||||||
|
@ -235,7 +235,7 @@ fddi_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
|
|||||||
if (type != 0) {
|
if (type != 0) {
|
||||||
struct llc *l;
|
struct llc *l;
|
||||||
M_PREPEND(m, LLC_SNAPFRAMELEN, M_NOWAIT);
|
M_PREPEND(m, LLC_SNAPFRAMELEN, M_NOWAIT);
|
||||||
if (m == 0)
|
if (m == NULL)
|
||||||
senderr(ENOBUFS);
|
senderr(ENOBUFS);
|
||||||
l = mtod(m, struct llc *);
|
l = mtod(m, struct llc *);
|
||||||
l->llc_control = LLC_UI;
|
l->llc_control = LLC_UI;
|
||||||
@ -251,7 +251,7 @@ fddi_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
|
|||||||
* allocate another.
|
* allocate another.
|
||||||
*/
|
*/
|
||||||
M_PREPEND(m, FDDI_HDR_LEN, M_NOWAIT);
|
M_PREPEND(m, FDDI_HDR_LEN, M_NOWAIT);
|
||||||
if (m == 0)
|
if (m == NULL)
|
||||||
senderr(ENOBUFS);
|
senderr(ENOBUFS);
|
||||||
fh = mtod(m, struct fddi_header *);
|
fh = mtod(m, struct fddi_header *);
|
||||||
fh->fddi_fc = FDDIFC_LLC_ASYNC|FDDIFC_LLC_PRIO4;
|
fh->fddi_fc = FDDIFC_LLC_ASYNC|FDDIFC_LLC_PRIO4;
|
||||||
@ -607,7 +607,7 @@ fddi_resolvemulti(ifp, llsa, sa)
|
|||||||
e_addr = LLADDR(sdl);
|
e_addr = LLADDR(sdl);
|
||||||
if ((e_addr[0] & 1) != 1)
|
if ((e_addr[0] & 1) != 1)
|
||||||
return (EADDRNOTAVAIL);
|
return (EADDRNOTAVAIL);
|
||||||
*llsa = 0;
|
*llsa = NULL;
|
||||||
return (0);
|
return (0);
|
||||||
|
|
||||||
#ifdef INET
|
#ifdef INET
|
||||||
@ -634,7 +634,7 @@ fddi_resolvemulti(ifp, llsa, sa)
|
|||||||
* (This is used for multicast routers.)
|
* (This is used for multicast routers.)
|
||||||
*/
|
*/
|
||||||
ifp->if_flags |= IFF_ALLMULTI;
|
ifp->if_flags |= IFF_ALLMULTI;
|
||||||
*llsa = 0;
|
*llsa = NULL;
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
if (!IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr))
|
if (!IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr))
|
||||||
|
@ -132,7 +132,7 @@ firewire_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
|
|||||||
}
|
}
|
||||||
destfw = (struct fw_hwaddr *)(mtag + 1);
|
destfw = (struct fw_hwaddr *)(mtag + 1);
|
||||||
} else {
|
} else {
|
||||||
destfw = 0;
|
destfw = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (dst->sa_family) {
|
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);
|
mtail = m_split(m, fsize, M_NOWAIT);
|
||||||
m_tag_copy_chain(mtail, m, M_NOWAIT);
|
m_tag_copy_chain(mtail, m, M_NOWAIT);
|
||||||
} else {
|
} else {
|
||||||
mtail = 0;
|
mtail = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -701,7 +701,7 @@ firewire_resolvemulti(struct ifnet *ifp, struct sockaddr **llsa,
|
|||||||
/*
|
/*
|
||||||
* No mapping needed.
|
* No mapping needed.
|
||||||
*/
|
*/
|
||||||
*llsa = 0;
|
*llsa = NULL;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
#ifdef INET
|
#ifdef INET
|
||||||
@ -709,7 +709,7 @@ firewire_resolvemulti(struct ifnet *ifp, struct sockaddr **llsa,
|
|||||||
sin = (struct sockaddr_in *)sa;
|
sin = (struct sockaddr_in *)sa;
|
||||||
if (!IN_MULTICAST(ntohl(sin->sin_addr.s_addr)))
|
if (!IN_MULTICAST(ntohl(sin->sin_addr.s_addr)))
|
||||||
return EADDRNOTAVAIL;
|
return EADDRNOTAVAIL;
|
||||||
*llsa = 0;
|
*llsa = NULL;
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
#ifdef INET6
|
#ifdef INET6
|
||||||
@ -722,12 +722,12 @@ firewire_resolvemulti(struct ifnet *ifp, struct sockaddr **llsa,
|
|||||||
* (This is used for multicast routers.)
|
* (This is used for multicast routers.)
|
||||||
*/
|
*/
|
||||||
ifp->if_flags |= IFF_ALLMULTI;
|
ifp->if_flags |= IFF_ALLMULTI;
|
||||||
*llsa = 0;
|
*llsa = NULL;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (!IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr))
|
if (!IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr))
|
||||||
return EADDRNOTAVAIL;
|
return EADDRNOTAVAIL;
|
||||||
*llsa = 0;
|
*llsa = NULL;
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -328,7 +328,7 @@ iso88025_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
|
|||||||
if (snap_type != 0) {
|
if (snap_type != 0) {
|
||||||
struct llc *l;
|
struct llc *l;
|
||||||
M_PREPEND(m, LLC_SNAPFRAMELEN, M_NOWAIT);
|
M_PREPEND(m, LLC_SNAPFRAMELEN, M_NOWAIT);
|
||||||
if (m == 0)
|
if (m == NULL)
|
||||||
senderr(ENOBUFS);
|
senderr(ENOBUFS);
|
||||||
l = mtod(m, struct llc *);
|
l = mtod(m, struct llc *);
|
||||||
l->llc_control = LLC_UI;
|
l->llc_control = LLC_UI;
|
||||||
@ -344,7 +344,7 @@ iso88025_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
|
|||||||
* allocate another.
|
* allocate another.
|
||||||
*/
|
*/
|
||||||
M_PREPEND(m, ISO88025_HDR_LEN + rif_len, M_NOWAIT);
|
M_PREPEND(m, ISO88025_HDR_LEN + rif_len, M_NOWAIT);
|
||||||
if (m == 0)
|
if (m == NULL)
|
||||||
senderr(ENOBUFS);
|
senderr(ENOBUFS);
|
||||||
th = mtod(m, struct iso88025_header *);
|
th = mtod(m, struct iso88025_header *);
|
||||||
bcopy((caddr_t)edst, (caddr_t)&gen_th.iso88025_dhost, ISO88025_ADDR_LEN);
|
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) {
|
if ((e_addr[0] & 1) != 1) {
|
||||||
return (EADDRNOTAVAIL);
|
return (EADDRNOTAVAIL);
|
||||||
}
|
}
|
||||||
*llsa = 0;
|
*llsa = NULL;
|
||||||
return (0);
|
return (0);
|
||||||
|
|
||||||
#ifdef INET
|
#ifdef INET
|
||||||
@ -664,7 +664,7 @@ iso88025_resolvemulti (ifp, llsa, sa)
|
|||||||
* (This is used for multicast routers.)
|
* (This is used for multicast routers.)
|
||||||
*/
|
*/
|
||||||
ifp->if_flags |= IFF_ALLMULTI;
|
ifp->if_flags |= IFF_ALLMULTI;
|
||||||
*llsa = 0;
|
*llsa = NULL;
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
if (!IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr)) {
|
if (!IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr)) {
|
||||||
|
@ -380,7 +380,7 @@ loioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
|
|||||||
|
|
||||||
case SIOCADDMULTI:
|
case SIOCADDMULTI:
|
||||||
case SIOCDELMULTI:
|
case SIOCDELMULTI:
|
||||||
if (ifr == 0) {
|
if (ifr == NULL) {
|
||||||
error = EAFNOSUPPORT; /* XXX */
|
error = EAFNOSUPPORT; /* XXX */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -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,
|
* Pick the first AF_INET address from the list,
|
||||||
* aliases don't make any sense on a p2p link anyway.
|
* aliases don't make any sense on a p2p link anyway.
|
||||||
*/
|
*/
|
||||||
si = 0;
|
si = NULL;
|
||||||
if_addr_rlock(ifp);
|
if_addr_rlock(ifp);
|
||||||
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link)
|
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link)
|
||||||
if (ifa->ifa_addr->sa_family == AF_INET) {
|
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,
|
* Pick the first AF_INET address from the list,
|
||||||
* aliases don't make any sense on a p2p link anyway.
|
* aliases don't make any sense on a p2p link anyway.
|
||||||
*/
|
*/
|
||||||
si = 0;
|
si = NULL;
|
||||||
if_addr_rlock(ifp);
|
if_addr_rlock(ifp);
|
||||||
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
|
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
|
||||||
if (ifa->ifa_addr->sa_family == AF_INET) {
|
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;
|
struct spppreq *spr;
|
||||||
int rv = 0;
|
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);
|
return (EAGAIN);
|
||||||
/*
|
/*
|
||||||
* ifr->ifr_data is supposed to point to a struct spppreq.
|
* ifr->ifr_data is supposed to point to a struct spppreq.
|
||||||
|
@ -519,11 +519,11 @@ rn_addmask(void *n_arg, struct radix_mask_head *maskhead, int search, int skip)
|
|||||||
*addmask_key = mlen;
|
*addmask_key = mlen;
|
||||||
x = rn_search(addmask_key, maskhead->head.rnh_treetop);
|
x = rn_search(addmask_key, maskhead->head.rnh_treetop);
|
||||||
if (bcmp(addmask_key, x->rn_key, mlen) != 0)
|
if (bcmp(addmask_key, x->rn_key, mlen) != 0)
|
||||||
x = 0;
|
x = NULL;
|
||||||
if (x || search)
|
if (x || search)
|
||||||
return (x);
|
return (x);
|
||||||
R_Zalloc(x, struct radix_node *, RADIX_MAX_KEY_LEN + 2 * sizeof (*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);
|
return (0);
|
||||||
netmask = cp = (unsigned char *)(x + 2);
|
netmask = cp = (unsigned char *)(x + 2);
|
||||||
bcopy(addmask_key, cp, mlen);
|
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])
|
struct radix_node treenodes[2])
|
||||||
{
|
{
|
||||||
caddr_t v = (caddr_t)v_arg, netmask = (caddr_t)n_arg;
|
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;
|
struct radix_node *saved_tt, *top = head->rnh_treetop;
|
||||||
short b = 0, b_leaf = 0;
|
short b = 0, b_leaf = 0;
|
||||||
int keyduplicated;
|
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)
|
for (mp = &x->rn_mklist; (m = *mp); mp = &m->rm_mklist)
|
||||||
if (m->rm_bit >= b_leaf)
|
if (m->rm_bit >= b_leaf)
|
||||||
break;
|
break;
|
||||||
t->rn_mklist = m; *mp = 0;
|
t->rn_mklist = m; *mp = NULL;
|
||||||
}
|
}
|
||||||
on2:
|
on2:
|
||||||
/* Add new route to highest possible ancestor's list */
|
/* 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);
|
vlen = LEN(v);
|
||||||
saved_tt = tt;
|
saved_tt = tt;
|
||||||
top = x;
|
top = x;
|
||||||
if (tt == 0 ||
|
if (tt == NULL ||
|
||||||
bcmp(v + head_off, tt->rn_key + head_off, vlen - head_off))
|
bcmp(v + head_off, tt->rn_key + head_off, vlen - head_off))
|
||||||
return (0);
|
return (0);
|
||||||
/*
|
/*
|
||||||
@ -797,10 +797,10 @@ rn_delete(void *v_arg, void *netmask_arg, struct radix_head *head)
|
|||||||
return (0);
|
return (0);
|
||||||
netmask = x->rn_key;
|
netmask = x->rn_key;
|
||||||
while (tt->rn_mask != netmask)
|
while (tt->rn_mask != netmask)
|
||||||
if ((tt = tt->rn_dupedkey) == 0)
|
if ((tt = tt->rn_dupedkey) == NULL)
|
||||||
return (0);
|
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;
|
goto on1;
|
||||||
if (tt->rn_flags & RNF_NORMAL) {
|
if (tt->rn_flags & RNF_NORMAL) {
|
||||||
if (m->rm_leaf != tt || m->rm_refs > 0) {
|
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);
|
R_Free(m);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (m == 0) {
|
if (m == NULL) {
|
||||||
log(LOG_ERR, "rn_delete: couldn't find our annotation\n");
|
log(LOG_ERR, "rn_delete: couldn't find our annotation\n");
|
||||||
if (tt->rn_flags & RNF_NORMAL)
|
if (tt->rn_flags & RNF_NORMAL)
|
||||||
return (0); /* Dangling ref to us */
|
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;
|
rn = rn->rn_left;
|
||||||
next = rn;
|
next = rn;
|
||||||
/* Process leaves */
|
/* Process leaves */
|
||||||
while ((rn = base) != 0) {
|
while ((rn = base) != NULL) {
|
||||||
base = rn->rn_dupedkey;
|
base = rn->rn_dupedkey;
|
||||||
/* printf("leaf %p\n", rn); */
|
/* printf("leaf %p\n", rn); */
|
||||||
if (!(rn->rn_flags & RNF_ROOT)
|
if (!(rn->rn_flags & RNF_ROOT)
|
||||||
|
@ -83,7 +83,7 @@ raw_input_ext(struct mbuf *m0, struct sockproto *proto, struct sockaddr *src,
|
|||||||
struct mbuf *m = m0;
|
struct mbuf *m = m0;
|
||||||
struct socket *last;
|
struct socket *last;
|
||||||
|
|
||||||
last = 0;
|
last = NULL;
|
||||||
mtx_lock(&rawcb_mtx);
|
mtx_lock(&rawcb_mtx);
|
||||||
LIST_FOREACH(rp, &V_rawcb_list, list) {
|
LIST_FOREACH(rp, &V_rawcb_list, list) {
|
||||||
if (rp->rcb_proto.sp_family != proto->sp_family)
|
if (rp->rcb_proto.sp_family != proto->sp_family)
|
||||||
|
@ -441,7 +441,7 @@ send_dump(struct ccdata *data, void *uarg, const char *buf)
|
|||||||
m->m_pkthdr.len = 0;
|
m->m_pkthdr.len = 0;
|
||||||
} else {
|
} else {
|
||||||
m = m_getcl(M_NOWAIT, MT_DATA, 0);
|
m = m_getcl(M_NOWAIT, MT_DATA, 0);
|
||||||
if (m == 0) {
|
if (m == NULL) {
|
||||||
m_freem(priv->dump_first);
|
m_freem(priv->dump_first);
|
||||||
return (ENOBUFS);
|
return (ENOBUFS);
|
||||||
}
|
}
|
||||||
|
@ -360,7 +360,7 @@ ngc_bind(struct socket *so, struct sockaddr *nam, struct thread *td)
|
|||||||
{
|
{
|
||||||
struct ngpcb *const pcbp = sotongpcb(so);
|
struct ngpcb *const pcbp = sotongpcb(so);
|
||||||
|
|
||||||
if (pcbp == 0)
|
if (pcbp == NULL)
|
||||||
return (EINVAL);
|
return (EINVAL);
|
||||||
return (ng_bind(nam, pcbp));
|
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);
|
struct ngpcb *const pcbp = sotongpcb(so);
|
||||||
|
|
||||||
if (pcbp == 0)
|
if (pcbp == NULL)
|
||||||
return (EINVAL);
|
return (EINVAL);
|
||||||
return (ng_connect_data(nam, pcbp));
|
return (ng_connect_data(nam, pcbp));
|
||||||
}
|
}
|
||||||
|
@ -294,7 +294,7 @@ ng_source_newhook(node_p node, hook_p hook, const char *name)
|
|||||||
sc->input = hook;
|
sc->input = hook;
|
||||||
} else if (strcmp(name, NG_SOURCE_HOOK_OUTPUT) == 0) {
|
} else if (strcmp(name, NG_SOURCE_HOOK_OUTPUT) == 0) {
|
||||||
sc->output = hook;
|
sc->output = hook;
|
||||||
sc->output_ifp = 0;
|
sc->output_ifp = NULL;
|
||||||
bzero(&sc->stats, sizeof(sc->stats));
|
bzero(&sc->stats, sizeof(sc->stats));
|
||||||
} else
|
} else
|
||||||
return (EINVAL);
|
return (EINVAL);
|
||||||
|
@ -1823,7 +1823,7 @@ in6_ifawithifp(struct ifnet *ifp, struct in6_addr *dst)
|
|||||||
{
|
{
|
||||||
int dst_scope = in6_addrscope(dst), blen = -1, tlen;
|
int dst_scope = in6_addrscope(dst), blen = -1, tlen;
|
||||||
struct ifaddr *ifa;
|
struct ifaddr *ifa;
|
||||||
struct in6_ifaddr *besta = 0;
|
struct in6_ifaddr *besta = NULL;
|
||||||
struct in6_ifaddr *dep[2]; /* last-resort: deprecated */
|
struct in6_ifaddr *dep[2]; /* last-resort: deprecated */
|
||||||
|
|
||||||
dep[0] = dep[1] = NULL;
|
dep[0] = dep[1] = NULL;
|
||||||
|
@ -256,7 +256,7 @@ ip6_fragment(struct ifnet *ifp, struct mbuf *m0, int hlen, u_char nextproto,
|
|||||||
ip6f->ip6f_offlg |= IP6F_MORE_FRAG;
|
ip6f->ip6f_offlg |= IP6F_MORE_FRAG;
|
||||||
mhip6->ip6_plen = htons((u_short)(mtu + hlen +
|
mhip6->ip6_plen = htons((u_short)(mtu + hlen +
|
||||||
sizeof(*ip6f) - sizeof(struct ip6_hdr)));
|
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);
|
IP6STAT_INC(ip6s_odropped);
|
||||||
return (ENOBUFS);
|
return (ENOBUFS);
|
||||||
}
|
}
|
||||||
@ -503,7 +503,7 @@ ip6_output(struct mbuf *m0, struct ip6_pktopts *opt,
|
|||||||
/*
|
/*
|
||||||
* Route packet.
|
* Route packet.
|
||||||
*/
|
*/
|
||||||
if (ro == 0) {
|
if (ro == NULL) {
|
||||||
ro = &ip6route;
|
ro = &ip6route;
|
||||||
bzero((caddr_t)ro, sizeof(*ro));
|
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.
|
* jumbo payload option, allocate a cluster to store the whole options.
|
||||||
* Otherwise, use it to store the 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);
|
mopt = m_get(M_NOWAIT, MT_DATA);
|
||||||
if (mopt == NULL)
|
if (mopt == NULL)
|
||||||
return (ENOBUFS);
|
return (ENOBUFS);
|
||||||
@ -1198,7 +1198,7 @@ ip6_insertfraghdr(struct mbuf *m0, struct mbuf *m, int hlen,
|
|||||||
if (hlen > sizeof(struct ip6_hdr)) {
|
if (hlen > sizeof(struct ip6_hdr)) {
|
||||||
n = m_copym(m0, sizeof(struct ip6_hdr),
|
n = m_copym(m0, sizeof(struct ip6_hdr),
|
||||||
hlen - sizeof(struct ip6_hdr), M_NOWAIT);
|
hlen - sizeof(struct ip6_hdr), M_NOWAIT);
|
||||||
if (n == 0)
|
if (n == NULL)
|
||||||
return (ENOBUFS);
|
return (ENOBUFS);
|
||||||
m->m_next = n;
|
m->m_next = n;
|
||||||
} else
|
} else
|
||||||
@ -2515,7 +2515,7 @@ int
|
|||||||
ip6_setpktopts(struct mbuf *control, struct ip6_pktopts *opt,
|
ip6_setpktopts(struct mbuf *control, struct ip6_pktopts *opt,
|
||||||
struct ip6_pktopts *stickyopt, struct ucred *cred, int uproto)
|
struct ip6_pktopts *stickyopt, struct ucred *cred, int uproto)
|
||||||
{
|
{
|
||||||
struct cmsghdr *cm = 0;
|
struct cmsghdr *cm = NULL;
|
||||||
|
|
||||||
if (control == NULL || opt == NULL)
|
if (control == NULL || opt == NULL)
|
||||||
return (EINVAL);
|
return (EINVAL);
|
||||||
|
@ -1510,7 +1510,7 @@ pfxlist_onlink_check()
|
|||||||
find_pfxlist_reachable_router(pr) == NULL)
|
find_pfxlist_reachable_router(pr) == NULL)
|
||||||
pr->ndpr_stateflags |= NDPRF_DETACHED;
|
pr->ndpr_stateflags |= NDPRF_DETACHED;
|
||||||
if ((pr->ndpr_stateflags & NDPRF_DETACHED) != 0 &&
|
if ((pr->ndpr_stateflags & NDPRF_DETACHED) != 0 &&
|
||||||
find_pfxlist_reachable_router(pr) != 0)
|
find_pfxlist_reachable_router(pr) != NULL)
|
||||||
pr->ndpr_stateflags &= ~NDPRF_DETACHED;
|
pr->ndpr_stateflags &= ~NDPRF_DETACHED;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -163,7 +163,7 @@ rip6_input(struct mbuf **mp, int *offp, int proto)
|
|||||||
struct mbuf *m = *mp;
|
struct mbuf *m = *mp;
|
||||||
register struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *);
|
register struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *);
|
||||||
register struct inpcb *in6p;
|
register struct inpcb *in6p;
|
||||||
struct inpcb *last = 0;
|
struct inpcb *last = NULL;
|
||||||
struct mbuf *opts = NULL;
|
struct mbuf *opts = NULL;
|
||||||
struct sockaddr_in6 fromsa;
|
struct sockaddr_in6 fromsa;
|
||||||
|
|
||||||
|
@ -1212,9 +1212,9 @@ udp6_send(struct socket *so, int flags, struct mbuf *m,
|
|||||||
#ifdef INET
|
#ifdef INET
|
||||||
if ((inp->inp_flags & IN6P_IPV6_V6ONLY) == 0) {
|
if ((inp->inp_flags & IN6P_IPV6_V6ONLY) == 0) {
|
||||||
int hasv4addr;
|
int hasv4addr;
|
||||||
struct sockaddr_in6 *sin6 = 0;
|
struct sockaddr_in6 *sin6 = NULL;
|
||||||
|
|
||||||
if (addr == 0)
|
if (addr == NULL)
|
||||||
hasv4addr = (inp->inp_vflag & INP_IPV4);
|
hasv4addr = (inp->inp_vflag & INP_IPV4);
|
||||||
else {
|
else {
|
||||||
sin6 = (struct sockaddr_in6 *)addr;
|
sin6 = (struct sockaddr_in6 *)addr;
|
||||||
|
@ -202,7 +202,7 @@ m_pad(struct mbuf *m, int n)
|
|||||||
if (pad > M_TRAILINGSPACE(m0)) {
|
if (pad > M_TRAILINGSPACE(m0)) {
|
||||||
/* Add an mbuf to the chain. */
|
/* Add an mbuf to the chain. */
|
||||||
MGET(m1, M_NOWAIT, MT_DATA);
|
MGET(m1, M_NOWAIT, MT_DATA);
|
||||||
if (m1 == 0) {
|
if (m1 == NULL) {
|
||||||
m_freem(m0);
|
m_freem(m0);
|
||||||
DPRINTF(("%s: unable to get extra mbuf\n", __func__));
|
DPRINTF(("%s: unable to get extra mbuf\n", __func__));
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -4923,8 +4923,8 @@ key_update(struct socket *so, struct mbuf *m, const struct sadb_msghdr *mhp)
|
|||||||
dport = (struct sadb_x_nat_t_port *)
|
dport = (struct sadb_x_nat_t_port *)
|
||||||
mhp->ext[SADB_X_EXT_NAT_T_DPORT];
|
mhp->ext[SADB_X_EXT_NAT_T_DPORT];
|
||||||
} else {
|
} else {
|
||||||
type = 0;
|
type = NULL;
|
||||||
sport = dport = 0;
|
sport = dport = NULL;
|
||||||
}
|
}
|
||||||
if (mhp->ext[SADB_X_EXT_NAT_T_OAI] != NULL &&
|
if (mhp->ext[SADB_X_EXT_NAT_T_OAI] != NULL &&
|
||||||
mhp->ext[SADB_X_EXT_NAT_T_OAR] != 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 *)
|
frag = (struct sadb_x_nat_t_frag *)
|
||||||
mhp->ext[SADB_X_EXT_NAT_T_FRAG];
|
mhp->ext[SADB_X_EXT_NAT_T_FRAG];
|
||||||
} else {
|
} else {
|
||||||
frag = 0;
|
frag = NULL;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -5215,7 +5215,7 @@ key_add(struct socket *so, struct mbuf *m, const struct sadb_msghdr *mhp)
|
|||||||
KEY_PORTTOSADDR(&saidx.dst,
|
KEY_PORTTOSADDR(&saidx.dst,
|
||||||
dport->sadb_x_nat_t_port_port);
|
dport->sadb_x_nat_t_port_port);
|
||||||
} else {
|
} else {
|
||||||
type = 0;
|
type = NULL;
|
||||||
}
|
}
|
||||||
if (mhp->ext[SADB_X_EXT_NAT_T_OAI] != NULL &&
|
if (mhp->ext[SADB_X_EXT_NAT_T_OAI] != NULL &&
|
||||||
mhp->ext[SADB_X_EXT_NAT_T_OAR] != 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 *)
|
frag = (struct sadb_x_nat_t_frag *)
|
||||||
mhp->ext[SADB_X_EXT_NAT_T_FRAG];
|
mhp->ext[SADB_X_EXT_NAT_T_FRAG];
|
||||||
} else {
|
} else {
|
||||||
frag = 0;
|
frag = NULL;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -6599,7 +6599,7 @@ key_acquire2(struct socket *so, struct mbuf *m, const struct sadb_msghdr *mhp)
|
|||||||
static int
|
static int
|
||||||
key_register(struct socket *so, struct mbuf *m, const struct sadb_msghdr *mhp)
|
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(so != NULL, ("null socket"));
|
||||||
IPSEC_ASSERT(m != NULL, ("null mbuf"));
|
IPSEC_ASSERT(m != NULL, ("null mbuf"));
|
||||||
|
@ -92,7 +92,7 @@ key_output(struct mbuf *m, struct socket *so, ...)
|
|||||||
struct sadb_msg *msg;
|
struct sadb_msg *msg;
|
||||||
int len, error = 0;
|
int len, error = 0;
|
||||||
|
|
||||||
if (m == 0)
|
if (m == NULL)
|
||||||
panic("%s: NULL pointer was passed.\n", __func__);
|
panic("%s: NULL pointer was passed.\n", __func__);
|
||||||
|
|
||||||
PFKEYSTAT_INC(out_total);
|
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_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);
|
PFKEYSTAT_INC(out_nomem);
|
||||||
error = ENOBUFS;
|
error = ENOBUFS;
|
||||||
goto end;
|
goto end;
|
||||||
@ -178,7 +178,7 @@ key_sendup(struct socket *so, struct sadb_msg *msg, u_int len, int target)
|
|||||||
int tlen;
|
int tlen;
|
||||||
|
|
||||||
/* sanity check */
|
/* sanity check */
|
||||||
if (so == 0 || msg == 0)
|
if (so == NULL || msg == NULL)
|
||||||
panic("%s: NULL pointer was passed.\n", __func__);
|
panic("%s: NULL pointer was passed.\n", __func__);
|
||||||
|
|
||||||
KEYDEBUG(KEYDEBUG_KEY_DUMP,
|
KEYDEBUG(KEYDEBUG_KEY_DUMP,
|
||||||
@ -388,7 +388,7 @@ key_attach(struct socket *so, int proto, struct thread *td)
|
|||||||
|
|
||||||
/* XXX */
|
/* XXX */
|
||||||
kp = malloc(sizeof *kp, M_PCB, M_WAITOK | M_ZERO);
|
kp = malloc(sizeof *kp, M_PCB, M_WAITOK | M_ZERO);
|
||||||
if (kp == 0)
|
if (kp == NULL)
|
||||||
return ENOBUFS;
|
return ENOBUFS;
|
||||||
|
|
||||||
so->so_pcb = (caddr_t)kp;
|
so->so_pcb = (caddr_t)kp;
|
||||||
|
@ -283,7 +283,7 @@ ipcomp_input_cb(struct cryptop *crp)
|
|||||||
/* In case it's not done already, adjust the size of the mbuf chain */
|
/* In case it's not done already, adjust the size of the mbuf chain */
|
||||||
m->m_pkthdr.len = clen + hlen + skip;
|
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*/
|
IPCOMPSTAT_INC(ipcomps_hdrops); /*XXX*/
|
||||||
DPRINTF(("%s: m_pullup failed\n", __func__));
|
DPRINTF(("%s: m_pullup failed\n", __func__));
|
||||||
error = EINVAL; /*XXX*/
|
error = EINVAL; /*XXX*/
|
||||||
|
Loading…
Reference in New Issue
Block a user