diff options
author | ru <ru@FreeBSD.org> | 2008-03-25 09:39:02 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2008-03-25 09:39:02 +0000 |
commit | 3b1bf8c2e9222b7d27e8b9084e637a84005de7ba (patch) | |
tree | cf0376c9359f2d1ca6e4e8e4ad4a4f722dba61a7 /sys/net/bpf.c | |
parent | 0655a583e2ccba8b534e710284a730a0d6af1375 (diff) | |
download | FreeBSD-src-3b1bf8c2e9222b7d27e8b9084e637a84005de7ba.zip FreeBSD-src-3b1bf8c2e9222b7d27e8b9084e637a84005de7ba.tar.gz |
Replaced the misleading uses of a historical artefact M_TRYWAIT with M_WAIT.
Removed dead code that assumed that M_TRYWAIT can return NULL; it's not true
since the advent of MBUMA.
Reviewed by: arch
There are ongoing disputes as to whether we want to switch to directly using
UMA flags M_WAITOK/M_NOWAIT for mbuf(9) allocation.
Diffstat (limited to 'sys/net/bpf.c')
-rw-r--r-- | sys/net/bpf.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/sys/net/bpf.c b/sys/net/bpf.c index eef3241..7de49049 100644 --- a/sys/net/bpf.c +++ b/sys/net/bpf.c @@ -386,13 +386,10 @@ bpf_movein(struct uio *uio, int linktype, struct ifnet *ifp, struct mbuf **mp, if ((unsigned)len > MCLBYTES) return (EIO); - if (len > MHLEN) { - m = m_getcl(M_TRYWAIT, MT_DATA, M_PKTHDR); - } else { - MGETHDR(m, M_TRYWAIT, MT_DATA); - } - if (m == NULL) - return (ENOBUFS); + if (len > MHLEN) + m = m_getcl(M_WAIT, MT_DATA, M_PKTHDR); + else + MGETHDR(m, M_WAIT, MT_DATA); m->m_pkthdr.len = m->m_len = len; m->m_pkthdr.rcvif = NULL; *mp = m; |