From owner-freebsd-net@FreeBSD.ORG Tue Feb 26 11:51:36 2008 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62115106571C for ; Tue, 26 Feb 2008 11:51:36 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id C4F1514227F for ; Tue, 26 Feb 2008 10:41:01 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from kobe.laptop (vader.bytemobile-rio.ondsl.gr [83.235.57.37]) (authenticated bits=0) by igloo.linux.gr (8.14.1/8.14.1/Debian-9) with ESMTP id m1QAdxmi008650; Tue, 26 Feb 2008 12:40:07 +0200 Received: by kobe.laptop (Postfix, from userid 1000) id 3CB9522802; Tue, 26 Feb 2008 12:39:54 +0200 (EET) Date: Tue, 26 Feb 2008 12:39:53 +0200 From: Giorgos Keramidas To: ithilgore Message-ID: <20080226103953.GA2399@kobe.laptop> References: <47BFF17B.5080205@gmail.com> <47BFF74E.4010608@gmail.com> <20080226040438.GA2676@kobe.laptop> <47C46DCF.6050202@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <47C46DCF.6050202@gmail.com> X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-3.968, required 5, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.43, BAYES_00 -2.60) X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Spam-Status: No Cc: freebsd-net@freebsd.org Subject: Re: question about change in inet_ntoa.c X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 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, 26 Feb 2008 11:51:37 -0000 On 2008-02-26 11:51, ithilgore wrote: > Giorgos Keramidas wrote: >> I don't see ucp[] in RELENG_6, RELENG_7 or CURRENT. Where did you get >> the version shown as `7.0-RC1' above? > > I got the source code from the ftp.freebsd.org and I just downloaded > 7.0-RC3 to be certain. > Both in 7.0-RC1 and in 7.0-RC3 in src/sys/libkern/ is the following code of > inet_ntoa.c : > > #include > __FBSDID("$FreeBSD: src/sys/libkern/inet_ntoa.c,v 1.6 2005/01/07 00:24:32 > imp Exp $"); That's libkern. It's part of the kernel code, and it cannot depend on the same basic assumptions as /usr/src/lib/libc code. The kernel version of sprintf() is implemented in sys/kern/subr_prf.c. > .....followed by the reentrant version of inet_ntoa : inet_ntoa_r > > > On the other hand, in version 4.11 RELEASE in > /usr/src/lib/libc/net/inet_ntoa.c & > inet_ntop.c (actually it is inet_ntop.c code but with the same > functionality) which is > called by inet_ntoa there is : This, on the other hand, is userlevel code. There is a userlevel implementation of the printf() family of functions in libc. The two versions do not necessarily work in an 100% compatible manner, so it's probably a slightly bad idea to 'fix' kernel code to use the libc/userlevel style of sprintf("%u....").