Use shared netlock in soreceive(). The UDP and IP divert layer
authorbluhm <bluhm@openbsd.org>
Mon, 5 Sep 2022 14:56:08 +0000 (14:56 +0000)
committerbluhm <bluhm@openbsd.org>
Mon, 5 Sep 2022 14:56:08 +0000 (14:56 +0000)
commit9bbbb445c5e0d62e9de4bc0c6da0319017c270a4
treef4ba8dae21f24361c2d64a5ca25544e4712d5094
parent9e61ec965a34e63e180a8b13289ba4d4a03305c5
Use shared netlock in soreceive().  The UDP and IP divert layer
provide locking of the PCB.  If that is possible, use shared instead
of exclusive netlock in soreceive().  The PCB mutex provides a per
socket lock against multiple soreceive() running in parallel.
Release and regrab both locks in sosleep_nsec().
OK mvs@
sys/kern/uipc_socket.c
sys/kern/uipc_socket2.c
sys/netinet/ip_divert.c
sys/netinet/ip_divert.h
sys/netinet/udp_usrreq.c
sys/netinet/udp_var.h
sys/netinet6/ip6_divert.c
sys/netinet6/ip6_divert.h
sys/sys/protosw.h
sys/sys/socketvar.h