Date: Fri, 19 Feb 2010 18:00:38 +0000 (UTC) From: Michael Tuexen <tuexen@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r204096 - head/sys/netinet Message-ID: <201002191800.o1JI0cDY057943@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: tuexen Date: Fri Feb 19 18:00:38 2010 New Revision: 204096 URL: http://svn.freebsd.org/changeset/base/204096 Log: * 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 Modified: head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Fri Feb 19 17:54:03 2010 (r204095) +++ head/sys/netinet/sctp_usrreq.c Fri Feb 19 18:00:38 2010 (r204096) @@ -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 s 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); Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Fri Feb 19 17:54:03 2010 (r204095) +++ head/sys/netinet/sctputil.c Fri Feb 19 18:00:38 2010 (r204096) @@ -849,7 +849,7 @@ retry: uint32_t sctp_select_a_tag(struct sctp_inpcb *inp, uint16_t lport, uint16_t rport, int save_in_twait) { - u_long x, not_done; + uint32_t x, not_done; struct timeval now; (void)SCTP_GETTIME_TIMEVAL(&now); @@ -2751,8 +2751,6 @@ sctp_pad_lastmbuf(struct mbuf *m, int pa return (EFAULT); } -int sctp_asoc_change_wake = 0; - static void sctp_notify_assoc_change(uint32_t event, struct sctp_tcb *stcb, uint32_t error, void *data, int so_locked @@ -2806,7 +2804,6 @@ sctp_notify_assoc_change(uint32_t event, SCTP_SOCKET_UNLOCK(so, 1); } #endif - sctp_asoc_change_wake++; } if (sctp_is_feature_off(stcb->sctp_ep, SCTP_PCB_FLAGS_RECVASSOCEVNT)) { /* event not enabled */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201002191800.o1JI0cDY057943>