Changeset View
Changeset View
Standalone View
Standalone View
head/sys/netinet/sctp_usrreq.c
Show First 20 Lines • Show All 7,132 Lines • ▼ Show 20 Lines | #endif | ||||
if (inp->sctp_flags & SCTP_PCB_FLAGS_UNBOUND) { | if (inp->sctp_flags & SCTP_PCB_FLAGS_UNBOUND) { | ||||
/* We must do a bind. */ | /* We must do a bind. */ | ||||
if ((error = sctp_inpcb_bind(so, NULL, NULL, p))) { | if ((error = sctp_inpcb_bind(so, NULL, NULL, p))) { | ||||
/* bind error, probably perm */ | /* bind error, probably perm */ | ||||
return (error); | return (error); | ||||
} | } | ||||
} | } | ||||
SCTP_INP_WLOCK(inp); | SCTP_INP_WLOCK(inp); | ||||
if ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) == 0) { | |||||
SOCK_LOCK(so); | SOCK_LOCK(so); | ||||
/* It appears for 7.0 and on, we must always call this. */ | |||||
solisten_proto(so, backlog); | solisten_proto(so, backlog); | ||||
if (inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) { | SOCK_UNLOCK(so); | ||||
/* remove the ACCEPTCONN flag for one-to-many sockets */ | |||||
so->so_options &= ~SO_ACCEPTCONN; | |||||
} | } | ||||
if (backlog > 0) { | |||||
inp->sctp_flags |= SCTP_PCB_FLAGS_ACCEPTING; | inp->sctp_flags |= SCTP_PCB_FLAGS_ACCEPTING; | ||||
} else { | |||||
inp->sctp_flags &= ~SCTP_PCB_FLAGS_ACCEPTING; | |||||
} | |||||
SOCK_UNLOCK(so); | |||||
SCTP_INP_WUNLOCK(inp); | SCTP_INP_WUNLOCK(inp); | ||||
return (error); | return (error); | ||||
} | } | ||||
static int sctp_defered_wakeup_cnt = 0; | static int sctp_defered_wakeup_cnt = 0; | ||||
int | int | ||||
sctp_accept(struct socket *so, struct sockaddr **addr) | sctp_accept(struct socket *so, struct sockaddr **addr) | ||||
▲ Show 20 Lines • Show All 289 Lines • Show Last 20 Lines |