Deleted Added
full compact
sctp_input.c (243882) sctp_input.c (246588)
1/*-
2 * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved.
3 * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved.
4 * Copyright (c) 2008-2012, 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 *

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

26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
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#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved.
3 * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved.
4 * Copyright (c) 2008-2012, 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 *

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

26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
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#include <sys/cdefs.h>
34__FBSDID("$FreeBSD: head/sys/netinet/sctp_input.c 243882 2012-12-05 08:04:20Z glebius $");
34__FBSDID("$FreeBSD: head/sys/netinet/sctp_input.c 246588 2013-02-09 08:27:08Z tuexen $");
35
36#include <netinet/sctp_os.h>
37#include <netinet/sctp_var.h>
38#include <netinet/sctp_sysctl.h>
39#include <netinet/sctp_pcb.h>
40#include <netinet/sctp_header.h>
41#include <netinet/sctputil.h>
42#include <netinet/sctp_output.h>

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

951 if (!TAILQ_EMPTY(&asoc->send_queue) ||
952 !TAILQ_EMPTY(&asoc->sent_queue) ||
953 some_on_streamwheel) {
954 /* By returning we will push more data out */
955 return;
956 } else {
957 /* no outstanding data to send, so move on... */
958 /* send SHUTDOWN-ACK */
35
36#include <netinet/sctp_os.h>
37#include <netinet/sctp_var.h>
38#include <netinet/sctp_sysctl.h>
39#include <netinet/sctp_pcb.h>
40#include <netinet/sctp_header.h>
41#include <netinet/sctputil.h>
42#include <netinet/sctp_output.h>

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

951 if (!TAILQ_EMPTY(&asoc->send_queue) ||
952 !TAILQ_EMPTY(&asoc->sent_queue) ||
953 some_on_streamwheel) {
954 /* By returning we will push more data out */
955 return;
956 } else {
957 /* no outstanding data to send, so move on... */
958 /* send SHUTDOWN-ACK */
959 sctp_send_shutdown_ack(stcb, net);
960 /* move to SHUTDOWN-ACK-SENT state */
961 if ((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) ||
962 (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) {
963 SCTP_STAT_DECR_GAUGE32(sctps_currestab);
964 }
965 SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_ACK_SENT);
966 SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING);
967 sctp_stop_timers_for_shutdown(stcb);
959 /* move to SHUTDOWN-ACK-SENT state */
960 if ((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) ||
961 (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) {
962 SCTP_STAT_DECR_GAUGE32(sctps_currestab);
963 }
964 SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_ACK_SENT);
965 SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING);
966 sctp_stop_timers_for_shutdown(stcb);
967 sctp_send_shutdown_ack(stcb, net);
968 sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNACK, stcb->sctp_ep,
969 stcb, net);
970 }
971}
972
973static void
974sctp_handle_shutdown_ack(struct sctp_shutdown_ack_chunk *cp SCTP_UNUSED,
975 struct sctp_tcb *stcb,

--- 5163 unchanged lines hidden ---
968 sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNACK, stcb->sctp_ep,
969 stcb, net);
970 }
971}
972
973static void
974sctp_handle_shutdown_ack(struct sctp_shutdown_ack_chunk *cp SCTP_UNUSED,
975 struct sctp_tcb *stcb,

--- 5163 unchanged lines hidden ---