summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/kern/uipc_mbuf.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c
index 5535225f60f..82e9367fdb8 100644
--- a/sys/kern/uipc_mbuf.c
+++ b/sys/kern/uipc_mbuf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_mbuf.c,v 1.254 2018/03/12 23:38:42 dlg Exp $ */
+/* $OpenBSD: uipc_mbuf.c,v 1.255 2018/03/13 01:34:06 dlg Exp $ */
/* $NetBSD: uipc_mbuf.c,v 1.15.4.1 1996/06/13 17:11:44 cgd Exp $ */
/*
@@ -888,7 +888,11 @@ m_pullup(struct mbuf *n, int len)
if (len <= n->m_len)
return (n);
- adj = (unsigned long)n->m_data & ALIGNBYTES;
+ m = n;
+ while (m->m_len == 0)
+ m = m->m_next;
+ adj = (unsigned long)m->m_data & ALIGNBYTES;
+
head = (caddr_t)ALIGN(mtod(n, caddr_t) - M_LEADINGSPACE(n)) + adj;
tail = mtod(n, caddr_t) + n->m_len + M_TRAILINGSPACE(n);