summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorbmilekic <bmilekic@FreeBSD.org>2000-12-27 22:20:13 +0000
committerbmilekic <bmilekic@FreeBSD.org>2000-12-27 22:20:13 +0000
commit552eacf1e75b9bd910d2ee0ae1bbccb4b8c32d51 (patch)
tree69fb9a4ed982b172770156d081a71e4b9208ad9b /sys
parent4f2b9100c7d4b02ecc989d71e43d146228489b50 (diff)
downloadFreeBSD-src-552eacf1e75b9bd910d2ee0ae1bbccb4b8c32d51.zip
FreeBSD-src-552eacf1e75b9bd910d2ee0ae1bbccb4b8c32d51.tar.gz
Small fix for bpf compat:
Make malloc() use M_NOWAIT istead of M_DONTWAIT and in the bpf_compat case, define M_NOWAIT to be M_DONTWAIT.
Diffstat (limited to 'sys')
-rw-r--r--sys/net/bpf.c2
-rw-r--r--sys/net/bpf_compat.h1
2 files changed, 2 insertions, 1 deletions
diff --git a/sys/net/bpf.c b/sys/net/bpf.c
index 21eeff3..6487a82 100644
--- a/sys/net/bpf.c
+++ b/sys/net/bpf.c
@@ -1289,7 +1289,7 @@ bpfattach(ifp, dlt, hdrlen)
u_int dlt, hdrlen;
{
struct bpf_if *bp;
- bp = (struct bpf_if *)malloc(sizeof(*bp), M_BPF, M_DONTWAIT);
+ bp = (struct bpf_if *)malloc(sizeof(*bp), M_BPF, M_NOWAIT);
if (bp == 0)
panic("bpfattach");
diff --git a/sys/net/bpf_compat.h b/sys/net/bpf_compat.h
index 8ccaa23..cac9aff 100644
--- a/sys/net/bpf_compat.h
+++ b/sys/net/bpf_compat.h
@@ -47,6 +47,7 @@
#define malloc(size, type, canwait) bpf_alloc(size, canwait)
#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
OpenPOWER on IntegriCloud