summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorArchie Cobbs <archie@FreeBSD.org>2002-07-02 20:31:21 +0000
committerArchie Cobbs <archie@FreeBSD.org>2002-07-02 20:31:21 +0000
commitff4843f0676dc126b2ad783c7e2548764ee245c4 (patch)
treeac87fb0ebe4d4d00ea33bf4379bd61976fb2ee10 /sys
parent7c11d6176df1e3b0945cad429f5b3258ae34e816 (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/uipc_mbuf.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c
index 2d98a21b7a68..348c3841fea3 100644
--- a/sys/kern/uipc_mbuf.c
+++ b/sys/kern/uipc_mbuf.c
@@ -1118,6 +1118,11 @@ bad:
* Partition an mbuf chain in two pieces, returning the tail --
* all but the first len0 bytes. In case of failure, it returns NULL and
* attempts to restore the chain to its original state.
+ *
+ * Note that the resulting mbufs might be read-only, because the new
+ * mbuf can end up sharing an mbuf cluster with the original mbuf if
+ * the "breaking point" happens to lie within a cluster mbuf. Use the
+ * M_WRITABLE() macro to check for this case.
*/
struct mbuf *
m_split(m0, len0, wait)
@@ -1173,7 +1178,6 @@ extpacket:
else
(*(m->m_ext.ext_ref))(m->m_ext.ext_buf,
m->m_ext.ext_size);
- m->m_ext.ext_size = 0; /* For Accounting XXXXXX danger */
n->m_data = m->m_data + len;
} else {
bcopy(mtod(m, caddr_t) + len, mtod(n, caddr_t), remain);