Allow shutdown() to be used on fds returned from sctp_peeloff().

MFC after: 3 days
This commit is contained in:
Michael Tuexen 2012-11-26 08:50:00 +00:00
parent fe02827f92
commit 440da2d35b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=243558

View File

@ -971,7 +971,8 @@ sctp_shutdown(struct socket *so)
}
SCTP_INP_RLOCK(inp);
/* For UDP model this is a invalid call */
if (inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) {
if (!((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
(inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) {
/* Restore the flags that the soshutdown took away. */
SOCKBUF_LOCK(&so->so_rcv);
so->so_rcv.sb_state &= ~SBS_CANTRCVMORE;