svn commit: r187409 - head/sys/kern

Alexander Motin mav at FreeBSD.org
Sun Jan 18 12:19:56 PST 2009


Author: mav
Date: Sun Jan 18 20:19:55 2009
New Revision: 187409
URL: http://svn.freebsd.org/changeset/base/187409

Log:
  Teach m_copyback() to use trailing space of the last mbuf in chain.

Modified:
  head/sys/kern/uipc_mbuf.c

Modified: head/sys/kern/uipc_mbuf.c
==============================================================================
--- head/sys/kern/uipc_mbuf.c	Sun Jan 18 19:56:13 2009	(r187408)
+++ head/sys/kern/uipc_mbuf.c	Sun Jan 18 20:19:55 2009	(r187409)
@@ -1271,6 +1271,10 @@ m_copyback(struct mbuf *m0, int off, int
 		m = m->m_next;
 	}
 	while (len > 0) {
+		if (m->m_next == NULL && (len > m->m_len - off)) {
+			m->m_len += min(len - (m->m_len - off),
+			    M_TRAILINGSPACE(m));
+		}
 		mlen = min (m->m_len - off, len);
 		bcopy(cp, off + mtod(m, caddr_t), (u_int)mlen);
 		cp += mlen;


More information about the svn-src-all mailing list