diff options
Diffstat (limited to 'sys/kern/uipc_mbuf.c')
-rw-r--r-- | sys/kern/uipc_mbuf.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index f5ba9ab..ce00553 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -1333,7 +1333,7 @@ nospace: #endif struct mbuf * -m_uiotombuf(struct uio *uio, int how, int len) +m_uiotombuf(struct uio *uio, int how, int len, int align) { struct mbuf *m_new = NULL, *m_final = NULL; int progress = 0, error = 0, length, total; @@ -1342,12 +1342,15 @@ m_uiotombuf(struct uio *uio, int how, int len) total = min(uio->uio_resid, len); else total = uio->uio_resid; - if (total > MHLEN) + if (align >= MHLEN) + goto nospace; + if (total + align > MHLEN) m_final = m_getcl(how, MT_DATA, M_PKTHDR); else m_final = m_gethdr(how, MT_DATA); if (m_final == NULL) goto nospace; + m_final->m_data += align; m_new = m_final; while (progress < total) { length = total - progress; |