Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-8]: src/sys/netipsec Pull up following revision(s) (requested by ...
details: https://anonhg.NetBSD.org/src/rev/8cae070610e1
branches: netbsd-8
changeset: 452575:8cae070610e1
user: martin <martin%NetBSD.org@localhost>
date: Mon Jul 15 08:18:50 2019 +0000
description:
Pull up following revision(s) (requested by maxv in ticket #1287):
sys/netipsec/keysock.c: revision 1.69
Fix locking: it is fine if the lock is already key_so_mtx, this can happen
in socketpair. In that case don't take it.
Ok ozaki-r@
diffstat:
sys/netipsec/keysock.c | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
diffs (35 lines):
diff -r c8f5439e0d35 -r 8cae070610e1 sys/netipsec/keysock.c
--- a/sys/netipsec/keysock.c Tue Jul 09 15:17:50 2019 +0000
+++ b/sys/netipsec/keysock.c Mon Jul 15 08:18:50 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: keysock.c,v 1.58.2.3 2018/11/12 12:23:20 martin Exp $ */
+/* $NetBSD: keysock.c,v 1.58.2.4 2019/07/15 08:18:50 martin Exp $ */
/* $FreeBSD: src/sys/netipsec/keysock.c,v 1.3.2.1 2003/01/24 05:11:36 sam Exp $ */
/* $KAME: keysock.c,v 1.25 2001/08/13 20:07:41 itojun Exp $ */
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: keysock.c,v 1.58.2.3 2018/11/12 12:23:20 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: keysock.c,v 1.58.2.4 2019/07/15 08:18:50 martin Exp $");
/* This code has derived from sys/net/rtsock.c on FreeBSD2.2.5 */
@@ -475,10 +475,12 @@
s = splsoftnet();
- KASSERT(so->so_lock == NULL);
- mutex_obj_hold(key_so_mtx);
- so->so_lock = key_so_mtx;
- solock(so);
+ if (so->so_lock != key_so_mtx) {
+ KASSERT(so->so_lock == NULL);
+ mutex_obj_hold(key_so_mtx);
+ so->so_lock = key_so_mtx;
+ solock(so);
+ }
error = raw_attach(so, proto, &key_rawcb);
if (error) {
Home |
Main Index |
Thread Index |
Old Index