Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Jun 2007 14:50:08 +0800
From:      blue <susan.lan@zyxel.com.tw>
To:        freebsd-net@freebsd.org
Subject:   Questions about PF_KEY interface
Message-ID:  <467F65A0.9010900@zyxel.com.tw>

next in thread | raw e-mail | index | archive | help
Dear all:

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?

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!

Many thanks.

blue



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?467F65A0.9010900>