summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
authorDamien Bergamini <damien@cvs.openbsd.org>2005-11-23 21:29:06 +0000
committerDamien Bergamini <damien@cvs.openbsd.org>2005-11-23 21:29:06 +0000
commit8455b9165f2fdb3ec2a674ff9e974ea8a9fe6629 (patch)
treedd8c8ef7ce439e23a329b797488d0de015236e77 /sys/dev/ic
parente2580f5bbb96b22ee8b0ee7ac9823b901bf374bd (diff)
When defragmenting a mbuf chain before transmitting it, don't allocate a mbuf
cluster if the payload fits in the header. From NetBSD (scw@)
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/ral.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/dev/ic/ral.c b/sys/dev/ic/ral.c
index 904a1603d11..8f14d79214a 100644
--- a/sys/dev/ic/ral.c
+++ b/sys/dev/ic/ral.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ral.c,v 1.64 2005/11/23 20:51:20 damien Exp $ */
+/* $OpenBSD: ral.c,v 1.65 2005/11/23 21:29:01 damien Exp $ */
/*-
* Copyright (c) 2005
@@ -1918,11 +1918,13 @@ ral_tx_data(struct ral_softc *sc, struct mbuf *m0, struct ieee80211_node *ni)
}
M_DUP_PKTHDR(mnew, m0);
- MCLGET(mnew, M_DONTWAIT);
- if (!(mnew->m_flags & M_EXT)) {
- m_freem(m0);
- m_freem(mnew);
- return ENOMEM;
+ if (m0->m_pkthdr.len > MHLEN) {
+ MCLGET(mnew, M_DONTWAIT);
+ if (!(mnew->m_flags & M_EXT)) {
+ m_freem(m0);
+ m_freem(mnew);
+ return ENOMEM;
+ }
}
m_copydata(m0, 0, m0->m_pkthdr.len, mtod(mnew, caddr_t));