Deleted Added
full compact
sctputil.c (235282) sctputil.c (235360)
1/*-
2 * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved.
3 * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved.
4 * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 *

--- 19 unchanged lines hidden (view full) ---

28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
30 * THE POSSIBILITY OF SUCH DAMAGE.
31 */
32
33/* $KAME: sctputil.c,v 1.37 2005/03/07 23:26:09 itojun Exp $ */
34
35#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved.
3 * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved.
4 * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 *

--- 19 unchanged lines hidden (view full) ---

28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
30 * THE POSSIBILITY OF SUCH DAMAGE.
31 */
32
33/* $KAME: sctputil.c,v 1.37 2005/03/07 23:26:09 itojun Exp $ */
34
35#include <sys/cdefs.h>
36__FBSDID("$FreeBSD: head/sys/netinet/sctputil.c 235282 2012-05-11 18:07:36Z tuexen $");
36__FBSDID("$FreeBSD: head/sys/netinet/sctputil.c 235360 2012-05-12 20:11:35Z tuexen $");
37
38#include <netinet/sctp_os.h>
39#include <netinet/sctp_pcb.h>
40#include <netinet/sctputil.h>
41#include <netinet/sctp_var.h>
42#include <netinet/sctp_sysctl.h>
43#ifdef INET6
44#endif

--- 1675 unchanged lines hidden (view full) ---

1720#endif
1721 sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_SHUT_ACK_TMR, SCTP_SO_NOT_LOCKED);
1722 break;
1723 case SCTP_TIMER_TYPE_SHUTDOWNGUARD:
1724 if ((stcb == NULL) || (inp == NULL)) {
1725 break;
1726 }
1727 SCTP_STAT_INCR(sctps_timoshutdownguard);
37
38#include <netinet/sctp_os.h>
39#include <netinet/sctp_pcb.h>
40#include <netinet/sctputil.h>
41#include <netinet/sctp_var.h>
42#include <netinet/sctp_sysctl.h>
43#ifdef INET6
44#endif

--- 1675 unchanged lines hidden (view full) ---

