summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2024-01-03 11:07:05 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2024-01-03 11:07:05 +0000
commit3c73eab79ea10fe97fc7210da1c39579e026e619 (patch)
treeac192b1dbe1e5d0c465c3d95efb18f3ca686f1a4 /sys
parentad7756b66ed933276e19fa4566b626000b768af1 (diff)
Run connect(2) in parallel within inet doamin.
This unlocks soconnect() for UDP, rip, rip6 and divert. It takes shared net lock in combination with per socket lock. TCP and GRE still use exclusive net lock when connecting. OK mvs@
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/uipc_syscalls.c6
-rw-r--r--sys/netinet/in_pcb.h5
2 files changed, 6 insertions, 5 deletions
diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c
index 0a58664adca..c258936d774 100644
--- a/sys/kern/uipc_syscalls.c
+++ b/sys/kern/uipc_syscalls.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_syscalls.c,v 1.215 2023/12/18 13:11:20 bluhm Exp $ */
+/* $OpenBSD: uipc_syscalls.c,v 1.216 2024/01/03 11:07:04 bluhm Exp $ */
/* $NetBSD: uipc_syscalls.c,v 1.19 1996/02/09 19:00:48 christos Exp $ */
/*
@@ -409,7 +409,7 @@ sys_connect(struct proc *p, void *v, register_t *retval)
if (KTRPOINT(p, KTR_STRUCT))
ktrsockaddr(p, mtod(nam, caddr_t), SCARG(uap, namelen));
#endif
- solock(so);
+ solock_shared(so);
if (isdnssocket(so)) {
error = dns_portcheck(p, so, mtod(nam, void *), nam->m_len);
if (error)
@@ -443,7 +443,7 @@ bad:
if (!interrupted)
so->so_state &= ~SS_ISCONNECTING;
unlock:
- sounlock(so);
+ sounlock_shared(so);
m_freem(nam);
out:
FRELE(fp, p);
diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h
index ed800f016f1..7f976d76eef 100644
--- a/sys/netinet/in_pcb.h
+++ b/sys/netinet/in_pcb.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: in_pcb.h,v 1.146 2024/01/01 22:16:51 bluhm Exp $ */
+/* $OpenBSD: in_pcb.h,v 1.147 2024/01/03 11:07:04 bluhm Exp $ */
/* $NetBSD: in_pcb.h,v 1.14 1996/02/13 23:42:00 christos Exp $ */
/*
@@ -83,6 +83,7 @@
* y inpt_notify pcb table rwlock for notify
* p inpcb_mtx pcb mutex
* L pf_inp_mtx link pf to inp mutex
+ * s so_lock socket rwlock
*/
/*
@@ -194,7 +195,7 @@ struct inpcb {
void *inp_upcall_arg;
u_int inp_rtableid; /* [t] */
int inp_pipex; /* pipex indication */
- uint16_t inp_flowid;
+ uint16_t inp_flowid; /* [s] */
};
LIST_HEAD(inpcbhead, inpcb);