* 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
This commit is contained in:
tuexen 2010-02-19 18:00:38 +00:00
parent 6133908f1e
commit 02181ec064
2 changed files with 12 additions and 4 deletions

@ -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);

@ -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 padval, struct mbuf *last_mbuf)
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, struct sctp_tcb *stcb,
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 */