diff options
| author | ad <ad@NetBSD.org> | 2008-04-24 11:38:36 +0000 |
|---|---|---|
| committer | ad <ad@NetBSD.org> | 2008-04-24 11:38:36 +0000 |
| commit | 15e29e981b6909efa33b7744c63e0b96b9863b62 (patch) | |
| tree | 55c1e479ac1c59a8b100b10a7ba50cf23a6789d9 /sys/compat/linux/common/linux_socket.c | |
| parent | 157c4600483d21d61ed40ea7f7ea11c481abb17c (diff) | |
Merge the socket locking patch:
- Socket layer becomes MP safe.
- Unix protocols become MP safe.
- Allows protocol processing interrupts to safely block on locks.
- Fixes a number of race conditions.
With much feedback from matt@ and plunky@.
Diffstat (limited to 'sys/compat/linux/common/linux_socket.c')
| -rw-r--r-- | sys/compat/linux/common/linux_socket.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/compat/linux/common/linux_socket.c b/sys/compat/linux/common/linux_socket.c index 14bcabeb7ec..77a346ef4b7 100644 --- a/sys/compat/linux/common/linux_socket.c +++ b/sys/compat/linux/common/linux_socket.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_socket.c,v 1.90 2008/04/23 13:13:25 ad Exp $ */ +/* $NetBSD: linux_socket.c,v 1.91 2008/04/24 11:38:36 ad Exp $ */ /*- * Copyright (c) 1995, 1998, 2008 The NetBSD Foundation, Inc. @@ -42,7 +42,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.90 2008/04/23 13:13:25 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.91 2008/04/24 11:38:36 ad Exp $"); #if defined(_KERNEL_OPT) #include "opt_inet.h" @@ -1212,17 +1212,17 @@ linux_sys_connect(struct lwp *l, const struct linux_sys_connect_args *uap, regis if (error == EISCONN) { struct socket *so; - int s, state, prflags, nbio; + int state, prflags, nbio; /* getsock() will use the descriptor for us */ if (fd_getsock(SCARG(uap, s), &so) != 0) return EISCONN; - s = splsoftnet(); + solock(so); state = so->so_state; nbio = so->so_nbio; prflags = so->so_proto->pr_flags; - splx(s); + sounlock(so); fd_putfile(SCARG(uap, s)); /* * We should only let this call succeed once per |
