Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/sctp_usrreq.c
Context not available. | |||||
int error; | int error; | ||||
uint32_t vrf_id = SCTP_DEFAULT_VRFID; | uint32_t vrf_id = SCTP_DEFAULT_VRFID; | ||||
#ifdef IPSEC | |||||
uint32_t flags; | |||||
#endif | |||||
inp = (struct sctp_inpcb *)so->so_pcb; | inp = (struct sctp_inpcb *)so->so_pcb; | ||||
if (inp != 0) { | if (inp != 0) { | ||||
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); | SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); | ||||
Context not available. | |||||
ip_inp = &inp->ip_inp.inp; | ip_inp = &inp->ip_inp.inp; | ||||
ip_inp->inp_vflag |= INP_IPV4; | ip_inp->inp_vflag |= INP_IPV4; | ||||
ip_inp->inp_ip_ttl = MODULE_GLOBAL(ip_defttl); | ip_inp->inp_ip_ttl = MODULE_GLOBAL(ip_defttl); | ||||
#ifdef IPSEC | |||||
error = ipsec_init_policy(so, &ip_inp->inp_sp); | |||||
#ifdef SCTP_LOG_CLOSING | |||||
sctp_log_closing(inp, NULL, 17); | |||||
#endif | |||||
if (error != 0) { | |||||
try_again: | |||||
flags = inp->sctp_flags; | |||||
if (((flags & SCTP_PCB_FLAGS_SOCKET_GONE) == 0) && | |||||
(atomic_cmpset_int(&inp->sctp_flags, flags, (flags | SCTP_PCB_FLAGS_SOCKET_GONE | SCTP_PCB_FLAGS_CLOSE_IP)))) { | |||||
#ifdef SCTP_LOG_CLOSING | |||||
sctp_log_closing(inp, NULL, 15); | |||||
#endif | |||||
SCTP_INP_WUNLOCK(inp); | |||||
sctp_inpcb_free(inp, SCTP_FREE_SHOULD_USE_ABORT, | |||||
SCTP_CALLED_AFTER_CMPSET_OFCLOSE); | |||||
} else { | |||||
flags = inp->sctp_flags; | |||||
if ((flags & SCTP_PCB_FLAGS_SOCKET_GONE) == 0) { | |||||
goto try_again; | |||||
} else { | |||||
SCTP_INP_WUNLOCK(inp); | |||||
} | |||||
} | |||||
return (error); | |||||
} | |||||
#endif /* IPSEC */ | |||||
SCTP_INP_WUNLOCK(inp); | SCTP_INP_WUNLOCK(inp); | ||||
return (0); | return (0); | ||||
} | } | ||||
Context not available. |