In m_devget(), if the data fits in a packet header mbuf, check the amount

of data is less than or equal to MHLEN instead of MLEN when placing initial
small packet header at end of mbuf.

Reviewed by:	glebius
MFC after:	3 days
This commit is contained in:
Kevin Lo 2016-09-08 01:02:53 +00:00
parent ef13681631
commit cee4a05669
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=305575

View File

@ -984,7 +984,7 @@ m_devget(char *buf, int totlen, int off, struct ifnet *ifp,
len = MHLEN;
/* Place initial small packet/header at end of mbuf */
if (m && totlen + off + max_linkhdr <= MLEN) {
if (m && totlen + off + max_linkhdr <= MHLEN) {
m->m_data += max_linkhdr;
len -= max_linkhdr;
}