diff options
author | 2013-06-11 13:29:50 +0000 | |
---|---|---|
committer | 2013-06-11 13:29:50 +0000 | |
commit | 362b77103aa1a85ef3c35c3263d99e9400150668 (patch) | |
tree | eea5381de11ca653f84114020632ff1d5d73dded | |
parent | convert some easy bcopy to memcpy and clean up fdexpand a bit. (diff) | |
download | wireguard-openbsd-362b77103aa1a85ef3c35c3263d99e9400150668.tar.xz wireguard-openbsd-362b77103aa1a85ef3c35c3263d99e9400150668.zip |
replace bcopy with memcpy in m_defrag. this is safe because the
memory we're copying between is guaranteed to be non-overlapping
since the target is newly allocated.
ok kettenis@ henning@ tedu@
-rw-r--r-- | sys/kern/uipc_mbuf.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index 1f367ef2348..8971553b4b1 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_mbuf.c,v 1.172 2013/06/11 01:01:15 dlg Exp $ */ +/* $OpenBSD: uipc_mbuf.c,v 1.173 2013/06/11 13:29:50 dlg Exp $ */ /* $NetBSD: uipc_mbuf.c,v 1.15.4.1 1996/06/13 17:11:44 cgd Exp $ */ /* @@ -583,13 +583,13 @@ m_defrag(struct mbuf *m, int how) * original mbuf chain. */ if (m0->m_flags & M_EXT) { - bcopy(&m0->m_ext, &m->m_ext, sizeof(struct mbuf_ext)); + memcpy(&m->m_ext, &m0->m_ext, sizeof(struct mbuf_ext)); MCLINITREFERENCE(m); m->m_flags |= M_EXT|M_CLUSTER; m->m_data = m->m_ext.ext_buf; } else { m->m_data = m->m_pktdat; - bcopy(m0->m_data, m->m_data, m0->m_len); + memcpy(m->m_data, m0->m_data, m0->m_len); } m->m_pkthdr.len = m->m_len = m0->m_len; m->m_pkthdr.pf.hdr = NULL; /* altq will cope */ |