[PATCH] IPSec fixes

Hajimu UMEMOTO ume at FreeBSD.org
Fri Jan 16 00:12:39 PST 2004


Hi,

>>>>> On Thu, 15 Jan 2004 22:16:59 +0000 (UTC)
>>>>> bzeeb-lists at lists.zabbadoz.net ("Bjoern A. Zeeb") said:

bzeeb-lists> I have built a HEAD kernel from this evening.

bzeeb-lists> crashing the kernel is more easy than booting it...

bzeeb-lists> So the big question at the moment is - why will it not happen if I
bzeeb-lists> remove the unlink call from the spdflush ? What am I missing ?
bzeeb-lists> If anybody has any more ideas please let me know; I will nost likely
bzeeb-lists> not find the time for more debugging until sat eve.

Do you mean that following patch itojun offered doesn't help for you?
It seems fix the problem here.

Index: sys/netkey/key.c
diff -up sys/netkey/key.c.orig sys/netkey/key.c
--- sys/netkey/key.c.orig	Fri Jan 16 17:06:26 2004
+++ sys/netkey/key.c	Fri Jan 16 17:07:38 2004
@@ -1958,7 +1958,6 @@ key_spdadd(so, m, mhp)
 	newsp->lifetime = lft ? lft->sadb_lifetime_addtime : 0;
 	newsp->validtime = lft ? lft->sadb_lifetime_usetime : 0;
 
-	newsp->refcnt = 1;	/* do not reclaim until I say I do */
 	newsp->state = IPSEC_SPSTATE_ALIVE;
 	LIST_INSERT_TAIL(&sptree[newsp->dir], newsp, secpolicy, chain);
 
@@ -7591,9 +7590,10 @@ key_sp_unlink(sp)
 {
 
 	/* remove from SP index */
-	if (__LIST_CHAINED(sp))
+	if (__LIST_CHAINED(sp)) {
 		LIST_REMOVE(sp, chain);
-	key_freesp(sp);
+		key_freesp(sp);
+	}
 }
 
 /* XXX too much? */

Sincerely,

--
Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan
ume at mahoroba.org  ume at bisd.hitachi.co.jp  ume@{,jp.}FreeBSD.org
http://www.imasy.org/~ume/


More information about the freebsd-current mailing list