Index: net/bridge.c =================================================================== RCS file: /home/hiten/ncvs/src/sys/net/bridge.c,v retrieving revision 1.59 diff -u -r1.59 bridge.c --- net/bridge.c 14 Nov 2002 23:57:09 -0000 1.59 +++ net/bridge.c 19 Dec 2002 09:52:58 -0000 @@ -239,7 +239,7 @@ goto found; /* Not found, need to reallocate */ - c = malloc((1+n_clusters) * sizeof (*c), M_IFADDR, M_DONTWAIT | M_ZERO); + c = malloc((1+n_clusters) * sizeof (*c), M_IFADDR, M_NOWAIT | M_ZERO); if (c == NULL) {/* malloc failure */ printf("-- bridge: cannot add new cluster\n"); return NULL; @@ -793,7 +793,7 @@ bdg_forward(struct mbuf *m0, struct ifnet *dst) { #define EH_RESTORE(_m) do { \ - M_PREPEND((_m), ETHER_HDR_LEN, M_NOWAIT); \ + M_PREPEND((_m), ETHER_HDR_LEN, M_DONTWAIT); \ if ((_m) == NULL) { \ bdg_dropped++; \ return NULL; \ Index: net/if_ethersubr.c =================================================================== RCS file: /home/hiten/ncvs/src/sys/net/if_ethersubr.c,v retrieving revision 1.131 diff -u -r1.131 if_ethersubr.c --- net/if_ethersubr.c 20 Nov 2002 19:07:27 -0000 1.131 +++ net/if_ethersubr.c 19 Dec 2002 09:49:58 -0000 @@ -470,7 +470,7 @@ * Restore Ethernet header, as needed, in case the * mbuf chain was replaced by ipfw. */ - M_PREPEND(m, ETHER_HDR_LEN, M_NOWAIT); + M_PREPEND(m, ETHER_HDR_LEN, M_DONTWAIT); if (m == NULL) { *m0 = m; return 0; @@ -894,7 +894,7 @@ * Put back the ethernet header so netgraph has a * consistent view of inbound packets. */ - M_PREPEND(m, sizeof (struct ether_header), M_NOWAIT); + M_PREPEND(m, sizeof (struct ether_header), M_DONTWAIT); (*ng_ether_input_orphan_p)(ifp, m); return; } Index: net/radix.c =================================================================== RCS file: /home/hiten/ncvs/src/sys/net/radix.c,v retrieving revision 1.26 diff -u -r1.26 radix.c --- net/radix.c 9 Nov 2002 12:55:06 -0000 1.26 +++ net/radix.c 19 Dec 2002 10:35:02 -0000 @@ -42,7 +42,6 @@ #ifdef _KERNEL #include #include -#define M_DONTWAIT M_NOWAIT #include #else #include Index: net/radix.h =================================================================== RCS file: /home/hiten/ncvs/src/sys/net/radix.h,v retrieving revision 1.18 diff -u -r1.18 radix.h --- net/radix.h 19 Mar 2002 21:54:18 -0000 1.18 +++ net/radix.h 15 Dec 2002 04:43:56 -0000 @@ -150,7 +150,7 @@ #define Bcmp(a, b, n) bcmp(((caddr_t)(a)), ((caddr_t)(b)), (unsigned)(n)) #define Bcopy(a, b, n) bcopy(((caddr_t)(a)), ((caddr_t)(b)), (unsigned)(n)) #define Bzero(p, n) bzero((caddr_t)(p), (unsigned)(n)); -#define R_Malloc(p, t, n) (p = (t) malloc((unsigned long)(n), M_RTABLE, M_DONTWAIT)) +#define R_Malloc(p, t, n) (p = (t) malloc((unsigned long)(n), M_RTABLE, M_NOWAIT)) #define Free(p) free((caddr_t)p, M_RTABLE); #endif /* _KERNEL */ Index: net/raw_cb.c =================================================================== RCS file: /home/hiten/ncvs/src/sys/net/raw_cb.c,v retrieving revision 1.22 diff -u -r1.22 raw_cb.c --- net/raw_cb.c 20 Nov 2002 19:00:53 -0000 1.22 +++ net/raw_cb.c 15 Dec 2002 05:05:52 -0000 @@ -139,7 +139,7 @@ if (ifnet == 0) return (EADDRNOTAVAIL); rp = sotorawcb(so); - nam = m_copym(nam, 0, M_COPYALL, M_WAITOK); + nam = m_copym(nam, 0, M_COPYALL, M_TRYWAIT); rp->rcb_laddr = mtod(nam, struct sockaddr *); return (0); } Index: netgraph/ng_bridge.c =================================================================== RCS file: /home/hiten/ncvs/src/sys/netgraph/ng_bridge.c,v retrieving revision 1.15 diff -u -r1.15 ng_bridge.c --- netgraph/ng_bridge.c 8 Nov 2002 21:13:18 -0000 1.15 +++ netgraph/ng_bridge.c 15 Dec 2002 05:18:01 -0000 @@ -713,7 +713,7 @@ * It's usable link but not the reserved (first) one. * Copy mbuf and meta info for sending. */ - m2 = m_dup(m, M_NOWAIT); /* XXX m_copypacket() */ + m2 = m_dup(m, M_DONTWAIT); /* XXX m_copypacket() */ if (m2 == NULL) { link->stats.memoryFailures++; NG_FREE_ITEM(item); Index: netgraph/ng_l2tp.c =================================================================== RCS file: /home/hiten/ncvs/src/sys/netgraph/ng_l2tp.c,v retrieving revision 1.2 diff -u -r1.2 ng_l2tp.c --- netgraph/ng_l2tp.c 22 Aug 2002 00:30:03 -0000 1.2 +++ netgraph/ng_l2tp.c 19 Dec 2002 10:47:22 -0000 @@ -55,6 +55,7 @@ #include #include #include +#include #include #include @@ -295,9 +296,8 @@ #define L2TP_SEQ_CHECK(x) do { } while (0) #endif -/* mem*() macros */ +/* memmove macro */ #define memmove(d, s, l) ovbcopy(s, d, l) -#define memset(d, z, l) bzero(d, l) /* XXX */ /* Whether to use m_copypacket() or m_dup() */ #define L2TP_COPY_MBUF m_copypacket @@ -955,7 +955,7 @@ } /* Copy packet */ - if ((m = L2TP_COPY_MBUF(seq->xwin[i], M_NOWAIT)) == NULL) { + if ((m = L2TP_COPY_MBUF(seq->xwin[i], M_DONTWAIT)) == NULL) { priv->stats.memoryFailures++; return (ENOBUFS); } @@ -1219,7 +1219,7 @@ */ while ((i = L2TP_SEQ_DIFF(seq->ns, seq->rack)) < seq->cwnd && seq->xwin[i] != NULL) { - if ((m = L2TP_COPY_MBUF(seq->xwin[i], M_NOWAIT)) == NULL) + if ((m = L2TP_COPY_MBUF(seq->xwin[i], M_DONTWAIT)) == NULL) priv->stats.memoryFailures++; else ng_l2tp_xmit_ctrl(priv, m, seq->ns); @@ -1361,7 +1361,7 @@ seq->acks = 0; /* Retransmit oldest unack'd packet */ - if ((m = L2TP_COPY_MBUF(seq->xwin[0], M_NOWAIT)) == NULL) + if ((m = L2TP_COPY_MBUF(seq->xwin[0], M_DONTWAIT)) == NULL) priv->stats.memoryFailures++; else ng_l2tp_xmit_ctrl(priv, m, seq->rack); Index: netgraph/ng_one2many.c =================================================================== RCS file: /home/hiten/ncvs/src/sys/netgraph/ng_one2many.c,v retrieving revision 1.10 diff -u -r1.10 ng_one2many.c --- netgraph/ng_one2many.c 8 Nov 2002 21:13:18 -0000 1.10 +++ netgraph/ng_one2many.c 15 Dec 2002 05:18:55 -0000 @@ -427,7 +427,7 @@ struct ng_one2many_link *mdst; mdst = &priv->many[priv->activeMany[i]]; - m2 = m_dup(m, M_NOWAIT); /* XXX m_copypacket() */ + m2 = m_dup(m, M_DONTWAIT); /* XXX m_copypacket() */ if (m2 == NULL) { mdst->stats.memoryFailures++; NG_FREE_ITEM(item); Index: netgraph/ng_ppp.c =================================================================== RCS file: /home/hiten/ncvs/src/sys/netgraph/ng_ppp.c,v retrieving revision 1.41 diff -u -r1.41 ng_ppp.c --- netgraph/ng_ppp.c 8 Nov 2002 21:13:18 -0000 1.41 +++ netgraph/ng_ppp.c 19 Dec 2002 10:47:42 -0000 @@ -1595,7 +1595,7 @@ /* Split off next fragment as "m2" */ m2 = m; if (!lastFragment) { - struct mbuf *n = m_split(m, len, M_NOWAIT); + struct mbuf *n = m_split(m, len, M_DONTWAIT); if (n == NULL) { NG_FREE_M(m); @@ -1916,7 +1916,7 @@ static struct mbuf * ng_ppp_prepend(struct mbuf *m, const void *buf, int len) { - M_PREPEND(m, len, M_NOWAIT); + M_PREPEND(m, len, M_DONTWAIT); if (m == NULL || (m->m_len < len && (m = m_pullup(m, len)) == NULL)) return (NULL); bcopy(buf, mtod(m, u_char *), len); Index: netgraph/ng_pptpgre.c =================================================================== RCS file: /home/hiten/ncvs/src/sys/netgraph/ng_pptpgre.c,v retrieving revision 1.26 diff -u -r1.26 ng_pptpgre.c --- netgraph/ng_pptpgre.c 14 Sep 2002 00:00:49 -0000 1.26 +++ netgraph/ng_pptpgre.c 19 Dec 2002 10:49:32 -0000 @@ -532,7 +532,7 @@ m->m_len = m->m_pkthdr.len = grelen; m->m_pkthdr.rcvif = NULL; } else { - M_PREPEND(m, grelen, M_NOWAIT); + M_PREPEND(m, grelen, M_DONTWAIT); if (m == NULL || (m->m_len < grelen && (m = m_pullup(m, grelen)) == NULL)) { priv->stats.memoryFailures++; Index: netgraph/ng_source.c =================================================================== RCS file: /home/hiten/ncvs/src/sys/netgraph/ng_source.c,v retrieving revision 1.4 diff -u -r1.4 ng_source.c --- netgraph/ng_source.c 5 Nov 2002 01:08:11 -0000 1.4 +++ netgraph/ng_source.c 15 Dec 2002 05:19:39 -0000 @@ -638,7 +638,7 @@ break; /* duplicate the packet */ - m2 = m_copypacket(m, M_NOWAIT); + m2 = m_copypacket(m, M_DONTWAIT); if (m2 == NULL) { s = splnet(); IF_PREPEND(&sc->snd_queue, m); Index: netgraph/ng_tee.c =================================================================== RCS file: /home/hiten/ncvs/src/sys/netgraph/ng_tee.c,v retrieving revision 1.20 diff -u -r1.20 ng_tee.c --- netgraph/ng_tee.c 31 May 2002 23:48:03 -0000 1.20 +++ netgraph/ng_tee.c 15 Dec 2002 05:20:05 -0000 @@ -334,7 +334,7 @@ meta_p meta2; /* Copy packet (failure will not stop the original)*/ - m2 = m_dup(m, M_NOWAIT); + m2 = m_dup(m, M_DONTWAIT); if (m2) { /* Copy meta info */ Index: netgraph/bluetooth/socket/ng_btsocket_hci_raw.c =================================================================== RCS file: /home/hiten/ncvs/src/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c,v retrieving revision 1.1 diff -u -r1.1 ng_btsocket_hci_raw.c --- netgraph/bluetooth/socket/ng_btsocket_hci_raw.c 20 Nov 2002 23:01:57 -0000 1.1 +++ netgraph/bluetooth/socket/ng_btsocket_hci_raw.c 15 Dec 2002 05:39:04 -0000 @@ -1271,7 +1271,7 @@ sa = (struct sockaddr *) &pcb->addr; } - MGET(nam, M_WAITOK, MT_SONAME); + MGET(nam, M_TRYWAIT, MT_SONAME); if (nam == NULL) { error = ENOBUFS; goto drop; Index: netgraph/bluetooth/socket/ng_btsocket_l2cap.c =================================================================== RCS file: /home/hiten/ncvs/src/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c,v retrieving revision 1.1 diff -u -r1.1 ng_btsocket_l2cap.c --- netgraph/bluetooth/socket/ng_btsocket_l2cap.c 20 Nov 2002 23:01:57 -0000 1.1 +++ netgraph/bluetooth/socket/ng_btsocket_l2cap.c 15 Dec 2002 05:17:27 -0000 @@ -1464,7 +1464,7 @@ * it is a broadcast traffic after all */ - copy = m_dup(m, M_NOWAIT); + copy = m_dup(m, M_DONTWAIT); if (copy != NULL) { sbappendrecord(&pcb->so->so_rcv, copy); sorwakeup(pcb->so); @@ -2384,7 +2384,7 @@ if (pcb->so->so_snd.sb_cc == 0) return (EINVAL); /* XXX */ - m = m_dup(pcb->so->so_snd.sb_mb, M_NOWAIT); + m = m_dup(pcb->so->so_snd.sb_mb, M_DONTWAIT); if (m == NULL) return (ENOBUFS); Index: netinet/ip_encap.c =================================================================== RCS file: /home/hiten/ncvs/src/sys/netinet/ip_encap.c,v retrieving revision 1.13 diff -u -r1.13 ip_encap.c --- netinet/ip_encap.c 16 Oct 2002 01:54:44 -0000 1.13 +++ netinet/ip_encap.c 15 Dec 2002 05:20:42 -0000 @@ -487,7 +487,7 @@ { struct m_tag *tag; - tag = m_tag_get(PACKET_TAG_ENCAP, sizeof (void*), M_NOWAIT); + tag = m_tag_get(PACKET_TAG_ENCAP, sizeof (void*), M_DONTWAIT); if (tag) { *(void**)(tag+1) = ep->arg; m_tag_prepend(m, tag); Index: netinet/ip_fw.c =================================================================== RCS file: /home/hiten/ncvs/src/sys/netinet/ip_fw.c,v retrieving revision 1.188 diff -u -r1.188 ip_fw.c --- netinet/ip_fw.c 22 Jun 2002 11:51:02 -0000 1.188 +++ netinet/ip_fw.c 15 Dec 2002 04:47:08 -0000 @@ -882,7 +882,7 @@ } i = hash_packet(id); - r = malloc(sizeof *r, M_IPFW, M_DONTWAIT | M_ZERO); + r = malloc(sizeof *r, M_IPFW, M_NOWAIT | M_ZERO); if (r == NULL) { printf ("sorry cannot allocate state\n"); return NULL ; @@ -1695,7 +1695,7 @@ u_short nbr = 0; int s; - ftmp = malloc(sizeof *ftmp, M_IPFW, M_DONTWAIT | M_ZERO); + ftmp = malloc(sizeof *ftmp, M_IPFW, M_NOWAIT | M_ZERO); if (!ftmp) return (ENOSPC); bcopy(rule, ftmp, sizeof(*ftmp)); Index: netinet6/esp_core.c =================================================================== RCS file: /home/hiten/ncvs/src/sys/netinet6/esp_core.c,v retrieving revision 1.10 diff -u -r1.10 esp_core.c --- netinet6/esp_core.c 5 Mar 2002 21:12:41 -0000 1.10 +++ netinet6/esp_core.c 15 Dec 2002 04:47:32 -0000 @@ -219,7 +219,7 @@ sav->schedlen = (*algo->schedlen)(algo); if (sav->schedlen < 0) return EINVAL; - sav->sched = malloc(sav->schedlen, M_SECA, M_DONTWAIT); + sav->sched = malloc(sav->schedlen, M_SECA, M_NOWAIT); if (!sav->sched) { sav->schedlen = 0; return ENOBUFS; Index: netinet6/ip6_fw.c =================================================================== RCS file: /home/hiten/ncvs/src/sys/netinet6/ip6_fw.c,v retrieving revision 1.19 diff -u -r1.19 ip6_fw.c --- netinet6/ip6_fw.c 25 Aug 2002 03:50:29 -0000 1.19 +++ netinet6/ip6_fw.c 15 Dec 2002 04:48:02 -0000 @@ -845,8 +845,8 @@ u_short nbr = 0; int s; - fwc = malloc(sizeof *fwc, M_IP6FW, M_DONTWAIT); - ftmp = malloc(sizeof *ftmp, M_IP6FW, M_DONTWAIT); + fwc = malloc(sizeof *fwc, M_IP6FW, M_NOWAIT); + ftmp = malloc(sizeof *ftmp, M_IP6FW, M_NOWAIT); if (!fwc || !ftmp) { dprintf(("%s malloc said no\n", err_prefix)); if (fwc) free(fwc, M_IP6FW); Index: netinet6/ip6_input.c =================================================================== RCS file: /home/hiten/ncvs/src/sys/netinet6/ip6_input.c,v retrieving revision 1.40 diff -u -r1.40 ip6_input.c --- netinet6/ip6_input.c 16 Oct 2002 02:25:05 -0000 1.40 +++ netinet6/ip6_input.c 19 Dec 2002 10:55:30 -0000 @@ -1623,7 +1623,7 @@ if (!tag) { tag = m_tag_get(PACKET_TAG_IPV6_INPUT, sizeof (struct ip6aux), - M_NOWAIT); + M_DONTWAIT); if (tag) m_tag_prepend(m, tag); } Index: netinet6/ipcomp_output.c =================================================================== RCS file: /home/hiten/ncvs/src/sys/netinet6/ipcomp_output.c,v retrieving revision 1.3 diff -u -r1.3 ipcomp_output.c --- netinet6/ipcomp_output.c 19 Apr 2002 04:46:23 -0000 1.3 +++ netinet6/ipcomp_output.c 15 Dec 2002 05:21:14 -0000 @@ -171,12 +171,12 @@ * compromise two m_copym(). we will be going through every byte of * the payload during compression process anyways. */ - mcopy = m_copym(m, 0, M_COPYALL, M_NOWAIT); + mcopy = m_copym(m, 0, M_COPYALL, M_DONTWAIT); if (mcopy == NULL) { error = ENOBUFS; return 0; } - md0 = m_copym(md, 0, M_COPYALL, M_NOWAIT); + md0 = m_copym(md, 0, M_COPYALL, M_DONTWAIT); if (md0 == NULL) { m_freem(mcopy); error = ENOBUFS; Index: netipsec/keysock.c =================================================================== RCS file: /home/hiten/ncvs/src/sys/netipsec/keysock.c,v retrieving revision 1.1 diff -u -r1.1 keysock.c --- netipsec/keysock.c 16 Oct 2002 02:10:07 -0000 1.1 +++ netipsec/keysock.c 19 Dec 2002 10:58:39 -0000 @@ -152,7 +152,7 @@ if (promisc) { struct sadb_msg *pmsg; - M_PREPEND(m, sizeof(struct sadb_msg), M_NOWAIT); + M_PREPEND(m, sizeof(struct sadb_msg), M_DONTWAIT); if (m && m->m_len < sizeof(struct sadb_msg)) m = m_pullup(m, sizeof(struct sadb_msg)); if (!m) { Index: netkey/keysock.c =================================================================== RCS file: /home/hiten/ncvs/src/sys/netkey/keysock.c,v retrieving revision 1.16 diff -u -r1.16 keysock.c --- netkey/keysock.c 18 Jun 2002 07:42:02 -0000 1.16 +++ netkey/keysock.c 19 Dec 2002 11:00:07 -0000 @@ -147,7 +147,7 @@ if (promisc) { struct sadb_msg *pmsg; - M_PREPEND(m, sizeof(struct sadb_msg), M_NOWAIT); + M_PREPEND(m, sizeof(struct sadb_msg), M_DONTWAIT); if (m && m->m_len < sizeof(struct sadb_msg)) m = m_pullup(m, sizeof(struct sadb_msg)); if (!m) { Index: netsmb/smb_trantcp.c =================================================================== RCS file: /home/hiten/ncvs/src/sys/netsmb/smb_trantcp.c,v retrieving revision 1.14 diff -u -r1.14 smb_trantcp.c --- netsmb/smb_trantcp.c 26 Nov 2002 23:53:28 -0000 1.14 +++ netsmb/smb_trantcp.c 15 Dec 2002 05:38:26 -0000 @@ -648,7 +648,7 @@ error = ENOTCONN; goto abort; } - M_PREPEND(m0, 4, M_WAITOK); + M_PREPEND(m0, 4, M_TRYWAIT); if (m0 == NULL) return ENOBUFS; nb_sethdr(m0, NB_SSN_MESSAGE, m_fixhdr(m0) - 4); Index: bpf_compat.h =================================================================== RCS file: /home/hiten/ncvs/src/sys/net/bpf_compat.h,v retrieving revision 1.8 diff -u -r1.8 bpf_compat.h --- bpf_compat.h 27 Dec 2000 22:20:13 -0000 1.8 +++ bpf_compat.h 19 Dec 2002 12:46:03 -0000 @@ -40,14 +40,14 @@ /* * Some hacks for compatibility across SunOS and 4.4BSD. We emulate malloc * and free with mbuf clusters. We store a pointer to the mbuf in the first - * word of the mbuf and return 8 bytes passed the start of data (for double + * word of the mbuf and return 8 bytes past the start of data (for double * word alignment). We cannot just use offsets because clusters are not at * a fixed offset from the associated mbuf. Sorry for this kludge. */ -#define malloc(size, type, canwait) bpf_alloc(size, canwait) +#define malloc(size, type, canwait) \ +bpf_alloc(size, (canwait & M_NOWAIT) ? M_DONTWAIT : M_TRYWAIT) + #define free(cp, type) m_free(*(struct mbuf **)(cp - 8)) -#define M_WAITOK M_TRYWAIT -#define M_NOWAIT M_DONTWAIT /* This mapping works for our purposes. */ #define ERESTART EINTR