Page MenuHomeFreeBSD

D17590.diff
No OneTemporary

D17590.diff

Index: head/share/man/man9/socket.9
===================================================================
--- head/share/man/man9/socket.9
+++ head/share/man/man9/socket.9
@@ -26,7 +26,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd June 8, 2018
+.Dd October 18, 2018
.Dt SOCKET 9
.Os
.Sh NAME
@@ -378,8 +378,8 @@
A kernel system can use the
.Fn sodtor_set
function to set a destructor for a socket.
-The destructor is called when the socket is closed.
-The destructor is called after the protocol close routine has completed.
+The destructor is called when the socket is is about to be freed.
+The destructor is called before the protocol detach routine.
The destructor can serve as a callback to initiate additional cleanup actions.
.Ss Socket I/O
The
Index: head/sys/kern/uipc_socket.c
===================================================================
--- head/sys/kern/uipc_socket.c
+++ head/sys/kern/uipc_socket.c
@@ -1026,6 +1026,9 @@
so->so_error = ECONNABORTED;
SOCK_UNLOCK(so);
+ if (so->so_dtor != NULL)
+ so->so_dtor(so);
+
VNET_SO_ASSERT(so);
if (pr->pr_flags & PR_RIGHTS && pr->pr_domain->dom_dispose != NULL)
(*pr->pr_domain->dom_dispose)(so);
@@ -1102,8 +1105,6 @@
drop:
if (so->so_proto->pr_usrreqs->pru_close != NULL)
(*so->so_proto->pr_usrreqs->pru_close)(so);
- if (so->so_dtor != NULL)
- so->so_dtor(so);
SOCK_LOCK(so);
if ((listening = (so->so_options & SO_ACCEPTCONN))) {

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 19, 7:22 PM (21 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14722311
Default Alt Text
D17590.diff (1 KB)

Event Timeline