When using m_dup(9) to copy more than MHLEN bytes of data, don't create an

mbuf chain that starts with a cluster containing just MHLEN bytes.  This
happened because m_dup called m_get or m_getcl depending on the amount of
data to copy, but then always set the size available in the first mbuf to
MHLEN.

Submitted by:	Matt Koivisto <mkoivisto at sandvine dot com>
Approved by:	jmg
Silence from:	rwatson (mentor)
This commit is contained in:
Ed Maste 2005-12-14 23:34:26 +00:00
parent e59898ff36
commit 63e6f39011

View File

@ -849,7 +849,8 @@ m_dup(struct mbuf *m, int how)
m_free(n); m_free(n);
goto nospace; goto nospace;
} }
nsize = MHLEN; if ((n->m_flags & M_EXT) == 0)
nsize = MHLEN;
} }
n->m_len = 0; n->m_len = 0;