summaryrefslogtreecommitdiffstats
path: root/sys/pci
diff options
context:
space:
mode:
authorsilby <silby@FreeBSD.org>2003-03-30 03:45:28 +0000
committersilby <silby@FreeBSD.org>2003-03-30 03:45:28 +0000
commit908d9c5926617c525df18bdb896afe1586844456 (patch)
treec867e344b1f15a154c6ab540c8021b6f015d0f80 /sys/pci
parent83e8b193614feba42e1d85e9ee5f58f201f71cb6 (diff)
downloadFreeBSD-src-908d9c5926617c525df18bdb896afe1586844456.zip
FreeBSD-src-908d9c5926617c525df18bdb896afe1586844456.tar.gz
Switch rl_encap over to using m_defrag.
No functional change, the previous rl_encap was correct wrt long mbuf chains; this just reduces code duplication. MFC after: 2 weeks
Diffstat (limited to 'sys/pci')
-rw-r--r--sys/pci/if_rl.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/sys/pci/if_rl.c b/sys/pci/if_rl.c
index 58e998e..75ad6f1 100644
--- a/sys/pci/if_rl.c
+++ b/sys/pci/if_rl.c
@@ -1504,20 +1504,10 @@ rl_encap(sc, m_head)
* TX buffers, plus we can only have one fragment buffer
* per packet. We have to copy pretty much all the time.
*/
+ m_new = m_defrag(m_head, M_DONTWAIT);
- MGETHDR(m_new, M_DONTWAIT, MT_DATA);
if (m_new == NULL)
return(1);
- if (m_head->m_pkthdr.len > MHLEN) {
- MCLGET(m_new, M_DONTWAIT);
- if (!(m_new->m_flags & M_EXT)) {
- m_freem(m_new);
- return(1);
- }
- }
- m_copydata(m_head, 0, m_head->m_pkthdr.len, mtod(m_new, caddr_t));
- m_new->m_pkthdr.len = m_new->m_len = m_head->m_pkthdr.len;
- m_freem(m_head);
m_head = m_new;
/* Pad frames to at least 60 bytes. */
OpenPOWER on IntegriCloud