Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/uipc_usrreq.c
Show First 20 Lines • Show All 1,628 Lines • ▼ Show 20 Lines | |||||
#endif | #endif | ||||
} else { | } else { | ||||
unp_pcb_lock_pair(unp, unp2); | unp_pcb_lock_pair(unp, unp2); | ||||
} | } | ||||
KASSERT(unp2 != NULL && so2 != NULL && unp2->unp_socket == so2 && | KASSERT(unp2 != NULL && so2 != NULL && unp2->unp_socket == so2 && | ||||
sotounpcb(so2) == unp2, | sotounpcb(so2) == unp2, | ||||
("%s: unp2 %p so2 %p", __func__, unp2, so2)); | ("%s: unp2 %p so2 %p", __func__, unp2, so2)); | ||||
unp_connect2(so, so2, PRU_CONNECT); | unp_connect2(so, so2, PRU_CONNECT); | ||||
KASSERT((unp->unp_flags & UNP_CONNECTING) != 0, | |||||
("%s: unp %p has UNP_CONNECTING clear", __func__, unp)); | |||||
unp->unp_flags &= ~UNP_CONNECTING; | |||||
unp_pcb_unlock_pair(unp, unp2); | unp_pcb_unlock_pair(unp, unp2); | ||||
bad2: | bad2: | ||||
mtx_unlock(vplock); | mtx_unlock(vplock); | ||||
bad: | bad: | ||||
if (vp != NULL) { | if (vp != NULL) { | ||||
vput(vp); | vput(vp); | ||||
} | } | ||||
free(sa, M_SONAME); | free(sa, M_SONAME); | ||||
if (__predict_false(error)) { | |||||
UNP_PCB_LOCK(unp); | UNP_PCB_LOCK(unp); | ||||
KASSERT((unp->unp_flags & UNP_CONNECTING) != 0, | KASSERT((unp->unp_flags & UNP_CONNECTING) != 0, | ||||
("%s: unp %p has UNP_CONNECTING clear", __func__, unp)); | ("%s: unp %p has UNP_CONNECTING clear", __func__, unp)); | ||||
unp->unp_flags &= ~UNP_CONNECTING; | unp->unp_flags &= ~UNP_CONNECTING; | ||||
UNP_PCB_UNLOCK(unp); | UNP_PCB_UNLOCK(unp); | ||||
} | |||||
return (error); | return (error); | ||||
} | } | ||||
/* | /* | ||||
* Set socket peer credentials at connection time. | * Set socket peer credentials at connection time. | ||||
* | * | ||||
* The client's PCB credentials are copied from its process structure. The | * The client's PCB credentials are copied from its process structure. The | ||||
* server's PCB credentials are copied from the socket on which it called | * server's PCB credentials are copied from the socket on which it called | ||||
▲ Show 20 Lines • Show All 1,318 Lines • Show Last 20 Lines |