FreeBSD/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c
/*
 * Detach SDP from the socket, potentially leaving it around for the
 * timewait to expire.
 */
Detach SDP from the socket, potentially leaving it around for the
timewait to expire.
Detach SDP from the socket potentially leaving it around for the timewait to expire .
static void
sdp_detach(struct socket *so)
{
	struct sdp_sock *ssk;
	ssk = sdp_sk(so);
	SDP_WLOCK(ssk);
	KASSERT(ssk->socket != NULL, ("sdp_detach: socket is NULL"));
	ssk->socket->so_pcb = NULL;
	ssk->socket = NULL;
	if (ssk->flags & (SDP_TIMEWAIT | SDP_DREQWAIT))
		SDP_WUNLOCK(ssk);
	else if (ssk->flags & SDP_DROPPED || ssk->state < TCPS_SYN_SENT)
		sdp_pcbfree(ssk);
	else
		panic("sdp_detach: Unexpected state, ssk %p.\n", ssk);
}
static void sdp_detach ( struct socket * so ) { struct sdp_sock * ssk ; ssk = sdp_sk ( so ) ; SDP_WLOCK ( ssk ) ; KASSERT ( ssk -> socket != NULL , ( " " ) ) ; ssk -> socket -> so_pcb = NULL ; ssk -> socket = NULL ; if ( ssk -> flags & ( SDP_TIMEWAIT | SDP_DREQWAIT ) ) SDP_WUNLOCK ( ssk ) ; else if ( ssk -> flags & SDP_DROPPED || ssk -> state < TCPS_SYN_SENT ) sdp_pcbfree ( ssk ) ; else panic ( " \n " , ssk ) ; }
Detach SDP from the socket, potentially leaving it around for the
 timewait to expire.
Detach SDP from the socket potentially leaving it around for the timewait to expire .