Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/uipc_socket.c
Show First 20 Lines • Show All 1,189 Lines • ▼ Show 20 Lines | sofree(struct socket *so) | ||||
if (SOLISTENING(so)) | if (SOLISTENING(so)) | ||||
so->so_error = ECONNABORTED; | so->so_error = ECONNABORTED; | ||||
SOCK_UNLOCK(so); | SOCK_UNLOCK(so); | ||||
if (so->so_dtor != NULL) | if (so->so_dtor != NULL) | ||||
so->so_dtor(so); | so->so_dtor(so); | ||||
VNET_SO_ASSERT(so); | VNET_SO_ASSERT(so); | ||||
if (pr->pr_flags & PR_RIGHTS && pr->pr_domain->dom_dispose != NULL) | if (pr->pr_flags & PR_RIGHTS) { | ||||
MPASS(pr->pr_domain->dom_dispose != NULL); | |||||
(*pr->pr_domain->dom_dispose)(so); | (*pr->pr_domain->dom_dispose)(so); | ||||
} | |||||
if (pr->pr_usrreqs->pru_detach != NULL) | if (pr->pr_usrreqs->pru_detach != NULL) | ||||
(*pr->pr_usrreqs->pru_detach)(so); | (*pr->pr_usrreqs->pru_detach)(so); | ||||
/* | /* | ||||
* From this point on, we assume that no other references to this | * From this point on, we assume that no other references to this | ||||
* socket exist anywhere else in the stack. Therefore, no locks need | * socket exist anywhere else in the stack. Therefore, no locks need | ||||
* to be acquired or held. | * to be acquired or held. | ||||
* | * | ||||
▲ Show 20 Lines • Show All 1,776 Lines • ▼ Show 20 Lines | sorflush(struct socket *so) | ||||
SOCK_RECVBUF_UNLOCK(so); | SOCK_RECVBUF_UNLOCK(so); | ||||
SOCK_IO_RECV_UNLOCK(so); | SOCK_IO_RECV_UNLOCK(so); | ||||
/* | /* | ||||
* Dispose of special rights and flush the copied socket. Don't call | * Dispose of special rights and flush the copied socket. Don't call | ||||
* any unsafe routines (that rely on locks being initialized) on aso. | * any unsafe routines (that rely on locks being initialized) on aso. | ||||
*/ | */ | ||||
pr = so->so_proto; | pr = so->so_proto; | ||||
if (pr->pr_flags & PR_RIGHTS && pr->pr_domain->dom_dispose != NULL) | if (pr->pr_flags & PR_RIGHTS) { | ||||
MPASS(pr->pr_domain->dom_dispose != NULL); | |||||
(*pr->pr_domain->dom_dispose)(&aso); | (*pr->pr_domain->dom_dispose)(&aso); | ||||
} | |||||
sbrelease_internal(&aso.so_rcv, so); | sbrelease_internal(&aso.so_rcv, so); | ||||
} | } | ||||
/* | /* | ||||
* Wrapper for Socket established helper hook. | * Wrapper for Socket established helper hook. | ||||
* Parameters: socket, context of the hook point, hook id. | * Parameters: socket, context of the hook point, hook id. | ||||
*/ | */ | ||||
static int inline | static int inline | ||||
▲ Show 20 Lines • Show All 1,543 Lines • Show Last 20 Lines |