diff options
Diffstat (limited to 'sys/netinet/sctputil.c')
-rw-r--r-- | sys/netinet/sctputil.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index 801107f..fb660c8 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -904,6 +904,7 @@ sctp_init_asoc(struct sctp_inpcb *m, struct sctp_tcb *stcb, #else asoc->default_flowlabel = 0; #endif + asoc->sb_send_resv = 0; if (override_tag) { struct timeval now; @@ -3363,6 +3364,7 @@ sctp_notify_shutdown_event(struct sctp_tcb *stcb) } #endif socantsendmore(stcb->sctp_socket); + socantrcvmore(stcb->sctp_socket); #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif @@ -4948,10 +4950,6 @@ sctp_sorecvmsg(struct socket *so, SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, EINVAL); return (EINVAL); } - if (from && fromlen <= 0) { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, EINVAL); - return (EINVAL); - } if (msg_flags) { in_flags = *msg_flags; if (in_flags & MSG_PEEK) @@ -5017,12 +5015,15 @@ restart_nosblocks: error = so->so_error; if ((in_flags & MSG_PEEK) == 0) so->so_error = 0; + goto out; } else { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, ENOTCONN); - /* indicate EOF */ - error = 0; + if (so->so_rcv.sb_cc == 0) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, ENOTCONN); + /* indicate EOF */ + error = 0; + goto out; + } } - goto out; } if ((so->so_rcv.sb_cc <= held_length) && block_allowed) { /* we need to wait for data */ |