Date: Wed, 14 Dec 2005 10:44:51 -0800 From: John-Mark Gurney <gurney_j@resnet.uoregon.edu> To: Ed Maste <emaste@phaedrus.sandvine.ca> Cc: freebsd-net@freebsd.org Subject: Re: m_dup oddity -- creates mbuf chains with cluster containing 208 bytes of data Message-ID: <20051214184451.GE55657@funkthat.com> In-Reply-To: <20051214180748.GC629@sandvine.com> References: <20051214180748.GC629@sandvine.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Ed Maste wrote this message on Wed, Dec 14, 2005 at 13:07 -0500: > 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? Looks correct to me... I assume you've tested this? If so, I'll commit it.. > 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; -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051214184451.GE55657>