From d02badc7e2bc65c3c1dd94d640c973ae1e0ab3e2 Mon Sep 17 00:00:00 2001 From: ru Date: Tue, 30 Mar 2004 19:23:38 +0000 Subject: Switch ste_encap() over to using m_defrag(). No functional change, the previous ste_encap() was correct WRT long mbuf chains; this just reduces code duplication. MFC after: 3 days Prodded by: ambrisko --- sys/pci/if_ste.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'sys/pci') diff --git a/sys/pci/if_ste.c b/sys/pci/if_ste.c index 6dbf222..8982f4e 100644 --- a/sys/pci/if_ste.c +++ b/sys/pci/if_ste.c @@ -1493,25 +1493,13 @@ encap_retry: /* * We ran out of segments. We have to recopy this * mbuf chain first. Bail out if we can't get the - * new buffers. Code borrowed from if_fxp.c + * new buffers. */ - MGETHDR(mn, M_DONTWAIT, MT_DATA); + mn = m_defrag(m_head, M_DONTWAIT); if (mn == NULL) { m_freem(m_head); return ENOMEM; } - if (m_head->m_pkthdr.len > MHLEN) { - MCLGET(mn, M_DONTWAIT); - if ((mn->m_flags & M_EXT) == 0) { - m_freem(mn); - m_freem(m_head); - return ENOMEM; - } - } - m_copydata(m_head, 0, m_head->m_pkthdr.len, - mtod(mn, caddr_t)); - mn->m_pkthdr.len = mn->m_len = m_head->m_pkthdr.len; - m_freem(m_head); m_head = mn; goto encap_retry; } -- cgit v1.1