Index: uipc_mbuf.c =================================================================== RCS file: /cvs/src/sys/kern/uipc_mbuf.c,v retrieving revision 1.218 diff -u -p -r1.218 uipc_mbuf.c --- uipc_mbuf.c 31 Jan 2016 00:18:07 -0000 1.218 +++ uipc_mbuf.c 11 Feb 2016 12:20:07 -0000 @@ -539,6 +539,7 @@ m_copym0(struct mbuf *m0, int off, int l struct mbuf *m, *n, **np; struct mbuf *top; int copyhdr = 0; + unsigned long align; if (off < 0 || len < 0) panic("m_copym0: off %d, len %d", off, len); @@ -581,12 +582,24 @@ m_copym0(struct mbuf *m0, int off, int l n->m_len = M_TRAILINGSPACE(n); n->m_len = min(n->m_len, len); n->m_len = min(n->m_len, m->m_len - off); + + /* duplicate the alignment of the payload */ + align = m->m_data - m->m_ext.ext_buf; + align += off; + n->m_data += align & ALIGNBYTES; + memcpy(mtod(n, caddr_t), mtod(m, caddr_t) + off, n->m_len); } - } else + } else { + /* duplicate data layout */ + n->m_data += m->m_data - + (m->m_flags & M_PKTHDR ? m->m_pktdat : m->m_dat); + n->m_data += off; + memcpy(mtod(n, caddr_t), mtod(m, caddr_t) + off, n->m_len); + } if (len != M_COPYALL) len -= n->m_len; off += n->m_len;