diff options
-rw-r--r-- | sys/netinet/sctp_usrreq.c | 10 | ||||
-rw-r--r-- | sys/netinet/sctputil.c | 5 |
2 files changed, 8 insertions, 7 deletions
diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c index 87fef518b9e8..65341796d197 100644 --- a/sys/netinet/sctp_usrreq.c +++ b/sys/netinet/sctp_usrreq.c @@ -5076,9 +5076,7 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize, } else { sctp_feature_off(inp, SCTP_PCB_FLAGS_STREAM_RESETEVNT); } - SCTP_INP_WUNLOCK(inp); - SCTP_INP_RLOCK(inp); LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) { SCTP_TCB_LOCK(stcb); if (events->sctp_association_event) { @@ -5138,10 +5136,10 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize, * style sockets. */ if (events->sctp_sender_dry_event) { - if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || - (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { + if (((stcb->sctp_ep->sctp_flags & (SCTP_PCB_FLAGS_TCPTYPE | SCTP_PCB_FLAGS_IN_TCPPOOL)) != 0) && + !SCTP_IS_LISTENING(inp)) { stcb = LIST_FIRST(&inp->sctp_asoc_list); - if (stcb) { + if (stcb != NULL) { SCTP_TCB_LOCK(stcb); if (TAILQ_EMPTY(&stcb->asoc.send_queue) && TAILQ_EMPTY(&stcb->asoc.sent_queue) && @@ -5152,7 +5150,7 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize, } } } - SCTP_INP_RUNLOCK(inp); + SCTP_INP_WUNLOCK(inp); break; } case SCTP_ADAPTATION_LAYER: diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index 7b82a2ce6d86..6c62a083458f 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -4836,7 +4836,10 @@ sctp_wakeup_the_read_socket(struct sctp_inpcb *inp, SCTP_UNUSED ) { - if ((inp != NULL) && (inp->sctp_socket != NULL)) { + if ((inp != NULL) && + (inp->sctp_socket != NULL) && + (((stcb->sctp_ep->sctp_flags & (SCTP_PCB_FLAGS_TCPTYPE | SCTP_PCB_FLAGS_IN_TCPPOOL)) == 0) || + !SCTP_IS_LISTENING(inp))) { sctp_sorwakeup(inp, inp->sctp_socket); } } |