From owner-freebsd-net@FreeBSD.ORG Tue Sep 21 22:37:18 2004 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 D576916A4CE; Tue, 21 Sep 2004 22:37:18 +0000 (GMT) Received: from shuttle.wide.toshiba.co.jp (shuttle.wide.toshiba.co.jp [202.249.10.124]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7462C43D41; Tue, 21 Sep 2004 22:37:18 +0000 (GMT) (envelope-from jinmei@isl.rdc.toshiba.co.jp) Received: from ocean.jinmei.org (unknown [2001:4f8:3:bb:edfb:ed25:1690:7523]) by shuttle.wide.toshiba.co.jp (Postfix) with ESMTP id A3DE61525D; Wed, 22 Sep 2004 07:37:15 +0900 (JST) Date: Wed, 22 Sep 2004 07:37:20 +0900 Message-ID: From: JINMEI Tatuya / =?ISO-2022-JP?B?GyRCP0BMQEMjOkgbKEI=?= To: Thomas Quinot In-Reply-To: <20040921213233.GA84392@melusine.cuivre.fr.eu.org> References: <20040921123016.GA41677@melusine.cuivre.fr.eu.org> <20040921190717.GG84228@lucky.net> <20040921213233.GA84392@melusine.cuivre.fr.eu.org> User-Agent: Wanderlust/2.10.1 (Watching The Wheels) Emacs/21.3 Mule/5.0 (SAKAKI) Organization: Research & Development Center, Toshiba Corp., Kawasaki, Japan. MIME-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: text/plain; charset=US-ASCII cc: netch@lucky.net cc: freebsd-net@freebsd.org cc: Hajimu UMEMOTO cc: Thomas Quinot Subject: Re: freeaddrinfo(NULL) 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: Tue, 21 Sep 2004 22:37:19 -0000 >>>>> On Tue, 21 Sep 2004 23:32:33 +0200, >>>>> Thomas Quinot said: [...snip] It seems that all these points simply show this is a controversial issue. I was not convinced with the argument for the no-op approach, and still believe segfaulting is better. But at the same time I seem to have failed to convince others who believe in no-op. So I won't make further comments on those. (If you feel this is unfair, please raise the points again.) One last comment about consistency: >> This statement is too short to tell if it's valid, but I believe >> Segfaulting on freeaddrinfo(NULL) can make something safer for the >> reason I described above. That is, catching a bug earlier *can* >> make a safer result. > In some conditions. But we have to take into account the fact that other > systems do behave differently with a NULL pointer in freeaddrinfo (yes, > I am specicly thinking of Linux and Windows), and we may also want to > take *that* into account and find out how we can offer a consistent > interface to programmers. I also believe that it would be friendlier to > programmers to offer a behaviour more similar to free(3). Note also that other *BSDs and Solaris use the "segfault" logic. The freeaddrinfo implementation in the "libbind" library as a part of the ISC BIND package, which many UNIX-like OS vendors adopt (perhaps with vendor-specific modifications though), also segfaults against a NULL argument. So, although consistency might in general be a good thing, the real world's examples show we just have variations. JINMEI, Tatuya Communication Platform Lab. Corporate R&D Center, Toshiba Corp. jinmei@isl.rdc.toshiba.co.jp