From cee4a056691e41b8143412681fa4b2c4f357a63d Mon Sep 17 00:00:00 2001 From: Kevin Lo Date: Thu, 8 Sep 2016 01:02:53 +0000 Subject: [PATCH] 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 --- sys/kern/uipc_mbuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index 84354f3454b..8c5ee7818e6 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -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; }