Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/sctp_input.c
Show First 20 Lines • Show All 673 Lines • ▼ Show 20 Lines | sctp_handle_nat_colliding_state(struct sctp_tcb *stcb) | ||||
* Return 0 means we want you to proceed with the abort non-zero | * Return 0 means we want you to proceed with the abort non-zero | ||||
* means no abort processing. | * means no abort processing. | ||||
*/ | */ | ||||
uint32_t new_vtag; | uint32_t new_vtag; | ||||
struct sctpasochead *head; | struct sctpasochead *head; | ||||
if ((SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_WAIT) || | if ((SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_WAIT) || | ||||
(SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED)) { | (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED)) { | ||||
SCTP_INP_INFO_RLOCK(); | |||||
new_vtag = sctp_select_a_tag(stcb->sctp_ep, stcb->sctp_ep->sctp_lport, stcb->rport, 1); | new_vtag = sctp_select_a_tag(stcb->sctp_ep, stcb->sctp_ep->sctp_lport, stcb->rport, 1); | ||||
SCTP_INP_INFO_RLOCK(); | |||||
atomic_add_int(&stcb->asoc.refcnt, 1); | atomic_add_int(&stcb->asoc.refcnt, 1); | ||||
SCTP_TCB_UNLOCK(stcb); | SCTP_TCB_UNLOCK(stcb); | ||||
SCTP_INP_INFO_WLOCK(); | SCTP_INP_INFO_WLOCK(); | ||||
SCTP_TCB_LOCK(stcb); | SCTP_TCB_LOCK(stcb); | ||||
atomic_subtract_int(&stcb->asoc.refcnt, 1); | atomic_subtract_int(&stcb->asoc.refcnt, 1); | ||||
} else { | } else { | ||||
return (0); | return (0); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,487 Lines • ▼ Show 20 Lines | if (((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || | ||||
(!SCTP_IS_LISTENING(inp))) { | (!SCTP_IS_LISTENING(inp))) { | ||||
/* | /* | ||||
* This is an endpoint that called connect() how it got a | * This is an endpoint that called connect() how it got a | ||||
* cookie that is NEW is a bit of a mystery. It must be that | * cookie that is NEW is a bit of a mystery. It must be that | ||||
* the INIT was sent, but before it got there.. a complete | * the INIT was sent, but before it got there.. a complete | ||||
* INIT/INIT-ACK/COOKIE arrived. But of course then it | * INIT/INIT-ACK/COOKIE arrived. But of course then it | ||||
* should have went to the other code.. not here.. oh well.. | * should have went to the other code.. not here.. oh well.. | ||||
* a bit of protection is worth having.. | * a bit of protection is worth having.. | ||||
* | |||||
* XXXMJ unlocked | |||||
*/ | */ | ||||
stcb->sctp_ep->sctp_flags |= SCTP_PCB_FLAGS_CONNECTED; | stcb->sctp_ep->sctp_flags |= SCTP_PCB_FLAGS_CONNECTED; | ||||
soisconnected(stcb->sctp_socket); | soisconnected(stcb->sctp_socket); | ||||
} else if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) && | } else if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) && | ||||
(SCTP_IS_LISTENING(inp))) { | (SCTP_IS_LISTENING(inp))) { | ||||
/* | /* | ||||
* We don't want to do anything with this one. Since it is | * We don't want to do anything with this one. Since it is | ||||
* the listening guy. The timer will get started for | * the listening guy. The timer will get started for | ||||
▲ Show 20 Lines • Show All 3,592 Lines • Show Last 20 Lines |