summaryrefslogtreecommitdiffstats
path: root/sys/netinet/sctp_usrreq.c
diff options
context:
space:
mode:
authortuexen <tuexen@FreeBSD.org>2010-02-19 18:00:38 +0000
committertuexen <tuexen@FreeBSD.org>2010-02-19 18:00:38 +0000
commit02181ec0643e149745dbd60d774825ac892efc72 (patch)
tree90b4805f4f66946c7d666f7484aa760536405de4 /sys/netinet/sctp_usrreq.c
parent6133908f1e7a83c72272110726f25646596a038d (diff)
downloadFreeBSD-src-02181ec0643e149745dbd60d774825ac892efc72.zip
FreeBSD-src-02181ec0643e149745dbd60d774825ac892efc72.tar.gz
* Fix another u_long -> uint32_t issue.
* Remove an unused global variable. * Fix an issue reported by Bruce Cran related to reusing SCTP socket which where connected. MFC after: 1 week
Diffstat (limited to 'sys/netinet/sctp_usrreq.c')
-rw-r--r--sys/netinet/sctp_usrreq.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c
index 71f5f65..2851272 100644
--- a/sys/netinet/sctp_usrreq.c
+++ b/sys/netinet/sctp_usrreq.c
@@ -980,7 +980,9 @@ sctp_shutdown(struct socket *so)
/* For UDP model this is a invalid call */
if (inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) {
/* Restore the flags that the soshutdown took away. */
+ SOCKBUF_LOCK(&so->so_rcv);
so->so_rcv.sb_state &= ~SBS_CANTRCVMORE;
+ SOCKBUF_UNLOCK(&so->so_rcv);
/* This proc will wakeup for read and do nothing (I hope) */
SCTP_INP_RUNLOCK(inp);
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EOPNOTSUPP);
@@ -4465,6 +4467,15 @@ sctp_connect(struct socket *so, struct sockaddr *addr, struct thread *p)
if (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) {
stcb->sctp_ep->sctp_flags |= SCTP_PCB_FLAGS_CONNECTED;
/* Set the connected flag so we can queue data */
+ SOCKBUF_LOCK(&so->so_rcv);
+ so->so_rcv.sb_state &= ~SBS_CANTRCVMORE;
+ SOCKBUF_UNLOCK(&so->so_rcv);
+ SOCKBUF_LOCK(&so->so_snd);
+ so->so_snd.sb_state &= ~SBS_CANTSENDMORE;
+ SOCKBUF_UNLOCK(&so->so_snd);
+ SOCK_LOCK(so);
+ so->so_state &= ~SS_ISDISCONNECTING;
+ SOCK_UNLOCK(so);
soisconnecting(so);
}
SCTP_SET_STATE(&stcb->asoc, SCTP_STATE_COOKIE_WAIT);
OpenPOWER on IntegriCloud