SCCS-vsn: sys/kern/uipc_mbuf.c 7.8
* software without specific prior written permission. This software
* is provided ``as is'' without express or implied warranty.
*
* software without specific prior written permission. This software
* is provided ``as is'' without express or implied warranty.
*
- * @(#)uipc_mbuf.c 7.7 (Berkeley) %G%
+ * @(#)uipc_mbuf.c 7.8 (Berkeley) %G%
*/
#include "../machine/pte.h"
*/
#include "../machine/pte.h"
mbstat.m_wait++;
m_want++;
sleep((caddr_t)&mfree, PZERO - 1);
mbstat.m_wait++;
m_want++;
sleep((caddr_t)&mfree, PZERO - 1);
} else {
mbstat.m_drops++;
return (NULL);
} else {
mbstat.m_drops++;
return (NULL);
* Copy data from an mbuf chain starting "off" bytes from the beginning,
* continuing for "len" bytes, into the indicated buffer.
*/
* Copy data from an mbuf chain starting "off" bytes from the beginning,
* continuing for "len" bytes, into the indicated buffer.
*/
m_copydata(m, off, len, cp)
register struct mbuf *m;
m_copydata(m, off, len, cp)
register struct mbuf *m;
{
register unsigned count;
{
register unsigned count;
while (len > 0) {
if (m == 0)
panic("m_copydata");
while (len > 0) {
if (m == 0)
panic("m_copydata");
- count = MIN(m->m_len, len);
+ count = MIN(m->m_len - off, len);
bcopy(mtod(m, caddr_t) + off, cp, count);
len -= count;
bcopy(mtod(m, caddr_t) + off, cp, count);
len -= count;
off = 0;
m = m->m_next;
}
off = 0;
m = m->m_next;
}