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:
parent
e59898ff36
commit
63e6f39011
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=153428
@ -849,7 +849,8 @@ m_dup(struct mbuf *m, int how)
|
||||
m_free(n);
|
||||
goto nospace;
|
||||
}
|
||||
nsize = MHLEN;
|
||||
if ((n->m_flags & M_EXT) == 0)
|
||||
nsize = MHLEN;
|
||||
}
|
||||
n->m_len = 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user