Module Name: src
Committed By: snj
Date: Sun Nov 15 06:01:49 UTC 2009
Modified Files:
src/sys/netkey [netbsd-5]: keysock.c
Log Message:
Pull up following revision(s) (requested by mlelstv in ticket #1142):
sys/netkey/keysock.c: revision 1.53
Replace splsoftnet() with proper mutexes as suggested by a...@.
Fixes PR kren/40940.
To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.48.10.1 src/sys/netkey/keysock.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/netkey/keysock.c
diff -u src/sys/netkey/keysock.c:1.48 src/sys/netkey/keysock.c:1.48.10.1
--- src/sys/netkey/keysock.c:1.48 Mon Apr 28 15:18:43 2008
+++ src/sys/netkey/keysock.c Sun Nov 15 06:01:49 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: keysock.c,v 1.48 2008/04/28 15:18:43 ad Exp $ */
+/* $NetBSD: keysock.c,v 1.48.10.1 2009/11/15 06:01:49 snj Exp $ */
/* $KAME: keysock.c,v 1.32 2003/08/22 05:45:08 itojun Exp $ */
/*
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: keysock.c,v 1.48 2008/04/28 15:18:43 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: keysock.c,v 1.48.10.1 2009/11/15 06:01:49 snj Exp $");
#include "opt_inet.h"
@@ -77,7 +77,6 @@
struct rawcb *rp = sotorawcb(so);
struct keycb *kp = (struct keycb *)rp;
int error;
- int s;
error = (*kp->kp_receive)(so, paddr, uio, mp0, controlp, flagsp);
@@ -85,7 +84,8 @@
* now we might have enough receive buffer space.
* pull packets from kp_queue as many as possible.
*/
- s = splsoftnet();
+ mutex_enter(softnet_lock);
+ KERNEL_LOCK(1, NULL);
while (/*CONSTCOND*/ 1) {
struct mbuf *m;
@@ -97,7 +97,8 @@
if (key_sendup0(rp, m, 0, 1))
break;
}
- splx(s);
+ KERNEL_UNLOCK_ONE(NULL);
+ mutex_exit(softnet_lock);
return error;
}