From owner-freebsd-net@FreeBSD.ORG Thu May 1 04:12:13 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CCE5837B401 for ; Thu, 1 May 2003 04:12:12 -0700 (PDT) Received: from xorpc.icir.org (xorpc.icir.org [192.150.187.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8C6B643FB1 for ; Thu, 1 May 2003 04:12:11 -0700 (PDT) (envelope-from rizzo@xorpc.icir.org) Received: from xorpc.icir.org (localhost [127.0.0.1]) by xorpc.icir.org (8.12.8p1/8.12.3) with ESMTP id h41BCBBp003861; Thu, 1 May 2003 04:12:11 -0700 (PDT) (envelope-from rizzo@xorpc.icir.org) Received: (from rizzo@localhost) by xorpc.icir.org (8.12.8p1/8.12.3/Submit) id h41BCAFS003860; Thu, 1 May 2003 04:12:10 -0700 (PDT) (envelope-from rizzo) Date: Thu, 1 May 2003 04:12:10 -0700 From: Luigi Rizzo To: Mike Silbersack Message-ID: <20030501041210.A3514@xorpc.icir.org> References: <20030430142532.F3741@odysseus.silby.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20030430142532.F3741@odysseus.silby.com>; from silby@silby.com on Wed, Apr 30, 2003 at 02:35:23PM -0500 cc: freebsd-net@freebsd.org Subject: Re: Review needed: Mbuf double-free detection patch X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 May 2003 11:12:13 -0000 as Bosko noticed, it would be a good idea to make the change to subr_mbuf.c conditionally compiled under DIAGNOSTIC or INVARIANTS or the like. I was actually wondering if you have caught already any bug with this code enabled. [on a side note, it is a bit depressing to see the same code replicated twice, in m_free() and m_freem(). Couldn't one try to make m_freem() just call m_free() in a loop and save some code bloat ? I doubt the extra function call would harm performance too much.] cheers luigi On Wed, Apr 30, 2003 at 02:35:23PM -0500, Mike Silbersack wrote: > > I'd be interested in comments on the attached patch from anyone who's been > doing work with network drivers & such. All it does is add a M_FREELIST ...