Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/sctp_usrreq.c
Show First 20 Lines • Show All 1,406 Lines • ▼ Show 20 Lines | if (error) { | ||||
goto out_now; | goto out_now; | ||||
} | } | ||||
} | } | ||||
/* FIX ME: do we want to pass in a vrf on the connect call? */ | /* FIX ME: do we want to pass in a vrf on the connect call? */ | ||||
vrf_id = inp->def_vrf_id; | vrf_id = inp->def_vrf_id; | ||||
/* We are GOOD to go */ | /* We are GOOD to go */ | ||||
stcb = sctp_aloc_assoc(inp, sa, &error, 0, 0, vrf_id, | stcb = sctp_aloc_assoc_connected(inp, sa, &error, 0, 0, vrf_id, | ||||
inp->sctp_ep.pre_open_stream_count, | inp->sctp_ep.pre_open_stream_count, | ||||
inp->sctp_ep.port, | inp->sctp_ep.port, | ||||
(struct thread *)p, | (struct thread *)p, | ||||
SCTP_INITIALIZE_AUTH_PARAMS); | SCTP_INITIALIZE_AUTH_PARAMS); | ||||
if (stcb == NULL) { | if (stcb == NULL) { | ||||
/* Gak! no memory */ | /* Gak! no memory */ | ||||
goto out_now; | goto out_now; | ||||
} | } | ||||
if (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) { | |||||
stcb->sctp_ep->sctp_flags |= SCTP_PCB_FLAGS_CONNECTED; | |||||
/* Set the connected flag so we can queue data */ | |||||
soisconnecting(so); | |||||
} | |||||
SCTP_SET_STATE(stcb, SCTP_STATE_COOKIE_WAIT); | SCTP_SET_STATE(stcb, SCTP_STATE_COOKIE_WAIT); | ||||
/* move to second address */ | /* move to second address */ | ||||
switch (sa->sa_family) { | switch (sa->sa_family) { | ||||
#ifdef INET | #ifdef INET | ||||
case AF_INET: | case AF_INET: | ||||
sa = (struct sockaddr *)((caddr_t)sa + sizeof(struct sockaddr_in)); | sa = (struct sockaddr *)((caddr_t)sa + sizeof(struct sockaddr_in)); | ||||
break; | break; | ||||
#endif | #endif | ||||
▲ Show 20 Lines • Show All 5,619 Lines • ▼ Show 20 Lines | if (stcb != NULL) { | ||||
/* Already have or am bring up an association */ | /* Already have or am bring up an association */ | ||||
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EALREADY); | SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EALREADY); | ||||
error = EALREADY; | error = EALREADY; | ||||
goto out_now; | goto out_now; | ||||
} | } | ||||
vrf_id = inp->def_vrf_id; | vrf_id = inp->def_vrf_id; | ||||
/* We are GOOD to go */ | /* We are GOOD to go */ | ||||
stcb = sctp_aloc_assoc(inp, addr, &error, 0, 0, vrf_id, | stcb = sctp_aloc_assoc_connected(inp, addr, &error, 0, 0, vrf_id, | ||||
inp->sctp_ep.pre_open_stream_count, | inp->sctp_ep.pre_open_stream_count, | ||||
inp->sctp_ep.port, p, | inp->sctp_ep.port, p, | ||||
SCTP_INITIALIZE_AUTH_PARAMS); | SCTP_INITIALIZE_AUTH_PARAMS); | ||||
if (stcb == NULL) { | if (stcb == NULL) { | ||||
/* Gak! no memory */ | /* Gak! no memory */ | ||||
goto out_now; | goto out_now; | ||||
} | |||||
if (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) { | |||||
stcb->sctp_ep->sctp_flags |= SCTP_PCB_FLAGS_CONNECTED; | |||||
/* Set the connected flag so we can queue data */ | |||||
soisconnecting(so); | |||||
} | } | ||||
SCTP_SET_STATE(stcb, SCTP_STATE_COOKIE_WAIT); | SCTP_SET_STATE(stcb, SCTP_STATE_COOKIE_WAIT); | ||||
(void)SCTP_GETTIME_TIMEVAL(&stcb->asoc.time_entered); | (void)SCTP_GETTIME_TIMEVAL(&stcb->asoc.time_entered); | ||||
sctp_send_initiate(inp, stcb, SCTP_SO_LOCKED); | sctp_send_initiate(inp, stcb, SCTP_SO_LOCKED); | ||||
SCTP_TCB_UNLOCK(stcb); | SCTP_TCB_UNLOCK(stcb); | ||||
out_now: | out_now: | ||||
NET_EPOCH_EXIT(et); | NET_EPOCH_EXIT(et); | ||||
▲ Show 20 Lines • Show All 464 Lines • Show Last 20 Lines |