From owner-freebsd-current@FreeBSD.ORG Sat Sep 18 12:55:35 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8F50C16A4CE; Sat, 18 Sep 2004 12:55:35 +0000 (GMT) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3C41E43D1F; Sat, 18 Sep 2004 12:55:35 +0000 (GMT) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.13.1/8.13.1) with ESMTP id i8ICt2jT088257; Sat, 18 Sep 2004 08:55:02 -0400 (EDT) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)i8ICt2dJ088254; Sat, 18 Sep 2004 08:55:02 -0400 (EDT) (envelope-from robert@fledge.watson.org) Date: Sat, 18 Sep 2004 08:55:01 -0400 (EDT) From: Robert Watson X-Sender: robert@fledge.watson.org To: Brooks Davis In-Reply-To: <20040918051758.GA18656@odin.ac.hmc.edu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE cc: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= cc: re@FreeBSD.org cc: current@FreeBSD.org Subject: Re: 5.3-RELEASE TODO X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Sep 2004 12:55:35 -0000 On Fri, 17 Sep 2004, Brooks Davis wrote: > On Fri, Sep 17, 2004 at 09:30:19PM +0200, Dag-Erling Sm=F8rgrav wrote: > > Brooks Davis writes: > > > Thus, so you have to know how much space you wil= l > > > need before doing any kind of allocation, hence the double loop and t= he > > > potential race. > >=20 > > Using sbufs removes the need for loop and greatly simplifies how you > > deal with overflows. >=20 > Indeed it does. I'm not fully happy with the hardcoding of a maximum > size, but I doubt anyone will hit it in practice. Here's a new and > improved patch that makes a single pass and uses sbufs.=20 Have you tried seeing just how many addresses you can add before getifaddrs() fails to return the complete list? 128k seems like a lot, but I instrumente ifconf() locally a couple of weeks ago when I first became aware of this problem, and discovered that even on my notebook (which has a wireless card with one IP, and an unused ethernet card) that I see moderately large buffers being read from user space: ifconf: 16384 space ifconf: 2048 space ifconf: 2048 space ifconf: 4095 space This is from a printf of ifc->ifc_len before the loop begins. Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Principal Research Scientist, McAfee Research