Date: Wed, 14 Dec 2005 13:07:48 -0500 From: Ed Maste <emaste@phaedrus.sandvine.ca> To: freebsd-net@freebsd.org Subject: m_dup oddity -- creates mbuf chains with cluster containing 208 bytes of data Message-ID: <20051214180748.GC629@sandvine.com>
next in thread | raw e-mail | index | archive | help
A colleague discovered an oddity with m_dup(9), in that duping an mbuf with 209 or more bytes of data creates a chain with 208 bytes of data in a cluster attached to the first mbuf, with the rest of the data chained on the end. It seemed this behaviour appeared in v 1.130 of uipc_mbuf.c. The patch below restores the behaviour of putting MCLBYTES into the initial mbuf cluster. Comments? Index: uipc_mbuf.c =================================================================== RCS file: /usr/cvs/src/sys/kern/uipc_mbuf.c,v retrieving revision 1.159 diff -u -u -3 -r1.159 uipc_mbuf.c --- uipc_mbuf.c 8 Dec 2005 13:13:05 -0000 1.159 +++ uipc_mbuf.c 14 Dec 2005 15:54:06 -0000 @@ -849,7 +849,8 @@ m_free(n); goto nospace; } - nsize = MHLEN; + if ((n->m_flags & M_EXT) == 0) + nsize = MHLEN; } n->m_len = 0; -- Ed Maste, Sandvine Incorporated
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051214180748.GC629>