From owner-freebsd-net@FreeBSD.ORG Mon Jun 25 08:42:42 2007 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4E98416A468 for ; Mon, 25 Jun 2007 08:42:42 +0000 (UTC) (envelope-from Susan.Lan@zyxel.com.tw) Received: from zyfb01-66.zyxel.com.tw (zyfb01-66.zyxel.com.tw [59.124.183.66]) by mx1.freebsd.org (Postfix) with ESMTP id E7AA313C45B for ; Mon, 25 Jun 2007 08:42:41 +0000 (UTC) (envelope-from Susan.Lan@zyxel.com.tw) Received: from zytwbe01.zyxel.com ([172.23.5.10]) by zyfb01-66.zyxel.com.tw with Microsoft SMTPSVC(6.0.3790.1830); Mon, 25 Jun 2007 16:42:40 +0800 Received: from zytwfe01.ZyXEL.com ([172.23.5.5]) by zytwbe01.zyxel.com with Microsoft SMTPSVC(6.0.3790.1830); Mon, 25 Jun 2007 16:42:40 +0800 Received: from [172.23.17.70] ([172.23.17.70]) by zytwfe01.ZyXEL.com with Microsoft SMTPSVC(6.0.3790.1830); Mon, 25 Jun 2007 16:42:39 +0800 Message-ID: <467F8002.9010803@zyxel.com.tw> Date: Mon, 25 Jun 2007 16:42:42 +0800 From: blue User-Agent: Mozilla Thunderbird 0.9 (Windows/20041103) X-Accept-Language: en-us, en MIME-Version: 1.0 To: VANHULLEBUS Yvan References: <467F65A0.9010900@zyxel.com.tw> <20070625070547.GA24243@zen.inc> In-Reply-To: <20070625070547.GA24243@zen.inc> X-OriginalArrivalTime: 25 Jun 2007 08:42:39.0415 (UTC) FILETIME=[C9A53C70:01C7B704] Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-net@freebsd.org Subject: Re: Questions about PF_KEY interface 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: Mon, 25 Jun 2007 08:42:42 -0000 Hi, Thanks for your kindly and quick response :> I still have some questions, though... VANHULLEBUS Yvan wrote: >On Mon, Jun 25, 2007 at 02:50:08PM +0800, blue wrote: > > >>Dear all: >> >> > >Hi. > > > > >>I found there are two directories about PF_KEY interface: netkey and >>netipsec under $FreeBSD src$\sys\. >> >>Looking into the makefile, the one that is currently used and built in >>is netkey. >> >>However, I am wondering what's the purpose for netipsec? >> >> > >netkey is used if you compile with IPSEC (KAME's stack). >netipsec is used if you compile with FAST_IPSEC. > > > I have read the manual page for fast_ipsec and ipsec. However, the man page for fast_ipsec on FreeBSD-6.1Release said currently fast_ipsec does not support IPv6. However, I thought it could properly deal with IPv6 packets after tracing code. Could fast_ipsec support IPv6? Another problem is: if the only difference between fast_ipsec and ipsec is about crypto acceleration, why fast_ipsec needs to modify a bunch of files (including ip6_input, ip6_output, ip6_forward, ..., etc.), not only the encap/decap part? > > >>Besides, the handling for the global variable "regtree", which is used >>for key registery, in netipsec seems more proper to me. >> >>For example, when a key is needed to register, the static function, >>key_register(), which is defined in [netkey/netipsec]/key.c, will be called. >> >>However, in netkey/key.c, key_register() will not call mtx_lock before >>the operation of the global variable, regtree. On the other hand, in >>netipsec/key.c, key_register() will mtx_lock. In my opinion, I think the >>latter should be correct since there may be various processes to call >>the function. Without the protection, race condition will occur! >> >> > >KAME's IPSec stack is still giant locked, so doesn't needs more fined >locking. > >FAST_IPSEC used fined grain locking. > > > The function, key_output(), which is defined in netkey\keysock.c, does not lock Giant before key_parse(). According to the comments (see below), maybe the author wants to lock Giant before the operation? However, does it mean currently it may have race condition problem? / /*XXX giant lock*/ s = splnet(); error = key_parse(m, so); m = NULL; splx(s);/ >KAME's stack will probably be removed in the future (for 7.0 ?) thanks >George V. Neville-Neil's work to provide all KAME's stack features on >FAST_IPSEC. > > > > Do you mean FAST_IPSEC feature will be embedded in FreeBSD-7.0 or later version instead of IPSEC? >Yvan. > > > Thanks for your help :> Best regards, blue