summaryrefslogtreecommitdiffstats
path: root/sys/net
diff options
context:
space:
mode:
authoralfred <alfred@FreeBSD.org>2003-01-21 08:56:16 +0000
committeralfred <alfred@FreeBSD.org>2003-01-21 08:56:16 +0000
commitbf8e8a6e8f0bd9165109f0a258730dd242299815 (patch)
treef16a2fb9fa7a7fbc4c19e981d278d5f6eb53234d /sys/net
parent2180deee00350fff613a1d1d1328eddc4c0ba9c8 (diff)
downloadFreeBSD-src-bf8e8a6e8f0bd9165109f0a258730dd242299815.zip
FreeBSD-src-bf8e8a6e8f0bd9165109f0a258730dd242299815.tar.gz
Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.
Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/bpf.c12
-rw-r--r--sys/net/bpf_compat.h2
-rw-r--r--sys/net/bridge.c12
-rw-r--r--sys/net/bsd_comp.c16
-rw-r--r--sys/net/if.c14
-rw-r--r--sys/net/if_arcsubr.c10
-rw-r--r--sys/net/if_atmsubr.c2
-rw-r--r--sys/net/if_disc.c2
-rw-r--r--sys/net/if_ef.c10
-rw-r--r--sys/net/if_ethersubr.c16
-rw-r--r--sys/net/if_faith.c2
-rw-r--r--sys/net/if_fddisubr.c10
-rw-r--r--sys/net/if_gif.c6
-rw-r--r--sys/net/if_gre.c6
-rw-r--r--sys/net/if_ieee80211subr.c36
-rw-r--r--sys/net/if_iso88025subr.c6
-rw-r--r--sys/net/if_loop.c6
-rw-r--r--sys/net/if_ppp.c12
-rw-r--r--sys/net/if_sl.c10
-rw-r--r--sys/net/if_spppsubr.c12
-rw-r--r--sys/net/if_stf.c4
-rw-r--r--sys/net/if_tap.c6
-rw-r--r--sys/net/if_tun.c10
-rw-r--r--sys/net/if_vlan.c8
-rw-r--r--sys/net/if_vlan_var.h2
-rw-r--r--sys/net/pfil.c4
-rw-r--r--sys/net/ppp_deflate.c16
-rw-r--r--sys/net/ppp_tty.c8
-rw-r--r--sys/net/raw_cb.c2
-rw-r--r--sys/net/route.c2
-rw-r--r--sys/net/rtsock.c6
31 files changed, 135 insertions, 135 deletions
diff --git a/sys/net/bpf.c b/sys/net/bpf.c
index df210e2..e5a567d 100644
--- a/sys/net/bpf.c
+++ b/sys/net/bpf.c
@@ -207,9 +207,9 @@ bpf_movein(uio, linktype, mp, sockp, datlen)
return (EIO);
if (len > MHLEN) {
- m = m_getcl(M_TRYWAIT, MT_DATA, M_PKTHDR);
+ m = m_getcl(0, MT_DATA, M_PKTHDR);
} else {
- MGETHDR(m, M_TRYWAIT, MT_DATA);
+ MGETHDR(m, 0, MT_DATA);
}
if (m == NULL)
return (ENOBUFS);
@@ -340,7 +340,7 @@ bpfopen(dev, flags, fmt, td)
if ((dev->si_flags & SI_NAMED) == 0)
make_dev(&bpf_cdevsw, minor(dev), UID_ROOT, GID_WHEEL, 0600,
"bpf%d", dev2unit(dev));
- MALLOC(d, struct bpf_d *, sizeof(*d), M_BPF, M_WAITOK | M_ZERO);
+ MALLOC(d, struct bpf_d *, sizeof(*d), M_BPF, M_ZERO);
dev->si_drv1 = d;
d->bd_bufsize = bpf_bufsize;
d->bd_sig = SIGIO;
@@ -947,7 +947,7 @@ bpf_setf(d, fp)
return (EINVAL);
size = flen * sizeof(*fp->bf_insns);
- fcode = (struct bpf_insn *)malloc(size, M_BPF, M_WAITOK);
+ fcode = (struct bpf_insn *)malloc(size, M_BPF, 0);
if (copyin((caddr_t)fp->bf_insns, (caddr_t)fcode, size) == 0 &&
bpf_validate(fcode, (int)flen)) {
BPFD_LOCK(d);
@@ -1247,11 +1247,11 @@ static int
bpf_allocbufs(d)
register struct bpf_d *d;
{
- d->bd_fbuf = (caddr_t)malloc(d->bd_bufsize, M_BPF, M_WAITOK);
+ d->bd_fbuf = (caddr_t)malloc(d->bd_bufsize, M_BPF, 0);
if (d->bd_fbuf == 0)
return (ENOBUFS);
- d->bd_sbuf = (caddr_t)malloc(d->bd_bufsize, M_BPF, M_WAITOK);
+ d->bd_sbuf = (caddr_t)malloc(d->bd_bufsize, M_BPF, 0);
if (d->bd_sbuf == 0) {
free(d->bd_fbuf, M_BPF);
return (ENOBUFS);
diff --git a/sys/net/bpf_compat.h b/sys/net/bpf_compat.h
index 212ac5f..16fae34 100644
--- a/sys/net/bpf_compat.h
+++ b/sys/net/bpf_compat.h
@@ -45,7 +45,7 @@
* a fixed offset from the associated mbuf. Sorry for this kludge.
*/
#define malloc(size, type, canwait) \
-bpf_alloc(size, (canwait & M_NOWAIT) ? M_DONTWAIT : M_TRYWAIT)
+bpf_alloc(size, (canwait & M_NOWAIT) ? M_NOWAIT : 0)
#define free(cp, type) m_free(*(struct mbuf **)(cp - 8))
diff --git a/sys/net/bridge.c b/sys/net/bridge.c
index 16e338f..fef1b98 100644
--- a/sys/net/bridge.c
+++ b/sys/net/bridge.c
@@ -246,7 +246,7 @@ add_cluster(u_int16_t cluster_id, struct arpcom *ac)
}
c[n_clusters].ht = (struct hash_table *)
malloc(HASH_SIZE * sizeof(struct hash_table),
- M_IFADDR, M_WAITOK | M_ZERO);
+ M_IFADDR, M_ZERO);
if (c[n_clusters].ht == NULL) {
printf("-- bridge: cannot allocate hash table for new cluster\n");
free(c, M_IFADDR);
@@ -254,7 +254,7 @@ add_cluster(u_int16_t cluster_id, struct arpcom *ac)
}
c[n_clusters].my_macs = (struct bdg_addr *)
malloc(BDG_MAX_PORTS * sizeof(struct bdg_addr),
- M_IFADDR, M_WAITOK | M_ZERO);
+ M_IFADDR, M_ZERO);
if (c[n_clusters].my_macs == NULL) {
printf("-- bridge: cannot allocate mac addr table for new cluster\n");
free(c[n_clusters].ht, M_IFADDR);
@@ -799,7 +799,7 @@ static struct mbuf *
bdg_forward(struct mbuf *m0, struct ifnet *dst)
{
#define EH_RESTORE(_m) do { \
- M_PREPEND((_m), ETHER_HDR_LEN, M_DONTWAIT); \
+ M_PREPEND((_m), ETHER_HDR_LEN, M_NOWAIT); \
if ((_m) == NULL) { \
bdg_dropped++; \
return NULL; \
@@ -975,7 +975,7 @@ bdg_forward(struct mbuf *m0, struct ifnet *dst)
struct mbuf *m ;
if (shared) {
- m = m_copypacket(m0, M_DONTWAIT);
+ m = m_copypacket(m0, M_NOWAIT);
if (m == NULL) { /* copy failed, give up */
bdg_dropped++;
return NULL;
@@ -1041,7 +1041,7 @@ forward:
m = m0 ;
m0 = NULL ; /* original is gone */
} else {
- m = m_copypacket(m0, M_DONTWAIT);
+ m = m_copypacket(m0, M_NOWAIT);
if (m == NULL) {
IFNET_RUNLOCK();
printf("bdg_forward: sorry, m_copypacket failed!\n");
@@ -1090,7 +1090,7 @@ bdginit(void)
printf("BRIDGE 020214 loaded\n");
ifp2sc = malloc(BDG_MAX_PORTS * sizeof(struct bdg_softc),
- M_IFADDR, M_WAITOK | M_ZERO );
+ M_IFADDR, M_ZERO );
if (ifp2sc == NULL)
return ENOMEM ;
diff --git a/sys/net/bsd_comp.c b/sys/net/bsd_comp.c
index dd6ab56..89c5e29 100644
--- a/sys/net/bsd_comp.c
+++ b/sys/net/bsd_comp.c
@@ -496,12 +496,12 @@ bsd_compress(state, mret, mp, slen, maxolen)
*wptr++ = (v); \
if (wptr >= cp_end) { \
m->m_len = wptr - mtod(m, u_char *); \
- MGET(m->m_next, M_DONTWAIT, MT_DATA); \
+ MGET(m->m_next, M_NOWAIT, MT_DATA); \
m = m->m_next; \
if (m) { \
m->m_len = 0; \
if (maxolen - olen > MLEN) \
- MCLGET(m, M_DONTWAIT); \
+ MCLGET(m, M_NOWAIT); \
wptr = mtod(m, u_char *); \
cp_end = wptr + M_TRAILINGSPACE(m); \
} else \
@@ -538,12 +538,12 @@ bsd_compress(state, mret, mp, slen, maxolen)
maxolen = slen;
/* Allocate one mbuf to start with. */
- MGET(m, M_DONTWAIT, MT_DATA);
+ MGET(m, M_NOWAIT, MT_DATA);
*mret = m;
if (m != NULL) {
m->m_len = 0;
if (maxolen + db->hdrlen > MLEN)
- MCLGET(m, M_DONTWAIT);
+ MCLGET(m, M_NOWAIT);
m->m_data += db->hdrlen;
wptr = mtod(m, u_char *);
cp_end = wptr + M_TRAILINGSPACE(m);
@@ -872,13 +872,13 @@ bsd_decompress(state, cmp, dmpp)
/*
* Allocate one mbuf to start with.
*/
- MGETHDR(dmp, M_DONTWAIT, MT_DATA);
+ MGETHDR(dmp, M_NOWAIT, MT_DATA);
if (dmp == NULL)
return DECOMP_ERROR;
mret = dmp;
dmp->m_len = 0;
dmp->m_next = NULL;
- MCLGET(dmp, M_DONTWAIT);
+ MCLGET(dmp, M_NOWAIT);
dmp->m_data += db->hdrlen;
wptr = mtod(dmp, u_char *);
space = M_TRAILINGSPACE(dmp) - PPP_HDRLEN + 1;
@@ -987,7 +987,7 @@ bsd_decompress(state, cmp, dmpp)
*/
if ((space -= codelen + extra) < 0) {
dmp->m_len = wptr - mtod(dmp, u_char *);
- MGET(m, M_DONTWAIT, MT_DATA);
+ MGET(m, M_NOWAIT, MT_DATA);
if (m == NULL) {
m_freem(mret);
return DECOMP_ERROR;
@@ -995,7 +995,7 @@ bsd_decompress(state, cmp, dmpp)
m->m_len = 0;
m->m_next = NULL;
dmp->m_next = m;
- MCLGET(m, M_DONTWAIT);
+ MCLGET(m, M_NOWAIT);
space = M_TRAILINGSPACE(m) - (codelen + extra);
if (space < 0) {
/* now that's what I call *compression*. */
diff --git a/sys/net/if.c b/sys/net/if.c
index 1f58605..04f8f75 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -280,7 +280,7 @@ if_grow(void)
if_indexlim <<= 1;
n = if_indexlim * sizeof(*e);
- e = malloc(n, M_IFADDR, M_WAITOK | M_ZERO);
+ e = malloc(n, M_IFADDR, M_ZERO);
if (ifindex_table != NULL) {
memcpy((caddr_t)e, (caddr_t)ifindex_table, n/2);
free((caddr_t)ifindex_table, M_IFADDR);
@@ -429,7 +429,7 @@ if_attach(ifp)
socksize = sizeof(*sdl);
socksize = ROUNDUP(socksize);
ifasize = sizeof(*ifa) + 2 * socksize;
- ifa = (struct ifaddr *)malloc(ifasize, M_IFADDR, M_WAITOK | M_ZERO);
+ ifa = (struct ifaddr *)malloc(ifasize, M_IFADDR, M_ZERO);
if (ifa) {
IFA_LOCK_INIT(ifa);
sdl = (struct sockaddr_dl *)(ifa + 1);
@@ -775,7 +775,7 @@ if_clone_attach(ifc)
len = maxclone >> 3;
if ((len << 3) < maxclone)
len++;
- ifc->ifc_units = malloc(len, M_CLONE, M_WAITOK | M_ZERO);
+ ifc->ifc_units = malloc(len, M_CLONE, M_ZERO);
ifc->ifc_bmlen = len;
LIST_INSERT_HEAD(&if_cloners, ifc, ifc_list);
@@ -1797,8 +1797,8 @@ if_addmulti(ifp, sa, retifma)
llsa = 0;
}
- MALLOC(ifma, struct ifmultiaddr *, sizeof *ifma, M_IFMADDR, M_WAITOK);
- MALLOC(dupsa, struct sockaddr *, sa->sa_len, M_IFMADDR, M_WAITOK);
+ MALLOC(ifma, struct ifmultiaddr *, sizeof *ifma, M_IFMADDR, 0);
+ MALLOC(dupsa, struct sockaddr *, sa->sa_len, M_IFMADDR, 0);
bcopy(sa, dupsa, sa->sa_len);
ifma->ifma_addr = dupsa;
@@ -1827,9 +1827,9 @@ if_addmulti(ifp, sa, retifma)
ifma->ifma_refcount++;
} else {
MALLOC(ifma, struct ifmultiaddr *, sizeof *ifma,
- M_IFMADDR, M_WAITOK);
+ M_IFMADDR, 0);
MALLOC(dupsa, struct sockaddr *, llsa->sa_len,
- M_IFMADDR, M_WAITOK);
+ M_IFMADDR, 0);
bcopy(llsa, dupsa, llsa->sa_len);
ifma->ifma_addr = dupsa;
ifma->ifma_ifp = ifp;
diff --git a/sys/net/if_arcsubr.c b/sys/net/if_arcsubr.c
index df01b74..0fffe8d 100644
--- a/sys/net/if_arcsubr.c
+++ b/sys/net/if_arcsubr.c
@@ -203,7 +203,7 @@ arc_output(ifp, m, dst, rt0)
if (mcopy)
(void) if_simloop(ifp, mcopy, dst->sa_family, 0);
- M_PREPEND(m, ARC_HDRLEN, M_DONTWAIT);
+ M_PREPEND(m, ARC_HDRLEN, M_NOWAIT);
if (m == 0)
senderr(ENOBUFS);
ah = mtod(m, struct arc_header *);
@@ -292,13 +292,13 @@ arc_frag_next(ifp)
/* split out next fragment and return it */
if (ac->sflag < ac->fsflag) {
/* we CAN'T have short packets here */
- ac->curr_frag = m_split(m, 504, M_DONTWAIT);
+ ac->curr_frag = m_split(m, 504, M_NOWAIT);
if (ac->curr_frag == 0) {
m_freem(m);
return 0;
}
- M_PREPEND(m, ARC_HDRNEWLEN, M_DONTWAIT);
+ M_PREPEND(m, ARC_HDRNEWLEN, M_NOWAIT);
if (m == 0) {
m_freem(ac->curr_frag);
ac->curr_frag = 0;
@@ -317,7 +317,7 @@ arc_frag_next(ifp)
ARC_MAX_FORBID_LEN - ARC_HDRNEWLEN + 2)) {
ac->curr_frag = 0;
- M_PREPEND(m, ARC_HDRNEWLEN_EXC, M_DONTWAIT);
+ M_PREPEND(m, ARC_HDRNEWLEN_EXC, M_NOWAIT);
if (m == 0)
return 0;
@@ -330,7 +330,7 @@ arc_frag_next(ifp)
} else {
ac->curr_frag = 0;
- M_PREPEND(m, ARC_HDRNEWLEN, M_DONTWAIT);
+ M_PREPEND(m, ARC_HDRNEWLEN, M_NOWAIT);
if (m == 0)
return 0;
diff --git a/sys/net/if_atmsubr.c b/sys/net/if_atmsubr.c
index 3ec3894..21b9f07 100644
--- a/sys/net/if_atmsubr.c
+++ b/sys/net/if_atmsubr.c
@@ -189,7 +189,7 @@ atm_output(ifp, m0, dst, rt0)
sz = sizeof(atmdst);
atm_flags = ATM_PH_FLAGS(&atmdst);
if (atm_flags & ATM_PH_LLCSNAP) sz += 8; /* sizeof snap == 8 */
- M_PREPEND(m, sz, M_DONTWAIT);
+ M_PREPEND(m, sz, M_NOWAIT);
if (m == 0)
senderr(ENOBUFS);
ad = mtod(m, struct atm_pseudohdr *);
diff --git a/sys/net/if_disc.c b/sys/net/if_disc.c
index 79775f1..4bad637 100644
--- a/sys/net/if_disc.c
+++ b/sys/net/if_disc.c
@@ -87,7 +87,7 @@ disc_clone_create(struct if_clone *ifc, int unit)
struct ifnet *ifp;
struct disc_softc *sc;
- sc = malloc(sizeof(struct disc_softc), M_DISC, M_WAITOK);
+ sc = malloc(sizeof(struct disc_softc), M_DISC, 0);
bzero(sc, sizeof(struct disc_softc));
ifp = &sc->sc_if;
diff --git a/sys/net/if_ef.c b/sys/net/if_ef.c
index b064d38..e7362ae 100644
--- a/sys/net/if_ef.c
+++ b/sys/net/if_ef.c
@@ -430,7 +430,7 @@ ef_output(struct ifnet *ifp, struct mbuf **mp, struct sockaddr *dst, short *tp,
type = htons(m->m_pkthdr.len);
break;
case ETHER_FT_8022:
- M_PREPEND(m, ETHER_HDR_LEN + 3, M_TRYWAIT);
+ M_PREPEND(m, ETHER_HDR_LEN + 3, 0);
if (m == NULL) {
*mp = NULL;
return ENOBUFS;
@@ -453,7 +453,7 @@ ef_output(struct ifnet *ifp, struct mbuf **mp, struct sockaddr *dst, short *tp,
*hlen += 3;
break;
case ETHER_FT_SNAP:
- M_PREPEND(m, 8, M_TRYWAIT);
+ M_PREPEND(m, 8, 0);
if (m == NULL) {
*mp = NULL;
return ENOBUFS;
@@ -484,14 +484,14 @@ ef_clone(struct ef_link *efl, int ft)
int ifnlen;
efp = (struct efnet*)malloc(sizeof(struct efnet), M_IFADDR,
- M_WAITOK | M_ZERO);
+ M_ZERO);
if (efp == NULL)
return ENOMEM;
efp->ef_ifp = ifp;
eifp = &efp->ef_ac.ac_if;
ifnlen = 1 + snprintf(cbuf, sizeof(cbuf), "%s%df", ifp->if_name,
ifp->if_unit);
- ifname = (char*)malloc(ifnlen, M_IFADDR, M_WAITOK);
+ ifname = (char*)malloc(ifnlen, M_IFADDR, 0);
eifp->if_name = strcpy(ifname, cbuf);
eifp->if_unit = ft;
eifp->if_softc = efp;
@@ -514,7 +514,7 @@ ef_load(void)
if (ifp->if_type != IFT_ETHER) continue;
EFDEBUG("Found interface %s%d\n", ifp->if_name, ifp->if_unit);
efl = (struct ef_link*)malloc(sizeof(struct ef_link),
- M_IFADDR, M_WAITOK | M_ZERO);
+ M_IFADDR, M_ZERO);
if (efl == NULL) {
error = ENOMEM;
break;
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c
index c40c4d6..cb5a039 100644
--- a/sys/net/if_ethersubr.c
+++ b/sys/net/if_ethersubr.c
@@ -236,7 +236,7 @@ ether_output(ifp, m, dst, rt0)
if ( aa->aa_flags & AFA_PHASE2 ) {
struct llc llc;
- M_PREPEND(m, sizeof(struct llc), M_TRYWAIT);
+ M_PREPEND(m, sizeof(struct llc), 0);
llc.llc_dsap = llc.llc_ssap = LLC_SNAP_LSAP;
llc.llc_control = LLC_UI;
bcopy(at_org_code, llc.llc_snap_org_code, sizeof(at_org_code));
@@ -261,7 +261,7 @@ ether_output(ifp, m, dst, rt0)
type = htons( m->m_pkthdr.len);
break;
case 0xe0e0: /* Novell 802.2 and Token-Ring */
- M_PREPEND(m, 3, M_TRYWAIT);
+ M_PREPEND(m, 3, 0);
type = htons( m->m_pkthdr.len);
cp = mtod(m, u_char *);
*cp++ = 0xE0;
@@ -312,7 +312,7 @@ ether_output(ifp, m, dst, rt0)
* Add local net header. If no space in first mbuf,
* allocate another.
*/
- M_PREPEND(m, sizeof (struct ether_header), M_DONTWAIT);
+ M_PREPEND(m, sizeof (struct ether_header), M_NOWAIT);
if (m == 0)
senderr(ENOBUFS);
eh = mtod(m, struct ether_header *);
@@ -470,7 +470,7 @@ ether_ipfw_chk(struct mbuf **m0, struct ifnet *dst,
* Restore Ethernet header, as needed, in case the
* mbuf chain was replaced by ipfw.
*/
- M_PREPEND(m, ETHER_HDR_LEN, M_DONTWAIT);
+ M_PREPEND(m, ETHER_HDR_LEN, M_NOWAIT);
if (m == NULL) {
*m0 = m;
return 0;
@@ -494,7 +494,7 @@ ether_ipfw_chk(struct mbuf **m0, struct ifnet *dst,
* If shared, make a copy and keep the original.
*/
if (shared) {
- m = m_copypacket(m, M_DONTWAIT);
+ m = m_copypacket(m, M_NOWAIT);
if (m == NULL)
return 0;
} else {
@@ -894,7 +894,7 @@ discard:
* Put back the ethernet header so netgraph has a
* consistent view of inbound packets.
*/
- M_PREPEND(m, sizeof (struct ether_header), M_DONTWAIT);
+ M_PREPEND(m, sizeof (struct ether_header), M_NOWAIT);
(*ng_ether_input_orphan_p)(ifp, m);
return;
}
@@ -1113,7 +1113,7 @@ ether_resolvemulti(ifp, llsa, sa)
if (!IN_MULTICAST(ntohl(sin->sin_addr.s_addr)))
return EADDRNOTAVAIL;
MALLOC(sdl, struct sockaddr_dl *, sizeof *sdl, M_IFMADDR,
- M_WAITOK|M_ZERO);
+ M_ZERO);
sdl->sdl_len = sizeof *sdl;
sdl->sdl_family = AF_LINK;
sdl->sdl_index = ifp->if_index;
@@ -1140,7 +1140,7 @@ ether_resolvemulti(ifp, llsa, sa)
if (!IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr))
return EADDRNOTAVAIL;
MALLOC(sdl, struct sockaddr_dl *, sizeof *sdl, M_IFMADDR,
- M_WAITOK|M_ZERO);
+ M_ZERO);
sdl->sdl_len = sizeof *sdl;
sdl->sdl_family = AF_LINK;
sdl->sdl_index = ifp->if_index;
diff --git a/sys/net/if_faith.c b/sys/net/if_faith.c
index 280a041..08a5ca3 100644
--- a/sys/net/if_faith.c
+++ b/sys/net/if_faith.c
@@ -159,7 +159,7 @@ faith_clone_create(ifc, unit)
{
struct faith_softc *sc;
- sc = malloc(sizeof(struct faith_softc), M_FAITH, M_WAITOK);
+ sc = malloc(sizeof(struct faith_softc), M_FAITH, 0);
bzero(sc, sizeof(struct faith_softc));
sc->sc_if.if_softc = sc;
diff --git a/sys/net/if_fddisubr.c b/sys/net/if_fddisubr.c
index 49a5f21..05ff6ae 100644
--- a/sys/net/if_fddisubr.c
+++ b/sys/net/if_fddisubr.c
@@ -203,7 +203,7 @@ fddi_output(ifp, m, dst, rt0)
if (aa->aa_flags & AFA_PHASE2) {
struct llc llc;
- M_PREPEND(m, LLC_SNAPFRAMELEN, M_TRYWAIT);
+ M_PREPEND(m, LLC_SNAPFRAMELEN, 0);
if (m == 0)
senderr(ENOBUFS);
llc.llc_dsap = llc.llc_ssap = LLC_SNAP_LSAP;
@@ -290,7 +290,7 @@ fddi_output(ifp, m, dst, rt0)
*/
if (type != 0) {
struct llc *l;
- M_PREPEND(m, LLC_SNAPFRAMELEN, M_DONTWAIT);
+ M_PREPEND(m, LLC_SNAPFRAMELEN, M_NOWAIT);
if (m == 0)
senderr(ENOBUFS);
l = mtod(m, struct llc *);
@@ -305,7 +305,7 @@ fddi_output(ifp, m, dst, rt0)
* Add local net header. If no space in first mbuf,
* allocate another.
*/
- M_PREPEND(m, FDDI_HDR_LEN, M_DONTWAIT);
+ M_PREPEND(m, FDDI_HDR_LEN, M_NOWAIT);
if (m == 0)
senderr(ENOBUFS);
fh = mtod(m, struct fddi_header *);
@@ -706,7 +706,7 @@ fddi_resolvemulti(ifp, llsa, sa)
if (!IN_MULTICAST(ntohl(sin->sin_addr.s_addr)))
return (EADDRNOTAVAIL);
MALLOC(sdl, struct sockaddr_dl *, sizeof *sdl, M_IFMADDR,
- M_WAITOK);
+ 0);
sdl->sdl_len = sizeof *sdl;
sdl->sdl_family = AF_LINK;
sdl->sdl_index = ifp->if_index;
@@ -735,7 +735,7 @@ fddi_resolvemulti(ifp, llsa, sa)
if (!IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr))
return (EADDRNOTAVAIL);
MALLOC(sdl, struct sockaddr_dl *, sizeof *sdl, M_IFMADDR,
- M_WAITOK);
+ 0);
sdl->sdl_len = sizeof *sdl;
sdl->sdl_family = AF_LINK;
sdl->sdl_index = ifp->if_index;
diff --git a/sys/net/if_gif.c b/sys/net/if_gif.c
index 1cb4463..fce294d 100644
--- a/sys/net/if_gif.c
+++ b/sys/net/if_gif.c
@@ -137,7 +137,7 @@ gif_clone_create(ifc, unit)
{
struct gif_softc *sc;
- sc = malloc (sizeof(struct gif_softc), M_GIF, M_WAITOK);
+ sc = malloc (sizeof(struct gif_softc), M_GIF, 0);
bzero(sc, sizeof(struct gif_softc));
sc->gif_if.if_softc = sc;
@@ -777,12 +777,12 @@ gif_set_tunnel(ifp, src, dst)
}
osrc = sc->gif_psrc;
- sa = (struct sockaddr *)malloc(src->sa_len, M_IFADDR, M_WAITOK);
+ sa = (struct sockaddr *)malloc(src->sa_len, M_IFADDR, 0);
bcopy((caddr_t)src, (caddr_t)sa, src->sa_len);
sc->gif_psrc = sa;
odst = sc->gif_pdst;
- sa = (struct sockaddr *)malloc(dst->sa_len, M_IFADDR, M_WAITOK);
+ sa = (struct sockaddr *)malloc(dst->sa_len, M_IFADDR, 0);
bcopy((caddr_t)dst, (caddr_t)sa, dst->sa_len);
sc->gif_pdst = sa;
diff --git a/sys/net/if_gre.c b/sys/net/if_gre.c
index 6585396..33a4eff 100644
--- a/sys/net/if_gre.c
+++ b/sys/net/if_gre.c
@@ -160,7 +160,7 @@ gre_clone_create(ifc, unit)
{
struct gre_softc *sc;
- sc = malloc(sizeof(struct gre_softc), M_GRE, M_WAITOK);
+ sc = malloc(sizeof(struct gre_softc), M_GRE, 0);
memset(sc, 0, sizeof(struct gre_softc));
sc->sc_if.if_name = GRENAME;
@@ -294,7 +294,7 @@ gre_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
if ((m->m_data - msiz) < m->m_pktdat) {
/* need new mbuf */
- MGETHDR(m0, M_DONTWAIT, MT_HEADER);
+ MGETHDR(m0, M_NOWAIT, MT_HEADER);
if (m0 == NULL) {
_IF_DROP(&ifp->if_snd);
m_freem(m);
@@ -348,7 +348,7 @@ gre_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
error = EAFNOSUPPORT;
goto end;
}
- M_PREPEND(m, sizeof(struct greip), M_DONTWAIT);
+ M_PREPEND(m, sizeof(struct greip), M_NOWAIT);
} else {
_IF_DROP(&ifp->if_snd);
m_freem(m);
diff --git a/sys/net/if_ieee80211subr.c b/sys/net/if_ieee80211subr.c
index b088e26..e672435 100644
--- a/sys/net/if_ieee80211subr.c
+++ b/sys/net/if_ieee80211subr.c
@@ -406,7 +406,7 @@ ieee80211_input(struct ifnet *ifp, struct mbuf *m, int rssi, u_int32_t rstamp)
if (ic->ic_opmode == IEEE80211_M_HOSTAP) {
eh = mtod(m, struct ether_header *);
if (ETHER_IS_MULTICAST(eh->ether_dhost)) {
- m1 = m_copym(m, 0, M_COPYALL, M_DONTWAIT);
+ m1 = m_copym(m, 0, M_COPYALL, M_NOWAIT);
if (m1 == NULL)
ifp->if_oerrors++;
else
@@ -517,7 +517,7 @@ ieee80211_mgmt_output(struct ifnet *ifp, struct ieee80211_node *ni,
if (ni == NULL)
ni = &ic->ic_bss;
ni->ni_inact = 0;
- M_PREPEND(m, sizeof(struct ieee80211_frame), M_DONTWAIT);
+ M_PREPEND(m, sizeof(struct ieee80211_frame), M_NOWAIT);
if (m == NULL)
return ENOMEM;
wh = mtod(m, struct ieee80211_frame *);
@@ -585,7 +585,7 @@ ieee80211_encap(struct ifnet *ifp, struct mbuf *m)
llc->llc_snap.org_code[1] = 0;
llc->llc_snap.org_code[2] = 0;
llc->llc_snap.ether_type = eh.ether_type;
- M_PREPEND(m, sizeof(struct ieee80211_frame), M_DONTWAIT);
+ M_PREPEND(m, sizeof(struct ieee80211_frame), M_NOWAIT);
if (m == NULL)
return NULL;
wh = mtod(m, struct ieee80211_frame *);
@@ -671,7 +671,7 @@ ieee80211_decap(struct ifnet *ifp, struct mbuf *m)
pktlen = m->m_pkthdr.len;
while (pktlen > off) {
if (n0 == NULL) {
- MGETHDR(n, M_DONTWAIT, MT_DATA);
+ MGETHDR(n, M_NOWAIT, MT_DATA);
if (n == NULL) {
m_freem(m);
return NULL;
@@ -679,7 +679,7 @@ ieee80211_decap(struct ifnet *ifp, struct mbuf *m)
M_MOVE_PKTHDR(n, m);
n->m_len = MHLEN;
} else {
- MGET(n, M_DONTWAIT, MT_DATA);
+ MGET(n, M_NOWAIT, MT_DATA);
if (n == NULL) {
m_freem(m);
m_freem(n0);
@@ -688,7 +688,7 @@ ieee80211_decap(struct ifnet *ifp, struct mbuf *m)
n->m_len = MLEN;
}
if (pktlen - off >= MINCLSIZE) {
- MCLGET(n, M_DONTWAIT);
+ MCLGET(n, M_NOWAIT);
if (n->m_flags & M_EXT)
n->m_len = n->m_ext.ext_size;
}
@@ -1407,7 +1407,7 @@ ieee80211_send_prreq(struct ieee80211com *ic, struct ieee80211_node *ni,
* [tlv] ssid
* [tlv] supported rates
*/
- MGETHDR(m, M_DONTWAIT, MT_DATA);
+ MGETHDR(m, M_NOWAIT, MT_DATA);
if (m == NULL)
return ENOMEM;
m->m_data += sizeof(struct ieee80211_frame);
@@ -1450,7 +1450,7 @@ ieee80211_send_prresp(struct ieee80211com *ic, struct ieee80211_node *bs0,
* [tlv] supported rates
* [tlv] parameter set (IBSS)
*/
- MGETHDR(m, M_DONTWAIT, MT_DATA);
+ MGETHDR(m, M_NOWAIT, MT_DATA);
if (m == NULL)
return ENOMEM;
m->m_data += sizeof(struct ieee80211_frame);
@@ -1503,7 +1503,7 @@ ieee80211_send_auth(struct ieee80211com *ic, struct ieee80211_node *ni,
u_int16_t *frm;
int ret;
- MGETHDR(m, M_DONTWAIT, MT_DATA);
+ MGETHDR(m, M_NOWAIT, MT_DATA);
if (m == NULL)
return ENOMEM;
MH_ALIGN(m, 2 * 3);
@@ -1529,7 +1529,7 @@ ieee80211_send_deauth(struct ieee80211com *ic, struct ieee80211_node *ni,
if (ifp->if_flags & IFF_DEBUG)
if_printf(ifp, "station %s deauthenticate (reason %d)\n",
ether_sprintf(ni->ni_macaddr), reason);
- MGETHDR(m, M_DONTWAIT, MT_DATA);
+ MGETHDR(m, M_NOWAIT, MT_DATA);
if (m == NULL)
return ENOMEM;
MH_ALIGN(m, 2);
@@ -1555,7 +1555,7 @@ ieee80211_send_asreq(struct ieee80211com *ic, struct ieee80211_node *ni,
* [tlv] ssid
* [tlv] supported rates
*/
- MGETHDR(m, M_DONTWAIT, MT_DATA);
+ MGETHDR(m, M_NOWAIT, MT_DATA);
if (m == NULL)
return ENOMEM;
m->m_data += sizeof(struct ieee80211_frame);
@@ -1613,7 +1613,7 @@ ieee80211_send_asresp(struct ieee80211com *ic, struct ieee80211_node *ni,
* [2] association ID
* [tlv] supported rates
*/
- MGETHDR(m, M_DONTWAIT, MT_DATA);
+ MGETHDR(m, M_NOWAIT, MT_DATA);
if (m == NULL)
return ENOMEM;
m->m_data += sizeof(struct ieee80211_frame);
@@ -1659,7 +1659,7 @@ ieee80211_send_disassoc(struct ieee80211com *ic, struct ieee80211_node *ni,
if (ifp->if_flags & IFF_DEBUG)
if_printf(ifp, "station %s disassociate (reason %d)\n",
ether_sprintf(ni->ni_macaddr), reason);
- MGETHDR(m, M_DONTWAIT, MT_DATA);
+ MGETHDR(m, M_NOWAIT, MT_DATA);
if (m == NULL)
return ENOMEM;
MH_ALIGN(m, 2);
@@ -2476,7 +2476,7 @@ ieee80211_wep_crypt(struct ifnet *ifp, struct mbuf *m0, int txflag)
}
m = m0;
left = m->m_pkthdr.len;
- MGET(n, M_DONTWAIT, m->m_type);
+ MGET(n, M_NOWAIT, m->m_type);
n0 = n;
if (n == NULL)
goto fail;
@@ -2490,7 +2490,7 @@ ieee80211_wep_crypt(struct ifnet *ifp, struct mbuf *m0, int txflag)
}
n->m_len = MHLEN;
if (n->m_pkthdr.len >= MINCLSIZE) {
- MCLGET(n, M_DONTWAIT);
+ MCLGET(n, M_NOWAIT);
if (n->m_flags & M_EXT)
n->m_len = n->m_ext.ext_size;
}
@@ -2544,13 +2544,13 @@ ieee80211_wep_crypt(struct ifnet *ifp, struct mbuf *m0, int txflag)
if (len > n->m_len - noff) {
len = n->m_len - noff;
if (len == 0) {
- MGET(n->m_next, M_DONTWAIT, n->m_type);
+ MGET(n->m_next, M_NOWAIT, n->m_type);
if (n->m_next == NULL)
goto fail;
n = n->m_next;
n->m_len = MLEN;
if (left >= MINCLSIZE) {
- MCLGET(n, M_DONTWAIT);
+ MCLGET(n, M_NOWAIT);
if (n->m_flags & M_EXT)
n->m_len = n->m_ext.ext_size;
}
@@ -2579,7 +2579,7 @@ ieee80211_wep_crypt(struct ifnet *ifp, struct mbuf *m0, int txflag)
n->m_len = noff + sizeof(crcbuf);
else {
n->m_len = noff;
- MGET(n->m_next, M_DONTWAIT, n->m_type);
+ MGET(n->m_next, M_NOWAIT, n->m_type);
if (n->m_next == NULL)
goto fail;
n = n->m_next;
diff --git a/sys/net/if_iso88025subr.c b/sys/net/if_iso88025subr.c
index acb1147..4fa3e36 100644
--- a/sys/net/if_iso88025subr.c
+++ b/sys/net/if_iso88025subr.c
@@ -299,7 +299,7 @@ iso88025_output(ifp, m, dst, rt0)
bcopy((caddr_t)&(satoipx_addr(dst).x_host), (caddr_t)edst,
sizeof (edst));
- M_PREPEND(m, 3, M_TRYWAIT);
+ M_PREPEND(m, 3, 0);
if (m == 0)
senderr(ENOBUFS);
m = m_pullup(m, 3);
@@ -342,7 +342,7 @@ iso88025_output(ifp, m, dst, rt0)
if (snap_type != 0) {
struct llc *l;
- M_PREPEND(m, sizeof (struct llc), M_DONTWAIT);
+ M_PREPEND(m, sizeof (struct llc), M_NOWAIT);
if (m == 0)
senderr(ENOBUFS);
l = mtod(m, struct llc *);
@@ -358,7 +358,7 @@ iso88025_output(ifp, m, dst, rt0)
* Add local net header. If no space in first mbuf,
* allocate another.
*/
- M_PREPEND(m, ISO88025_HDR_LEN + rif_len, M_DONTWAIT);
+ M_PREPEND(m, ISO88025_HDR_LEN + rif_len, M_NOWAIT);
if (m == 0)
senderr(ENOBUFS);
diff --git a/sys/net/if_loop.c b/sys/net/if_loop.c
index c753fdc..deeecab 100644
--- a/sys/net/if_loop.c
+++ b/sys/net/if_loop.c
@@ -147,7 +147,7 @@ lo_clone_create(ifc, unit)
{
struct lo_softc *sc;
- MALLOC(sc, struct lo_softc *, sizeof(*sc), M_LO, M_WAITOK | M_ZERO);
+ MALLOC(sc, struct lo_softc *, sizeof(*sc), M_LO, M_ZERO);
sc->sc_if.if_name = LONAME;
sc->sc_if.if_unit = unit;
@@ -215,7 +215,7 @@ looutput(ifp, m, dst, rt)
struct mbuf *n;
/* XXX MT_HEADER should be m->m_type */
- MGETHDR(n, M_DONTWAIT, MT_HEADER);
+ MGETHDR(n, M_NOWAIT, MT_HEADER);
if (!n)
goto contiguousfail;
M_MOVE_PKTHDR(n, m);
@@ -227,7 +227,7 @@ looutput(ifp, m, dst, rt)
*/
m->m_pkthdr.label.l_flags &= ~MAC_FLAG_INITIALIZED;
#endif
- MCLGET(n, M_DONTWAIT);
+ MCLGET(n, M_NOWAIT);
if (! (n->m_flags & M_EXT)) {
m_freem(n);
goto contiguousfail;
diff --git a/sys/net/if_ppp.c b/sys/net/if_ppp.c
index aab5377..82c5c1e 100644
--- a/sys/net/if_ppp.c
+++ b/sys/net/if_ppp.c
@@ -199,7 +199,7 @@ ppp_clone_create(struct if_clone *ifc, int unit)
{
struct ppp_softc *sc;
- sc = malloc(sizeof(struct ppp_softc), M_PPP, M_WAITOK | M_ZERO);
+ sc = malloc(sizeof(struct ppp_softc), M_PPP, M_ZERO);
sc->sc_if.if_softc = sc;
sc->sc_if.if_name = PPPNAME;
sc->sc_if.if_unit = unit;
@@ -572,7 +572,7 @@ pppioctl(sc, cmd, data, flag, td)
}
newcodelen = nbp->bf_len * sizeof(struct bpf_insn);
if (newcodelen != 0) {
- MALLOC(newcode, struct bpf_insn *, newcodelen, M_DEVBUF, M_WAITOK);
+ MALLOC(newcode, struct bpf_insn *, newcodelen, M_DEVBUF, 0);
if (newcode == 0) {
error = EINVAL; /* or sumpin */
break;
@@ -831,7 +831,7 @@ pppoutput(ifp, m0, dst, rtp)
* (This assumes M_LEADINGSPACE is always 0 for a cluster mbuf.)
*/
if (M_LEADINGSPACE(m0) < PPP_HDRLEN) {
- m0 = m_prepend(m0, PPP_HDRLEN, M_DONTWAIT);
+ m0 = m_prepend(m0, PPP_HDRLEN, M_NOWAIT);
if (m0 == 0) {
error = ENOBUFS;
goto bad;
@@ -1411,13 +1411,13 @@ ppp_inproc(sc, m)
}
/* Copy the PPP and IP headers into a new mbuf. */
- MGETHDR(mp, M_DONTWAIT, MT_DATA);
+ MGETHDR(mp, M_NOWAIT, MT_DATA);
if (mp == NULL)
goto bad;
mp->m_len = 0;
mp->m_next = NULL;
if (hlen + PPP_HDRLEN > MHLEN) {
- MCLGET(mp, M_DONTWAIT);
+ MCLGET(mp, M_NOWAIT);
if (M_TRAILINGSPACE(mp) < hlen + PPP_HDRLEN) {
m_freem(mp);
goto bad; /* lose if big headers and no clusters */
@@ -1475,7 +1475,7 @@ ppp_inproc(sc, m)
* whole cluster on it.
*/
if (ilen <= MHLEN && M_IS_CLUSTER(m)) {
- MGETHDR(mp, M_DONTWAIT, MT_DATA);
+ MGETHDR(mp, M_NOWAIT, MT_DATA);
if (mp != NULL) {
#ifdef MAC
mac_create_mbuf_from_mbuf(m, mp);
diff --git a/sys/net/if_sl.c b/sys/net/if_sl.c
index b57eb93..2c3a222 100644
--- a/sys/net/if_sl.c
+++ b/sys/net/if_sl.c
@@ -265,11 +265,11 @@ slcreate()
int unit;
struct mbuf *m;
- MALLOC(sc, struct sl_softc *, sizeof(*sc), M_SL, M_WAITOK | M_ZERO);
+ MALLOC(sc, struct sl_softc *, sizeof(*sc), M_SL, M_ZERO);
- m = m_gethdr(M_TRYWAIT, MT_DATA);
+ m = m_gethdr(0, MT_DATA);
if (m != NULL) {
- MCLGET(m, M_TRYWAIT);
+ MCLGET(m, 0);
if ((m->m_flags & M_EXT) == 0) {
m_free(m);
m = NULL;
@@ -792,7 +792,7 @@ sl_btom(sc, len)
{
struct mbuf *m, *newm;
- MGETHDR(m, M_DONTWAIT, MT_DATA);
+ MGETHDR(m, M_NOWAIT, MT_DATA);
if (m == NULL)
return (NULL);
@@ -804,7 +804,7 @@ sl_btom(sc, len)
* guarantees that packet will fit in a cluster.
*/
if (len >= MHLEN) {
- MCLGET(m, M_DONTWAIT);
+ MCLGET(m, M_NOWAIT);
if ((m->m_flags & M_EXT) == 0) {
/*
* we couldn't get a cluster - if memory's this
diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c
index 61dbb6f..7014a89 100644
--- a/sys/net/if_spppsubr.c
+++ b/sys/net/if_spppsubr.c
@@ -618,7 +618,7 @@ sppp_input(struct ifnet *ifp, struct mbuf *m)
* enough leading space in the existing mbuf).
*/
m_adj(m, vjlen);
- M_PREPEND(m, hlen, M_DONTWAIT);
+ M_PREPEND(m, hlen, M_NOWAIT);
if (m == NULL)
goto drop2;
bcopy(iphdr, mtod(m, u_char *), hlen);
@@ -892,7 +892,7 @@ sppp_output(struct ifnet *ifp, struct mbuf *m,
/*
* Prepend general data packet PPP header. For now, IP only.
*/
- M_PREPEND (m, PPP_HEADER_LEN, M_DONTWAIT);
+ M_PREPEND (m, PPP_HEADER_LEN, M_NOWAIT);
if (! m) {
if (debug)
log(LOG_DEBUG, SPP_FMT "no memory for transmit header\n",
@@ -1034,7 +1034,7 @@ sppp_attach(struct ifnet *ifp)
#ifdef INET6
sp->confflags |= CONF_ENABLE_IPV6;
#endif
- sp->pp_comp = malloc(sizeof(struct slcompress), M_TEMP, M_WAIT);
+ sp->pp_comp = malloc(sizeof(struct slcompress), M_TEMP, 0);
sl_compress_init(sp->pp_comp, -1);
sppp_lcp_init(sp);
sppp_ipcp_init(sp);
@@ -1355,7 +1355,7 @@ sppp_cisco_send(struct sppp *sp, int type, long par1, long par2)
getmicrouptime(&tv);
#endif
- MGETHDR (m, M_DONTWAIT, MT_DATA);
+ MGETHDR (m, M_NOWAIT, MT_DATA);
if (! m)
return;
m->m_pkthdr.len = m->m_len = PPP_HEADER_LEN + CISCO_PACKET_LEN;
@@ -1408,7 +1408,7 @@ sppp_cp_send(struct sppp *sp, u_short proto, u_char type,
if (len > MHLEN - PPP_HEADER_LEN - LCP_HEADER_LEN)
len = MHLEN - PPP_HEADER_LEN - LCP_HEADER_LEN;
- MGETHDR (m, M_DONTWAIT, MT_DATA);
+ MGETHDR (m, M_NOWAIT, MT_DATA);
if (! m)
return;
m->m_pkthdr.len = m->m_len = PPP_HEADER_LEN + LCP_HEADER_LEN + len;
@@ -4614,7 +4614,7 @@ sppp_auth_send(const struct cp *cp, struct sppp *sp,
const char *msg;
va_list ap;
- MGETHDR (m, M_DONTWAIT, MT_DATA);
+ MGETHDR (m, M_NOWAIT, MT_DATA);
if (! m)
return;
m->m_pkthdr.rcvif = 0;
diff --git a/sys/net/if_stf.c b/sys/net/if_stf.c
index 1d84836..b96883c 100644
--- a/sys/net/if_stf.c
+++ b/sys/net/if_stf.c
@@ -179,7 +179,7 @@ stf_clone_create(ifc, unit)
{
struct stf_softc *sc;
- sc = malloc(sizeof(struct stf_softc), M_STF, M_WAITOK | M_ZERO);
+ sc = malloc(sizeof(struct stf_softc), M_STF, M_ZERO);
sc->sc_if.if_name = STFNAME;
sc->sc_if.if_unit = unit;
@@ -446,7 +446,7 @@ stf_output(ifp, m, dst, rt)
}
#endif /*NBPFILTER > 0*/
- M_PREPEND(m, sizeof(struct ip), M_DONTWAIT);
+ M_PREPEND(m, sizeof(struct ip), M_NOWAIT);
if (m && m->m_len < sizeof(struct ip))
m = m_pullup(m, sizeof(struct ip));
if (m == NULL) {
diff --git a/sys/net/if_tap.c b/sys/net/if_tap.c
index 0648200..385d6c7 100644
--- a/sys/net/if_tap.c
+++ b/sys/net/if_tap.c
@@ -334,7 +334,7 @@ tapcreate(dev)
char *name = NULL;
/* allocate driver storage and create device */
- MALLOC(tp, struct tap_softc *, sizeof(*tp), M_TAP, M_WAITOK | M_ZERO);
+ MALLOC(tp, struct tap_softc *, sizeof(*tp), M_TAP, M_ZERO);
SLIST_INSERT_HEAD(&taphead, tp, tap_next);
unit = dev2unit(dev) & TAPMAXUNIT;
@@ -849,7 +849,7 @@ tapwrite(dev, uio, flag)
tlen = uio->uio_resid;
/* get a header mbuf */
- MGETHDR(m, M_DONTWAIT, MT_DATA);
+ MGETHDR(m, M_NOWAIT, MT_DATA);
if (m == NULL)
return (ENOBUFS);
mlen = MHLEN;
@@ -862,7 +862,7 @@ tapwrite(dev, uio, flag)
*mp = m;
mp = &m->m_next;
if (uio->uio_resid > 0) {
- MGET(m, M_DONTWAIT, MT_DATA);
+ MGET(m, M_NOWAIT, MT_DATA);
if (m == NULL) {
error = ENOBUFS;
break;
diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c
index ce39d1f..3bb5a8c 100644
--- a/sys/net/if_tun.c
+++ b/sys/net/if_tun.c
@@ -240,7 +240,7 @@ tuncreate(dev_t dev)
dev = make_dev(&tun_cdevsw, minor(dev),
UID_UUCP, GID_DIALER, 0600, "tun%d", dev2unit(dev));
- MALLOC(sc, struct tun_softc *, sizeof(*sc), M_TUN, M_WAITOK | M_ZERO);
+ MALLOC(sc, struct tun_softc *, sizeof(*sc), M_TUN, M_ZERO);
sc->tun_flags = TUN_INITED;
sc->next = tunhead;
tunhead = sc;
@@ -494,7 +494,7 @@ tunoutput(
/* prepend sockaddr? this may abort if the mbuf allocation fails */
if (tp->tun_flags & TUN_LMODE) {
/* allocate space for sockaddr */
- M_PREPEND(m0, dst->sa_len, M_DONTWAIT);
+ M_PREPEND(m0, dst->sa_len, M_NOWAIT);
/* if allocation failed drop packet */
if (m0 == NULL) {
@@ -508,7 +508,7 @@ tunoutput(
if (tp->tun_flags & TUN_IFHEAD) {
/* Prepend the address family */
- M_PREPEND(m0, 4, M_DONTWAIT);
+ M_PREPEND(m0, 4, M_NOWAIT);
/* if allocation failed drop packet */
if (m0 == NULL) {
@@ -728,7 +728,7 @@ tunwrite(dev_t dev, struct uio *uio, int flag)
tlen = uio->uio_resid;
/* get a header mbuf */
- MGETHDR(m, M_DONTWAIT, MT_DATA);
+ MGETHDR(m, M_NOWAIT, MT_DATA);
if (m == NULL)
return (ENOBUFS);
mlen = MHLEN;
@@ -741,7 +741,7 @@ tunwrite(dev_t dev, struct uio *uio, int flag)
*mp = m;
mp = &m->m_next;
if (uio->uio_resid > 0) {
- MGET (m, M_DONTWAIT, MT_DATA);
+ MGET (m, M_NOWAIT, MT_DATA);
if (m == 0) {
error = ENOBUFS;
break;
diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c
index 1850e8d..5671292 100644
--- a/sys/net/if_vlan.c
+++ b/sys/net/if_vlan.c
@@ -168,7 +168,7 @@ vlan_setmulti(struct ifnet *ifp)
TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
- mc = malloc(sizeof(struct vlan_mc_entry), M_VLAN, M_WAITOK);
+ mc = malloc(sizeof(struct vlan_mc_entry), M_VLAN, 0);
bcopy(LLADDR((struct sockaddr_dl *)ifma->ifma_addr),
(char *)&mc->mc_addr, ETHER_ADDR_LEN);
SLIST_INSERT_HEAD(&sc->vlan_mc_listhead, mc, mc_entries);
@@ -232,7 +232,7 @@ vlan_clone_create(struct if_clone *ifc, int unit)
struct ifnet *ifp;
int s;
- ifv = malloc(sizeof(struct ifvlan), M_VLAN, M_WAITOK | M_ZERO);
+ ifv = malloc(sizeof(struct ifvlan), M_VLAN, M_ZERO);
ifp = &ifv->ifv_if;
SLIST_INIT(&ifv->vlan_mc_listhead);
@@ -323,7 +323,7 @@ vlan_start(struct ifnet *ifp)
struct m_tag *mtag = m_tag_alloc(MTAG_VLAN,
MTAG_VLAN_TAG,
sizeof (u_int),
- M_DONTWAIT);
+ M_NOWAIT);
if (mtag == NULL) {
ifp->if_oerrors++;
m_freem(m);
@@ -332,7 +332,7 @@ vlan_start(struct ifnet *ifp)
*(u_int*)(mtag+1) = ifv->ifv_tag;
m_tag_prepend(m, mtag);
} else {
- M_PREPEND(m, ifv->ifv_encaplen, M_DONTWAIT);
+ M_PREPEND(m, ifv->ifv_encaplen, M_NOWAIT);
if (m == NULL) {
if_printf(ifp, "unable to prepend VLAN header");
ifp->if_ierrors++;
diff --git a/sys/net/if_vlan_var.h b/sys/net/if_vlan_var.h
index 42f2dcc..ff656a6 100644
--- a/sys/net/if_vlan_var.h
+++ b/sys/net/if_vlan_var.h
@@ -98,7 +98,7 @@ struct vlanreq {
#define VLAN_INPUT_TAG(_ifp, _m, _t, _errcase) do { \
struct m_tag *mtag; \
mtag = m_tag_alloc(MTAG_VLAN, MTAG_VLAN_TAG, \
- sizeof (u_int), M_DONTWAIT); \
+ sizeof (u_int), M_NOWAIT); \
if (mtag == NULL) { \
(_ifp)->if_ierrors++; \
m_freem(_m); \
diff --git a/sys/net/pfil.c b/sys/net/pfil.c
index 2ed40b2..a53051b 100644
--- a/sys/net/pfil.c
+++ b/sys/net/pfil.c
@@ -61,7 +61,7 @@ pfil_init(ph)
* PFIL_IN call me on incoming packets
* PFIL_OUT call me on outgoing packets
* PFIL_ALL call me on all of the above
- * PFIL_WAITOK OK to call malloc with M_WAITOK.
+ * PFIL_WAITOK OK to call malloc with 0.
*/
int
pfil_add_hook(func, flags, ph)
@@ -97,7 +97,7 @@ pfil_list_add(list, func, flags)
struct packet_filter_hook *pfh;
pfh = (struct packet_filter_hook *)malloc(sizeof(*pfh), M_IFADDR,
- flags & PFIL_WAITOK ? M_WAITOK : M_NOWAIT);
+ flags & PFIL_WAITOK ? 0 : M_NOWAIT);
if (pfh == NULL)
return ENOMEM;
pfh->pfil_func = func;
diff --git a/sys/net/ppp_deflate.c b/sys/net/ppp_deflate.c
index 3c7884e..96fb810 100644
--- a/sys/net/ppp_deflate.c
+++ b/sys/net/ppp_deflate.c
@@ -248,12 +248,12 @@ z_compress(arg, mret, mp, orig_len, maxolen)
/* Allocate one mbuf initially. */
if (maxolen > orig_len)
maxolen = orig_len;
- MGET(m, M_DONTWAIT, MT_DATA);
+ MGET(m, M_NOWAIT, MT_DATA);
*mret = m;
if (m != NULL) {
m->m_len = 0;
if (maxolen + state->hdrlen > MLEN)
- MCLGET(m, M_DONTWAIT);
+ MCLGET(m, M_NOWAIT);
wspace = M_TRAILINGSPACE(m);
if (state->hdrlen + PPP_HDRLEN + 2 < wspace) {
m->m_data += state->hdrlen;
@@ -308,12 +308,12 @@ z_compress(arg, mret, mp, orig_len, maxolen)
if (m != NULL) {
m->m_len = wspace;
olen += wspace;
- MGET(m->m_next, M_DONTWAIT, MT_DATA);
+ MGET(m->m_next, M_NOWAIT, MT_DATA);
m = m->m_next;
if (m != NULL) {
m->m_len = 0;
if (maxolen - olen > MLEN)
- MCLGET(m, M_DONTWAIT);
+ MCLGET(m, M_NOWAIT);
state->strm.next_out = mtod(m, u_char *);
state->strm.avail_out = wspace = M_TRAILINGSPACE(m);
}
@@ -507,13 +507,13 @@ z_decompress(arg, mi, mop)
++state->seqno;
/* Allocate an output mbuf. */
- MGETHDR(mo, M_DONTWAIT, MT_DATA);
+ MGETHDR(mo, M_NOWAIT, MT_DATA);
if (mo == NULL)
return DECOMP_ERROR;
mo_head = mo;
mo->m_len = 0;
mo->m_next = NULL;
- MCLGET(mo, M_DONTWAIT);
+ MCLGET(mo, M_NOWAIT);
ospace = M_TRAILINGSPACE(mo);
if (state->hdrlen + PPP_HDRLEN < ospace) {
mo->m_data += state->hdrlen;
@@ -582,13 +582,13 @@ z_decompress(arg, mi, mop)
} else {
mo->m_len = ospace;
olen += ospace;
- MGET(mo->m_next, M_DONTWAIT, MT_DATA);
+ MGET(mo->m_next, M_NOWAIT, MT_DATA);
mo = mo->m_next;
if (mo == NULL) {
m_freem(mo_head);
return DECOMP_ERROR;
}
- MCLGET(mo, M_DONTWAIT);
+ MCLGET(mo, M_NOWAIT);
state->strm.next_out = mtod(mo, u_char *);
state->strm.avail_out = ospace = M_TRAILINGSPACE(mo);
}
diff --git a/sys/net/ppp_tty.c b/sys/net/ppp_tty.c
index ce05012..92215f1 100644
--- a/sys/net/ppp_tty.c
+++ b/sys/net/ppp_tty.c
@@ -397,7 +397,7 @@ pppwrite(tp, uio, flag)
s = spltty();
for (mp = &m0; uio->uio_resid; mp = &m->m_next) {
- MGET(m, M_TRYWAIT, MT_DATA);
+ MGET(m, 0, MT_DATA);
if ((*mp = m) == NULL) {
m_freem(m0);
splx(s);
@@ -405,7 +405,7 @@ pppwrite(tp, uio, flag)
}
m->m_len = 0;
if (uio->uio_resid >= MCLBYTES / 2)
- MCLGET(m, M_DONTWAIT);
+ MCLGET(m, M_NOWAIT);
len = M_TRAILINGSPACE(m);
if (len > uio->uio_resid)
len = uio->uio_resid;
@@ -809,11 +809,11 @@ pppgetm(sc)
mp = &sc->sc_m;
for (len = sc->sc_mru + PPP_HDRLEN + PPP_FCSLEN; len > 0; ){
if ((m = *mp) == NULL) {
- MGETHDR(m, M_DONTWAIT, MT_DATA);
+ MGETHDR(m, M_NOWAIT, MT_DATA);
if (m == NULL)
break;
*mp = m;
- MCLGET(m, M_DONTWAIT);
+ MCLGET(m, M_NOWAIT);
}
len -= M_DATASIZE(m);
mp = &m->m_next;
diff --git a/sys/net/raw_cb.c b/sys/net/raw_cb.c
index 6f3f8b5..66abcd0 100644
--- a/sys/net/raw_cb.c
+++ b/sys/net/raw_cb.c
@@ -139,7 +139,7 @@ raw_bind(so, nam)
if (ifnet == 0)
return (EADDRNOTAVAIL);
rp = sotorawcb(so);
- nam = m_copym(nam, 0, M_COPYALL, M_TRYWAIT);
+ nam = m_copym(nam, 0, M_COPYALL, 0);
rp->rcb_laddr = mtod(nam, struct sockaddr *);
return (0);
}
diff --git a/sys/net/route.c b/sys/net/route.c
index 7847466..ee0b7d3 100644
--- a/sys/net/route.c
+++ b/sys/net/route.c
@@ -1071,7 +1071,7 @@ rtinit(ifa, cmd, flags)
* (Assuming we have a mask)
*/
if (netmask != NULL) {
- m = m_get(M_DONTWAIT, MT_SONAME);
+ m = m_get(M_NOWAIT, MT_SONAME);
if (m == NULL)
return(ENOBUFS);
deldst = mtod(m, struct sockaddr *);
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c
index 4780cc5..3b5457d 100644
--- a/sys/net/rtsock.c
+++ b/sys/net/rtsock.c
@@ -110,7 +110,7 @@ rts_attach(struct socket *so, int proto, struct thread *td)
if (sotorawcb(so) != 0)
return EISCONN; /* XXX panic? */
/* XXX */
- MALLOC(rp, struct rawcb *, sizeof *rp, M_PCB, M_WAITOK | M_ZERO);
+ MALLOC(rp, struct rawcb *, sizeof *rp, M_PCB, M_ZERO);
if (rp == 0)
return ENOBUFS;
@@ -608,9 +608,9 @@ rt_msg1(type, rtinfo)
}
if (len > MCLBYTES)
panic("rt_msg1");
- m = m_gethdr(M_DONTWAIT, MT_DATA);
+ m = m_gethdr(M_NOWAIT, MT_DATA);
if (m && len > MHLEN) {
- MCLGET(m, M_DONTWAIT);
+ MCLGET(m, M_NOWAIT);
if ((m->m_flags & M_EXT) == 0) {
m_free(m);
m = NULL;
OpenPOWER on IntegriCloud