From owner-freebsd-net@FreeBSD.ORG Thu Nov 2 10:28:10 2006 Return-Path: X-Original-To: freebsd-net@freebsd.org 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 1777B16A407 for ; Thu, 2 Nov 2006 10:28:10 +0000 (UTC) (envelope-from vanhu@zeninc.net) Received: from smtp.zeninc.net (reverse-25.fdn.fr [80.67.176.25]) by mx1.FreeBSD.org (Postfix) with ESMTP id B136C43D49 for ; Thu, 2 Nov 2006 10:28:08 +0000 (GMT) (envelope-from vanhu@zeninc.net) Received: by smtp.zeninc.net (smtpd, from userid 1000) id 42E133F17; Thu, 2 Nov 2006 11:28:07 +0100 (CET) Date: Thu, 2 Nov 2006 11:28:07 +0100 From: VANHULLEBUS Yvan To: freebsd-net@freebsd.org Message-ID: <20061102102807.GA23553@zen.inc> References: <200611021045.09774.max@love2party.net> <4549C63F.20308@delphij.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4549C63F.20308@delphij.net> User-Agent: All mail clients suck. This one just sucks less. Subject: Re: Reentrant problem with inet_ntoa in the kernel 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: Thu, 02 Nov 2006 10:28:10 -0000 On Thu, Nov 02, 2006 at 06:19:43PM +0800, LI Xin wrote: [.....] > Sounds like a workaround to me and in theory that is insufficient for a > MPSAFE protection. Here is a patch which reduces the chance where we > get a race. Hi. This patch will allow multiple calls to inet_ntoa int the same function (like printf(....., inet_ntoa(a), inet_ntoa(b))), but won't really solve the race condition if inet_ntoa is called from 2 differents functions at the same time: at least the round should be locked to reduce potential problems, and you're still not sure that no more than 8 "simultaneous" (or at least close enough) calls will be done. Yvan. -- NETASQ http://www.netasq.com