Deleted Added
full compact
34c34
< __FBSDID("$FreeBSD: head/sys/netinet/sctputil.c 195918 2009-07-28 14:09:06Z rrs $");
---
> __FBSDID("$FreeBSD: head/sys/netinet/sctputil.c 196260 2009-08-15 21:10:52Z tuexen $");
1486a1487
> (tmr->type != SCTP_TIMER_TYPE_INIT) &&
2987,2988d2987
< SCTP_BUF_NEXT(m_notify) = chk->data;
< SCTP_BUF_LEN(m_notify) = sizeof(struct sctp_send_failed);
2998a2998,2999
> SCTP_BUF_NEXT(m_notify) = chk->data;
> SCTP_BUF_LEN(m_notify) = sizeof(struct sctp_send_failed);
3149c3150
< void
---
> static void
3151c3152,3156
< int nolock, uint32_t val)
---
> uint32_t val, int so_locked
> #if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING)
> SCTP_UNUSED
> #endif
> )
3192,3194d3196
< if (nolock == 0) {
< SCTP_INP_READ_LOCK(stcb->sctp_ep);
< }
3211,3213d3212
< if (nolock == 0) {
< SCTP_INP_READ_UNLOCK(stcb->sctp_ep);
< }
3215a3215,3230
> #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
> struct socket *so;
>
> so = SCTP_INP_SO(stcb->sctp_ep);
> if (!so_locked) {
> atomic_add_int(&stcb->asoc.refcnt, 1);
> SCTP_TCB_UNLOCK(stcb);
> SCTP_SOCKET_LOCK(so, 1);
> SCTP_TCB_LOCK(stcb);
> atomic_subtract_int(&stcb->asoc.refcnt, 1);
> if (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) {
> SCTP_SOCKET_UNLOCK(so, 1);
> return;
> }
> }
> #endif
3216a3232,3236
> #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
> if (!so_locked) {
> SCTP_SOCKET_UNLOCK(so, 1);
> }
> #endif
3543c3563,3564
< sctp_notify_partial_delivery_indication(stcb, error, 0, val);
---
> sctp_notify_partial_delivery_indication(stcb, error, val, so_locked);
> break;
3545d3565
< break;
3588d3607
<
3592d3610
<
3674,3675c3692,3695
< sctp_m_freem(chk->data);
< chk->data = NULL;
---
> if (chk->data) {
> sctp_m_freem(chk->data);
> chk->data = NULL;
> }
3692,3693c3712,3715
< sctp_m_freem(chk->data);
< chk->data = NULL;
---
> if (chk->data) {
> sctp_m_freem(chk->data);
> chk->data = NULL;
> }
5348a5371,5402
> if ((control->length == 0) &&
> (control->end_added == 1)) {
> /*
> * Do we also need to check for (control->pdapi_aborted ==
> * 1)?
> */
> if (hold_rlock == 0) {
> hold_rlock = 1;
> SCTP_INP_READ_LOCK(inp);
> }
> TAILQ_REMOVE(&inp->read_queue, control, next);
> if (control->data) {
> #ifdef INVARIANTS
> panic("control->data not null but control->length == 0");
> #else
> SCTP_PRINTF("Strange, data left in the control buffer. Cleaning up.\n");
> sctp_m_freem(control->data);
> control->data = NULL;
> #endif
> }
> if (control->aux_data) {
> sctp_m_free(control->aux_data);
> control->aux_data = NULL;
> }
> sctp_free_remote_addr(control->whoFrom);
> sctp_free_a_readq(stcb, control);
> if (hold_rlock) {
> hold_rlock = 0;
> SCTP_INP_READ_UNLOCK(inp);
> }
> goto restart;
> }