1720#endif
1721 sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_SHUT_ACK_TMR, SCTP_SO_NOT_LOCKED);
1722 break;
1723 case SCTP_TIMER_TYPE_SHUTDOWNGUARD:
1724 if ((stcb == NULL) || (inp == NULL)) {
1725 break;
1726 }
1727 SCTP_STAT_INCR(sctps_timoshutdownguard);
1728 sctp_abort_an_association(inp, stcb,
1729 SCTP_SHUTDOWN_GUARD_EXPIRES, NULL, SCTP_SO_NOT_LOCKED);
1728 sctp_abort_an_association(inp, stcb, NULL, SCTP_SO_NOT_LOCKED);
1730 /* no need to unlock on tcb its gone */
1731 goto out_decr;
1732
1733 case SCTP_TIMER_TYPE_STRRESET:
1734 if ((stcb == NULL) || (inp == NULL)) {
1735 break;
1736 }
1737 if (sctp_strreset_timer(inp, stcb, net)) {

--- 850 unchanged lines hidden (view full) ---

2588 }
2589 }
2590 SCTP_LTRACE_ERR_RET_PKT(m, NULL, NULL, NULL, SCTP_FROM_SCTPUTIL, EFAULT);
2591 return (EFAULT);
2592}
2593
2594static void
2595sctp_notify_assoc_change(uint16_t state, struct sctp_tcb *stcb,
1729 /* no need to unlock on tcb its gone */
1730 goto out_decr;
1731
1732 case SCTP_TIMER_TYPE_STRRESET:
1733 if ((stcb == NULL) || (inp == NULL)) {
1734 break;
1735 }
1736 if (sctp_strreset_timer(inp, stcb, net)) {

--- 850 unchanged lines hidden (view full) ---

2587 }
2588 }
2589 SCTP_LTRACE_ERR_RET_PKT(m, NULL, NULL, NULL, SCTP_FROM_SCTPUTIL, EFAULT);
2590 return (EFAULT);
2591}
2592
2593static void
2594sctp_notify_assoc_change(uint16_t state, struct sctp_tcb *stcb,
2596 uint16_t error, int so_locked
2595 uint16_t error, struct sctp_abort_chunk *abort, int so_locked
2597#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING)
2598 SCTP_UNUSED
2599#endif
2600)
2601{
2602 struct mbuf *m_notify;
2603 struct sctp_assoc_change *sac;
2604 struct sctp_queued_to_read *control;
2596#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING)
2597 SCTP_UNUSED
2598#endif
2599)
2600{
2601 struct mbuf *m_notify;
2602 struct sctp_assoc_change *sac;
2603 struct sctp_queued_to_read *control;
2605 size_t len;
2604 size_t notif_len, abort_len;
2606 unsigned int i;
2607
2608#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
2609 struct socket *so;
2610
2611#endif
2612
2613 /*

--- 33 unchanged lines hidden (view full) ---

2647 SCTP_SOCKET_UNLOCK(so, 1);
2648 }
2649#endif
2650 }
2651 if (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVASSOCEVNT)) {
2652 /* event not enabled */
2653 return;
2654 }
2605 unsigned int i;
2606
2607#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
2608 struct socket *so;
2609
2610#endif
2611
2612 /*

--- 33 unchanged lines hidden (view full) ---

2646 SCTP_SOCKET_UNLOCK(so, 1);
2647 }
2648#endif
2649 }
2650 if (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVASSOCEVNT)) {
2651 /* event not enabled */
2652 return;
2653 }
2655 len = sizeof(struct sctp_assoc_change);
2654 notif_len = sizeof(struct sctp_assoc_change);
2655 if (abort != NULL) {
2656 abort_len = htons(abort->ch.chunk_length);
2657 } else {
2658 abort_len = 0;
2659 }
2656 if ((state == SCTP_COMM_UP) || (state == SCTP_RESTART)) {
2660 if ((state == SCTP_COMM_UP) || (state == SCTP_RESTART)) {
2657 len += SCTP_ASSOC_SUPPORTS_MAX;
2661 notif_len += SCTP_ASSOC_SUPPORTS_MAX;
2662 } else if ((state == SCTP_COMM_LOST) || (state == SCTP_CANT_STR_ASSOC)) {
2663 notif_len += abort_len;
2658 }
2664 }
2659 m_notify = sctp_get_mbuf_for_msg(len, 0, M_DONTWAIT, 1, MT_DATA);
2660 if (m_notify == NULL)
2661 /* no space left */
2662 return;
2663 SCTP_BUF_LEN(m_notify) = 0;
2664
2665 m_notify = sctp_get_mbuf_for_msg(notif_len, 0, M_DONTWAIT, 1, MT_DATA);
2666 if (m_notify == NULL) {
2667 /* Retry with smaller value. */
2668 notif_len = sizeof(struct sctp_assoc_change);
2669 m_notify = sctp_get_mbuf_for_msg(notif_len, 0, M_DONTWAIT, 1, MT_DATA);
2670 if (m_notify == NULL) {
2671 return;
2672 }
2673 }
2674 SCTP_BUF_NEXT(m_notify) = NULL;
2665 sac = mtod(m_notify, struct sctp_assoc_change *);
2666 sac->sac_type = SCTP_ASSOC_CHANGE;
2667 sac->sac_flags = 0;
2668 sac->sac_length = sizeof(struct sctp_assoc_change);
2669 sac->sac_state = state;
2670 sac->sac_error = error;
2671 /* XXX verify these stream counts */
2672 sac->sac_outbound_streams = stcb->asoc.streamoutcnt;
2673 sac->sac_inbound_streams = stcb->asoc.streamincnt;
2674 sac->sac_assoc_id = sctp_get_associd(stcb);
2675 sac = mtod(m_notify, struct sctp_assoc_change *);
2676 sac->sac_type = SCTP_ASSOC_CHANGE;
2677 sac->sac_flags = 0;
2678 sac->sac_length = sizeof(struct sctp_assoc_change);
2679 sac->sac_state = state;
2680 sac->sac_error = error;
2681 /* XXX verify these stream counts */
2682 sac->sac_outbound_streams = stcb->asoc.streamoutcnt;
2683 sac->sac_inbound_streams = stcb->asoc.streamincnt;
2684 sac->sac_assoc_id = sctp_get_associd(stcb);
2675 if ((state == SCTP_COMM_UP) || (state == SCTP_RESTART)) {
2676 i = 0;
2677 if (stcb->asoc.peer_supports_prsctp) {
2678 sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_PR;
2685 if (notif_len > sizeof(struct sctp_assoc_change)) {
2686 if ((state == SCTP_COMM_UP) || (state == SCTP_RESTART)) {
2687 i = 0;
2688 if (stcb->asoc.peer_supports_prsctp) {
2689 sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_PR;
2690 }
2691 if (stcb->asoc.peer_supports_auth) {
2692 sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_AUTH;
2693 }
2694 if (stcb->asoc.peer_supports_asconf) {
2695 sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_ASCONF;
2696 }
2697 sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_MULTIBUF;
2698 if (stcb->asoc.peer_supports_strreset) {
2699 sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_RE_CONFIG;
2700 }
2701 sac->sac_length += i;
2702 } else if ((state == SCTP_COMM_LOST) || (state == SCTP_CANT_STR_ASSOC)) {
2703 memcpy(sac->sac_info, abort, abort_len);
2704 sac->sac_length += abort_len;
2679 }
2705 }
2680 if (stcb->asoc.peer_supports_auth) {
2681 sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_AUTH;
2682 }
2683 if (stcb->asoc.peer_supports_asconf) {
2684 sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_ASCONF;
2685 }
2686 sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_MULTIBUF;
2687 if (stcb->asoc.peer_supports_strreset) {
2688 sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_RE_CONFIG;
2689 }
2690 sac->sac_length += i;
2691 }
2692 SCTP_BUF_LEN(m_notify) = sac->sac_length;
2706 }
2707 SCTP_BUF_LEN(m_notify) = sac->sac_length;
2693 SCTP_BUF_NEXT(m_notify) = NULL;
2694 control = sctp_build_readq_entry(stcb, stcb->asoc.primary_destination,
2695 0, 0, stcb->asoc.context, 0, 0, 0,
2696 m_notify);
2697 if (control == NULL) {
2698 /* no memory */
2699 sctp_m_freem(m_notify);
2700 return;
2701 }

