Questions about PF_KEY interface
- From: blue <susan.lan@xxxxxxxxxxxx>
- Date: Mon, 25 Jun 2007 14:50:08 +0800
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
_______________________________________________
freebsd-net@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscribe@xxxxxxxxxxx"
- Follow-Ups:
- Re: Questions about PF_KEY interface
- From: VANHULLEBUS Yvan
- Re: Questions about PF_KEY interface
- From: Bjoern A. Zeeb
- Re: Questions about PF_KEY interface
- Prev by Date: Re: watchdog timeout problem with freebsd 6.2-stable and v6.4.1 if_em driver
- Next by Date: Re: Questions about PF_KEY interface
- Previous by thread: Re: kern/113842: enabling IPv6 post-boot didn't work: required reboot
- Next by thread: Re: Questions about PF_KEY interface
- Index(es):
Relevant Pages
|
|