From owner-freebsd-net Mon Dec 11 11:56:39 2000 From owner-freebsd-net@FreeBSD.ORG Mon Dec 11 11:56:37 2000 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from falla.videotron.net (falla.videotron.net [205.151.222.106]) by hub.freebsd.org (Postfix) with ESMTP id 52A0E37B400 for ; Mon, 11 Dec 2000 11:56:37 -0800 (PST) Received: from modemcable213.3-201-24.mtl.mc.videotron.ca ([24.201.3.213]) by falla.videotron.net (Sun Internet Mail Server sims.3.5.1999.12.14.10.29.p8) with ESMTP id <0G5F0069X62B99@falla.videotron.net> for net@FreeBSD.ORG; Mon, 11 Dec 2000 14:56:35 -0500 (EST) Date: Mon, 11 Dec 2000 14:57:43 -0500 (EST) From: Bosko Milekic Subject: Re: Abusing m_ext for a worthy goal. In-reply-to: To: Alfred Perlstein Cc: net@FreeBSD.ORG Message-id: MIME-version: 1.0 Content-type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Something I forgot in first Email... On Mon, 11 Dec 2000, Bosko Milekic wrote: [...] > Actually, your free routine needs to accept the address of the > cluster as a first argument, and the optional argument as a second > argument. According to your MEXTADD() above, your optional argument will > be something called "cm." In your case, what you need to make your > optional argument be is the actual mbuf "control" (you can cast it to > struct mbuf *). Then, you can call unp_scan() on that mbuf (second > argument) and call _MCLFREE() on the first argument, which will > effectively be the address of the cluster. Don't forget to also, after running _MCLFREE() on the ext_buf, to NULL out the control mbuf's ext_buf, and to remove the M_EXT bit from the mbuf if you are planning to re-use it. Basically, make sure to clean up after yourself after you forcibly free the cluster "manually." [...] Later, Bosko Milekic bmilekic@technokratis.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message