--- 793 unchanged lines hidden (view full) ---

3495 (notification == SCTP_NOTIFY_INTERFACE_CONFIRMED)) {
3496 /* Don't report these in front states */
3497 return;
3498 }
3499 }
3500 switch (notification) {
3501 case SCTP_NOTIFY_ASSOC_UP:
3502 if (stcb->asoc.assoc_up_sent == 0) {
2708 control = sctp_build_readq_entry(stcb, stcb->asoc.primary_destination,
2709 0, 0, stcb->asoc.context, 0, 0, 0,
2710 m_notify);
2711 if (control == NULL) {
2712 /* no memory */
2713 sctp_m_freem(m_notify);
2714 return;
2715 }

--- 793 unchanged lines hidden (view full) ---

3509 (notification == SCTP_NOTIFY_INTERFACE_CONFIRMED)) {
3510 /* Don't report these in front states */
3511 return;
3512 }
3513 }
3514 switch (notification) {
3515 case SCTP_NOTIFY_ASSOC_UP:
3516 if (stcb->asoc.assoc_up_sent == 0) {
3503 sctp_notify_assoc_change(SCTP_COMM_UP, stcb, error, so_locked);
3517 sctp_notify_assoc_change(SCTP_COMM_UP, stcb, error, NULL, so_locked);
3504 stcb->asoc.assoc_up_sent = 1;
3505 }
3506 if (stcb->asoc.adaptation_needed && (stcb->asoc.adaptation_sent == 0)) {
3507 sctp_notify_adaptation_layer(stcb);
3508 }
3509 if (stcb->asoc.peer_supports_auth == 0) {
3510 sctp_ulp_notify(SCTP_NOTIFY_NO_PEER_AUTH, stcb, 0,
3511 NULL, so_locked);
3512 }
3513 break;
3514 case SCTP_NOTIFY_ASSOC_DOWN:
3518 stcb->asoc.assoc_up_sent = 1;
3519 }
3520 if (stcb->asoc.adaptation_needed && (stcb->asoc.adaptation_sent == 0)) {
3521 sctp_notify_adaptation_layer(stcb);
3522 }
3523 if (stcb->asoc.peer_supports_auth == 0) {
3524 sctp_ulp_notify(SCTP_NOTIFY_NO_PEER_AUTH, stcb, 0,
3525 NULL, so_locked);
3526 }
3527 break;
3528 case SCTP_NOTIFY_ASSOC_DOWN:
3515 sctp_notify_assoc_change(SCTP_SHUTDOWN_COMP, stcb, error, so_locked);
3529 sctp_notify_assoc_change(SCTP_SHUTDOWN_COMP, stcb, error, NULL, so_locked);
3516 break;
3517 case SCTP_NOTIFY_INTERFACE_DOWN:
3518 {
3519 struct sctp_nets *net;
3520
3521 net = (struct sctp_nets *)data;
3522 sctp_notify_peer_addr_change(stcb, SCTP_ADDR_UNREACHABLE,
3523 (struct sockaddr *)&net->ro._l_addr, error);

--- 34 unchanged lines hidden (view full) ---

3558 sctp_notify_partial_delivery_indication(stcb, error, val, so_locked);
3559 break;
3560 }
3561 case SCTP_NOTIFY_STRDATA_ERR:
3562 break;
3563 case SCTP_NOTIFY_ASSOC_ABORTED:
3564 if ((stcb) && (((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_WAIT) ||
3565 ((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_ECHOED))) {
3530 break;
3531 case SCTP_NOTIFY_INTERFACE_DOWN:
3532 {
3533 struct sctp_nets *net;
3534
3535 net = (struct sctp_nets *)data;
3536 sctp_notify_peer_addr_change(stcb, SCTP_ADDR_UNREACHABLE,
3537 (struct sockaddr *)&net->ro._l_addr, error);

--- 34 unchanged lines hidden (view full) ---

3572 sctp_notify_partial_delivery_indication(stcb, error, val, so_locked);
3573 break;
3574 }
3575 case SCTP_NOTIFY_STRDATA_ERR:
3576 break;
3577 case SCTP_NOTIFY_ASSOC_ABORTED:
3578 if ((stcb) && (((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_WAIT) ||
3579 ((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_ECHOED))) {
3566 sctp_notify_assoc_change(SCTP_CANT_STR_ASSOC, stcb, error, so_locked);
3580 sctp_notify_assoc_change(SCTP_CANT_STR_ASSOC, stcb, error, data, so_locked);
3567 } else {
3581 } else {
3568 sctp_notify_assoc_change(SCTP_COMM_LOST, stcb, error, so_locked);
3582 sctp_notify_assoc_change(SCTP_COMM_LOST, stcb, error, data, so_locked);
3569 }
3570 break;
3571 case SCTP_NOTIFY_PEER_OPENED_STREAM:
3572 break;
3573 case SCTP_NOTIFY_STREAM_OPENED_OK:
3574 break;
3575 case SCTP_NOTIFY_ASSOC_RESTART:
3583 }
3584 break;
3585 case SCTP_NOTIFY_PEER_OPENED_STREAM:
3586 break;
3587 case SCTP_NOTIFY_STREAM_OPENED_OK:
3588 break;
3589 case SCTP_NOTIFY_ASSOC_RESTART:
3576 sctp_notify_assoc_change(SCTP_RESTART, stcb, error, so_locked);
3590 sctp_notify_assoc_change(SCTP_RESTART, stcb, error, NULL, so_locked);
3577 if (stcb->asoc.peer_supports_auth == 0) {
3578 sctp_ulp_notify(SCTP_NOTIFY_NO_PEER_AUTH, stcb, 0,
3579 NULL, so_locked);
3580 }
3581 break;
3582 case SCTP_NOTIFY_HB_RESP:
3583 break;
3584 case SCTP_NOTIFY_STR_RESET_SEND:

--- 152 unchanged lines hidden (view full) ---

3737 }
3738
3739 if (holds_lock == 0) {
3740 SCTP_TCB_SEND_UNLOCK(stcb);
3741 }
3742}
3743
3744void
3591 if (stcb->asoc.peer_supports_auth == 0) {
3592 sctp_ulp_notify(SCTP_NOTIFY_NO_PEER_AUTH, stcb, 0,
3593 NULL, so_locked);
3594 }
3595 break;
3596 case SCTP_NOTIFY_HB_RESP:
3597 break;
3598 case SCTP_NOTIFY_STR_RESET_SEND:

--- 152 unchanged lines hidden (view full) ---

3751 }
3752
3753 if (holds_lock == 0) {
3754 SCTP_TCB_SEND_UNLOCK(stcb);
3755 }
3756}
3757
3758void
3745sctp_abort_notification(struct sctp_tcb *stcb, int error, int so_locked
3759sctp_abort_notification(struct sctp_tcb *stcb, uint16_t error,
3760 struct sctp_abort_chunk *abort, int so_locked
3746#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING)
3747 SCTP_UNUSED
3748#endif
3749)
3750{
3751 if (stcb == NULL) {
3752 return;
3753 }

--- 4 unchanged lines hidden (view full) ---

3758 }
3759 if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) ||
3760 (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) ||
3761 (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET)) {
3762 return;
3763 }
3764 /* Tell them we lost the asoc */
3765 sctp_report_all_outbound(stcb, 1, so_locked);
3761#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING)
3762 SCTP_UNUSED
3763#endif
3764)
3765{
3766 if (stcb == NULL) {
3767 return;
3768 }

--- 4 unchanged lines hidden (view full) ---

3773 }
3774 if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) ||
3775 (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) ||
3776 (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET)) {
3777 return;
3778 }
3779 /* Tell them we lost the asoc */
3780 sctp_report_all_outbound(stcb, 1, so_locked);
3766 sctp_ulp_notify(SCTP_NOTIFY_ASSOC_ABORTED, stcb, error, NULL, so_locked);
3781 sctp_ulp_notify(SCTP_NOTIFY_ASSOC_ABORTED, stcb, error, abort, so_locked);
3767}
3768
3769void
3770sctp_abort_association(struct sctp_inpcb *inp, struct sctp_tcb *stcb,
3771 struct mbuf *m, int iphlen, struct sctphdr *sh, struct mbuf *op_err,
3772 uint32_t vrf_id, uint16_t port)
3773{
3774 uint32_t vtag;
3775
3776#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
3777 struct socket *so;
3778
3779#endif
3780
3781 vtag = 0;
3782 if (stcb != NULL) {
3783 /* We have a TCB to abort, send notification too */
3784 vtag = stcb->asoc.peer_vtag;
3782}
3783
3784void
3785sctp_abort_association(struct sctp_inpcb *inp, struct sctp_tcb *stcb,
3786 struct mbuf *m, int iphlen, struct sctphdr *sh, struct mbuf *op_err,
3787 uint32_t vrf_id, uint16_t port)
3788{
3789 uint32_t vtag;
3790
3791#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
3792 struct socket *so;
3793
3794#endif
3795
3796 vtag = 0;
3797 if (stcb != NULL) {
3798 /* We have a TCB to abort, send notification too */
3799 vtag = stcb->asoc.peer_vtag;
3785 sctp_abort_notification(stcb, 0, SCTP_SO_NOT_LOCKED);
3800 sctp_abort_notification(stcb, 0, NULL, SCTP_SO_NOT_LOCKED);
3786 /* get the assoc vrf id and table id */
3787 vrf_id = stcb->asoc.vrf_id;
3788 stcb->asoc.state |= SCTP_STATE_WAS_ABORTED;
3789 }
3790 sctp_send_abort(m, iphlen, sh, vtag, op_err, vrf_id, port);
3791 if (stcb != NULL) {
3792 /* Ok, now lets free it */
3793#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING)

--- 77 unchanged lines hidden (view full) ---

3871 }
3872#endif
3873}
3874
3875#endif
3876
3877void
3878sctp_abort_an_association(struct sctp_inpcb *inp, struct sctp_tcb *stcb,
3801 /* get the assoc vrf id and table id */
3802 vrf_id = stcb->asoc.vrf_id;
3803 stcb->asoc.state |= SCTP_STATE_WAS_ABORTED;
3804 }
3805 sctp_send_abort(m, iphlen, sh, vtag, op_err, vrf_id, port);
3806 if (stcb != NULL) {
3807 /* Ok, now lets free it */
3808#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING)

--- 77 unchanged lines hidden (view full) ---

3886 }
3887#endif
3888}
3889
3890#endif
3891
3892void
3893sctp_abort_an_association(struct sctp_inpcb *inp, struct sctp_tcb *stcb,
3879 int error, struct mbuf *op_err,
3894 struct mbuf *op_err,
3880 int so_locked
3881#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING)
3882 SCTP_UNUSED
3883#endif
3884)
3885{
3886#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
3887 struct socket *so;

--- 11 unchanged lines hidden (view full) ---

3899 SCTP_CALLED_DIRECTLY_NOCMPSET);
3900 }
3901 }
3902 return;
3903 } else {
3904 stcb->asoc.state |= SCTP_STATE_WAS_ABORTED;
3905 }
3906 /* notify the ulp */
3895 int so_locked
3896#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING)
3897 SCTP_UNUSED
3898#endif
3899)
3900{
3901#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
3902 struct socket *so;

--- 11 unchanged lines hidden (view full) ---

3914 SCTP_CALLED_DIRECTLY_NOCMPSET);
3915 }
3916 }
3917 return;
3918 } else {
3919 stcb->asoc.state |= SCTP_STATE_WAS_ABORTED;
3920 }
3921 /* notify the ulp */
3907 if ((inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) == 0)
3908 sctp_abort_notification(stcb, error, so_locked);
3922 if ((inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) == 0) {
3923 sctp_abort_notification(stcb, 0, NULL, so_locked);
3924 }
3909 /* notify the peer */
3910 sctp_send_abort_tcb(stcb, op_err, so_locked);
3911 SCTP_STAT_INCR_COUNTER32(sctps_aborted);
3912 if ((SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_OPEN) ||
3913 (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) {
3914 SCTP_STAT_DECR_GAUGE32(sctps_currestab);
3915 }
3916 /* now free the asoc */

--- 3006 unchanged lines hidden ---
3925 /* notify the peer */
3926 sctp_send_abort_tcb(stcb, op_err, so_locked);
3927 SCTP_STAT_INCR_COUNTER32(sctps_aborted);
3928 if ((SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_OPEN) ||
3929 (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) {
3930 SCTP_STAT_DECR_GAUGE32(sctps_currestab);
3931 }
3932 /* now free the asoc */

--- 3006 unchanged lines hidden ---