diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2018-06-06 06:55:23 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2018-06-06 06:55:23 +0000 |
commit | 74ae735dc00571554d21c96495d3f4db8cf61232 (patch) | |
tree | 8d455bd05235d0e6943ea13b550f240dd5d41b5a /sys/netinet | |
parent | 4bfe4a74ff0d1a4718c00b31d4e10011a2b9470e (diff) |
Pass the socket to sounlock(), this prepare the terrain for per-socket
locking.
ok visa@, bluhm@
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/in_pcb.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 413f9de9df5..184ebca11e5 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in_pcb.c,v 1.233 2018/06/03 21:32:32 bluhm Exp $ */ +/* $OpenBSD: in_pcb.c,v 1.234 2018/06/06 06:55:22 mpi Exp $ */ /* $NetBSD: in_pcb.c,v 1.25 1996/02/13 23:41:53 christos Exp $ */ /* @@ -584,8 +584,13 @@ in_pcbdetach(struct inpcb *inp) NET_ASSERT_LOCKED(); - so->so_pcb = 0; - sofree(so); + so->so_pcb = NULL; + /* + * As long as the NET_LOCK() is the default lock for Internet + * sockets, do not release it to not introduce new sleeping + * points. + */ + sofree(so, 0); m_freem(inp->inp_options); if (inp->inp_route.ro_rt) { rtfree(inp->inp_route.ro_rt); |