Deleted Added
full compact
sctp_indata.c (171440) sctp_indata.c (171477)
1/*-
2 * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met:
6 *
7 * a) Redistributions of source code must retain the above copyright notice,
8 * this list of conditions and the following disclaimer.

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

26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
28 * THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31/* $KAME: sctp_indata.c,v 1.36 2005/03/06 16:04:17 itojun Exp $ */
32
33#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met:
6 *
7 * a) Redistributions of source code must retain the above copyright notice,
8 * this list of conditions and the following disclaimer.

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

26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
28 * THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31/* $KAME: sctp_indata.c,v 1.36 2005/03/06 16:04:17 itojun Exp $ */
32
33#include <sys/cdefs.h>
34__FBSDID("$FreeBSD: head/sys/netinet/sctp_indata.c 171440 2007-07-14 09:36:28Z rrs $");
34__FBSDID("$FreeBSD: head/sys/netinet/sctp_indata.c 171477 2007-07-17 20:58:26Z rrs $");
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>

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

1606 * Before we continue lets validate that we are not being fooled by
1607 * an evil attacker. We can only have 4k chunks based on our TSN
1608 * spread allowed by the mapping array 512 * 8 bits, so there is no
1609 * way our stream sequence numbers could have wrapped. We of course
1610 * only validate the FIRST fragment so the bit must be set.
1611 */
1612 strmseq = ntohs(ch->dp.stream_sequence);
1613#ifdef SCTP_ASOCLOG_OF_TSNS
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>

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

1606 * Before we continue lets validate that we are not being fooled by
1607 * an evil attacker. We can only have 4k chunks based on our TSN
1608 * spread allowed by the mapping array 512 * 8 bits, so there is no
1609 * way our stream sequence numbers could have wrapped. We of course
1610 * only validate the FIRST fragment so the bit must be set.
1611 */
1612 strmseq = ntohs(ch->dp.stream_sequence);
1613#ifdef SCTP_ASOCLOG_OF_TSNS
1614 SCTP_TCB_LOCK_ASSERT(stcb);
1615 if (asoc->tsn_in_at >= SCTP_TSN_LOG_SIZE) {
1616 asoc->tsn_in_at = 0;
1617 asoc->tsn_in_wrapped = 1;
1618 }
1614 asoc->in_tsnlog[asoc->tsn_in_at].tsn = tsn;
1615 asoc->in_tsnlog[asoc->tsn_in_at].strm = strmno;
1616 asoc->in_tsnlog[asoc->tsn_in_at].seq = strmseq;
1617 asoc->in_tsnlog[asoc->tsn_in_at].sz = chk_length;
1618 asoc->in_tsnlog[asoc->tsn_in_at].flgs = chunk_flags;
1619 asoc->in_tsnlog[asoc->tsn_in_at].tsn = tsn;
1620 asoc->in_tsnlog[asoc->tsn_in_at].strm = strmno;
1621 asoc->in_tsnlog[asoc->tsn_in_at].seq = strmseq;
1622 asoc->in_tsnlog[asoc->tsn_in_at].sz = chk_length;
1623 asoc->in_tsnlog[asoc->tsn_in_at].flgs = chunk_flags;
1624 asoc->in_tsnlog[asoc->tsn_in_at].stcb = (void *)stcb;
1625 asoc->in_tsnlog[asoc->tsn_in_at].in_pos = asoc->tsn_in_at;
1626 asoc->in_tsnlog[asoc->tsn_in_at].in_out = 1;
1619 asoc->tsn_in_at++;
1627 asoc->tsn_in_at++;
1620 if (asoc->tsn_in_at >= SCTP_TSN_LOG_SIZE) {
1621 asoc->tsn_in_at = 0;
1622 asoc->tsn_in_wrapped = 1;
1623 }
1624#endif
1625 if ((chunk_flags & SCTP_DATA_FIRST_FRAG) &&
1626 (TAILQ_EMPTY(&asoc->resetHead)) &&
1627 (chunk_flags & SCTP_DATA_UNORDERED) == 0 &&
1628 (compare_with_wrap(asoc->strmin[strmno].last_sequence_delivered,
1629 strmseq, MAX_SEQ) ||
1630 asoc->strmin[strmno].last_sequence_delivered == strmseq)) {
1631 /* The incoming sseq is behind where we last delivered? */

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

2993 /*
2994 * update RTO
2995 * too ? */
2996 if (tp1->do_rtt) {
2997 tp1->whoTo->RTO =
2998 sctp_calculate_rto(stcb,
2999 asoc,
3000 tp1->whoTo,
1628#endif
1629 if ((chunk_flags & SCTP_DATA_FIRST_FRAG) &&
1630 (TAILQ_EMPTY(&asoc->resetHead)) &&
1631 (chunk_flags & SCTP_DATA_UNORDERED) == 0 &&
1632 (compare_with_wrap(asoc->strmin[strmno].last_sequence_delivered,
1633 strmseq, MAX_SEQ) ||
1634 asoc->strmin[strmno].last_sequence_delivered == strmseq)) {
1635 /* The incoming sseq is behind where we last delivered? */

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

2997 /*
2998 * update RTO
2999 * too ? */
3000 if (tp1->do_rtt) {
3001 tp1->whoTo->RTO =
3002 sctp_calculate_rto(stcb,
3003 asoc,
3004 tp1->whoTo,
3001 &tp1->sent_rcv_time);
3005 &tp1->sent_rcv_time,
3006 sctp_align_safe_nocopy);
3002 tp1->do_rtt = 0;
3003 }
3004 }
3005 }
3006 if (tp1->sent <= SCTP_DATAGRAM_RESEND) {
3007 (*ecn_seg_sums) += tp1->rec.data.ect_nonce;
3008 (*ecn_seg_sums) &= SCTP_SACK_NONCE_SUM;
3009 if (compare_with_wrap(tp1->rec.data.TSN_seq,

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

3451 /*
3452 * CMT: Using RTX_SSTHRESH policy for CMT.
3453 * If CMT is being used, then pick dest with
3454 * largest ssthresh for any retransmission.
3455 */
3456 tp1->no_fr_allowed = 1;
3457 alt = tp1->whoTo;
3458 /* sa_ignore NO_NULL_CHK */
3007 tp1->do_rtt = 0;
3008 }
3009 }
3010 }
3011 if (tp1->sent <= SCTP_DATAGRAM_RESEND) {
3012 (*ecn_seg_sums) += tp1->rec.data.ect_nonce;
3013 (*ecn_seg_sums) &= SCTP_SACK_NONCE_SUM;
3014 if (compare_with_wrap(tp1->rec.data.TSN_seq,

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

3456 /*
3457 * CMT: Using RTX_SSTHRESH policy for CMT.
3458 * If CMT is being used, then pick dest with
3459 * largest ssthresh for any retransmission.
3460 */
3461 tp1->no_fr_allowed = 1;
3462 alt = tp1->whoTo;
3463 /* sa_ignore NO_NULL_CHK */
3459 if (sctp_cmt_pf) {
3464 if (sctp_cmt_on_off && sctp_cmt_pf) {
3460 /*
3461 * JRS 5/18/07 - If CMT PF is on,
3462 * use the PF version of
3463 * find_alt_net()
3464 */
3465 alt = sctp_find_alternate_net(stcb, alt, 2);
3466 } else {
3467 /*

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

3725 struct sctp_association *asoc,
3726 struct sctp_nets *net,
3727 struct sctp_tmit_chunk *tp1)
3728{
3729 struct sctp_tmit_chunk *chk;
3730
3731 /* First setup this one and get it moved back */
3732 tp1->sent = SCTP_DATAGRAM_UNSENT;
3465 /*
3466 * JRS 5/18/07 - If CMT PF is on,
3467 * use the PF version of
3468 * find_alt_net()
3469 */
3470 alt = sctp_find_alternate_net(stcb, alt, 2);
3471 } else {
3472 /*

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

3730 struct sctp_association *asoc,
3731 struct sctp_nets *net,
3732 struct sctp_tmit_chunk *tp1)
3733{
3734 struct sctp_tmit_chunk *chk;
3735
3736 /* First setup this one and get it moved back */
3737 tp1->sent = SCTP_DATAGRAM_UNSENT;
3733 tp1->window_probe = 0;
3734 if (sctp_logging_level & SCTP_FLIGHT_LOGGING_ENABLE) {
3735 sctp_misc_ints(SCTP_FLIGHT_LOG_DOWN_WP,
3736 tp1->whoTo->flight_size,
3737 tp1->book_size,
3738 (uintptr_t) tp1->whoTo,
3739 tp1->rec.data.TSN_seq);
3740 }
3741 sctp_flight_size_decrease(tp1);

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

3747 /*
3748 * Now all guys marked for RESEND on the sent_queue must be moved
3749 * back too.
3750 */
3751 TAILQ_FOREACH(chk, &asoc->sent_queue, sctp_next) {
3752 if (chk->sent == SCTP_DATAGRAM_RESEND) {
3753 /* Another chunk to move */
3754 chk->sent = SCTP_DATAGRAM_UNSENT;
3738 if (sctp_logging_level & SCTP_FLIGHT_LOGGING_ENABLE) {
3739 sctp_misc_ints(SCTP_FLIGHT_LOG_DOWN_WP,
3740 tp1->whoTo->flight_size,
3741 tp1->book_size,
3742 (uintptr_t) tp1->whoTo,
3743 tp1->rec.data.TSN_seq);
3744 }
3745 sctp_flight_size_decrease(tp1);

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

3751 /*
3752 * Now all guys marked for RESEND on the sent_queue must be moved
3753 * back too.
3754 */
3755 TAILQ_FOREACH(chk, &asoc->sent_queue, sctp_next) {
3756 if (chk->sent == SCTP_DATAGRAM_RESEND) {
3757 /* Another chunk to move */
3758 chk->sent = SCTP_DATAGRAM_UNSENT;
3755 chk->window_probe = 0;
3756 /* It should not be in flight */
3757 TAILQ_REMOVE(&asoc->sent_queue, chk, sctp_next);
3758 TAILQ_INSERT_AFTER(&asoc->send_queue, tp1, chk, sctp_next);
3759 asoc->sent_queue_cnt--;
3760 asoc->send_queue_cnt++;
3761 sctp_ucount_decr(asoc->sent_queue_retran_cnt);
3762 }
3763 }

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

3776 int j, done_once = 0;
3777
3778
3779 if (sctp_logging_level & SCTP_LOG_SACK_ARRIVALS_ENABLE) {
3780 sctp_misc_ints(SCTP_SACK_LOG_EXPRESS, cumack,
3781 rwnd, stcb->asoc.last_acked_seq, stcb->asoc.peers_rwnd);
3782 }
3783 SCTP_TCB_LOCK_ASSERT(stcb);
3759 /* It should not be in flight */
3760 TAILQ_REMOVE(&asoc->sent_queue, chk, sctp_next);
3761 TAILQ_INSERT_AFTER(&asoc->send_queue, tp1, chk, sctp_next);
3762 asoc->sent_queue_cnt--;
3763 asoc->send_queue_cnt++;
3764 sctp_ucount_decr(asoc->sent_queue_retran_cnt);
3765 }
3766 }

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

3779 int j, done_once = 0;
3780
3781
3782 if (sctp_logging_level & SCTP_LOG_SACK_ARRIVALS_ENABLE) {
3783 sctp_misc_ints(SCTP_SACK_LOG_EXPRESS, cumack,
3784 rwnd, stcb->asoc.last_acked_seq, stcb->asoc.peers_rwnd);
3785 }
3786 SCTP_TCB_LOCK_ASSERT(stcb);
3787#ifdef SCTP_ASOCLOG_OF_TSNS
3788 stcb->asoc.cumack_log[stcb->asoc.cumack_log_at] = cumack;
3789 stcb->asoc.cumack_log_at++;
3790 if (stcb->asoc.cumack_log_at > SCTP_TSN_LOG_SIZE) {
3791 stcb->asoc.cumack_log_at = 0;
3792 }
3793#endif
3784 asoc = &stcb->asoc;
3785 old_rwnd = asoc->peers_rwnd;
3786 if (compare_with_wrap(asoc->last_acked_seq, cumack, MAX_TSN)) {
3787 /* old ack */
3788 return;
3789 } else if (asoc->last_acked_seq == cumack) {
3790 /* Window update sack */
3791 asoc->peers_rwnd = sctp_sbspace_sub(rwnd,

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

3859 if (compare_with_wrap(cumack, asoc->last_acked_seq, MAX_TSN)) {
3860 /* process the new consecutive TSN first */
3861 tp1 = TAILQ_FIRST(&asoc->sent_queue);
3862 while (tp1) {
3863 tp2 = TAILQ_NEXT(tp1, sctp_next);
3864 if (compare_with_wrap(cumack, tp1->rec.data.TSN_seq,
3865 MAX_TSN) ||
3866 cumack == tp1->rec.data.TSN_seq) {
3794 asoc = &stcb->asoc;
3795 old_rwnd = asoc->peers_rwnd;
3796 if (compare_with_wrap(asoc->last_acked_seq, cumack, MAX_TSN)) {
3797 /* old ack */
3798 return;
3799 } else if (asoc->last_acked_seq == cumack) {
3800 /* Window update sack */
3801 asoc->peers_rwnd = sctp_sbspace_sub(rwnd,

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

3869 if (compare_with_wrap(cumack, asoc->last_acked_seq, MAX_TSN)) {
3870 /* process the new consecutive TSN first */
3871 tp1 = TAILQ_FIRST(&asoc->sent_queue);
3872 while (tp1) {
3873 tp2 = TAILQ_NEXT(tp1, sctp_next);
3874 if (compare_with_wrap(cumack, tp1->rec.data.TSN_seq,
3875 MAX_TSN) ||
3876 cumack == tp1->rec.data.TSN_seq) {
3867 if (tp1->sent != SCTP_DATAGRAM_UNSENT) {
3877 if (tp1->sent == SCTP_DATAGRAM_UNSENT) {
3878 printf("Warning, an unsent is now acked?\n");
3879 }
3880 /*
3881 * ECN Nonce: Add the nonce to the sender's
3882 * nonce sum
3883 */
3884 asoc->nonce_sum_expect_base += tp1->rec.data.ect_nonce;
3885 if (tp1->sent < SCTP_DATAGRAM_ACKED) {
3868 /*
3886 /*
3869 * ECN Nonce: Add the nonce to the
3870 * sender's nonce sum
3887 * If it is less than ACKED, it is
3888 * now no-longer in flight. Higher
3889 * values may occur during marking
3871 */
3890 */
3872 asoc->nonce_sum_expect_base += tp1->rec.data.ect_nonce;
3873 if (tp1->sent < SCTP_DATAGRAM_ACKED) {
3874 /*
3875 * If it is less than ACKED,
3876 * it is now no-longer in
3877 * flight. Higher values may
3878 * occur during marking
3879 */
3880 if (tp1->sent < SCTP_DATAGRAM_RESEND) {
3881 if (sctp_logging_level & SCTP_FLIGHT_LOGGING_ENABLE) {
3882 sctp_misc_ints(SCTP_FLIGHT_LOG_DOWN_CA,
3883 tp1->whoTo->flight_size,
3884 tp1->book_size,
3885 (uintptr_t) tp1->whoTo,
3886 tp1->rec.data.TSN_seq);
3887 }
3888 sctp_flight_size_decrease(tp1);
3889 sctp_total_flight_decrease(stcb, tp1);
3891 if (tp1->sent < SCTP_DATAGRAM_RESEND) {
3892 if (sctp_logging_level & SCTP_FLIGHT_LOGGING_ENABLE) {
3893 sctp_misc_ints(SCTP_FLIGHT_LOG_DOWN_CA,
3894 tp1->whoTo->flight_size,
3895 tp1->book_size,
3896 (uintptr_t) tp1->whoTo,
3897 tp1->rec.data.TSN_seq);
3890 }
3898 }
3891 tp1->whoTo->net_ack += tp1->send_size;
3892 if (tp1->snd_count < 2) {
3893 /*
3894 * True
3895 * non-retransmited
3896 * chunk
3897 */
3898 tp1->whoTo->net_ack2 +=
3899 tp1->send_size;
3900
3901 /* update RTO too? */
3902 if (tp1->do_rtt) {
3903 tp1->whoTo->RTO =
3904 sctp_calculate_rto(stcb,
3905 asoc, tp1->whoTo,
3906 &tp1->sent_rcv_time);
3907 tp1->do_rtt = 0;
3908 }
3909 }
3899 sctp_flight_size_decrease(tp1);
3900 sctp_total_flight_decrease(stcb, tp1);
3901 }
3902 tp1->whoTo->net_ack += tp1->send_size;
3903 if (tp1->snd_count < 2) {
3910 /*
3904 /*
3911 * CMT: CUCv2 algorithm.
3912 * From the cumack'd TSNs,
3913 * for each TSN being acked
3914 * for the first time, set
3915 * the following variables
3916 * for the corresp
3917 * destination.
3918 * new_pseudo_cumack will
3919 * trigger a cwnd update.
3920 * find_(rtx_)pseudo_cumack
3921 * will trigger search for
3922 * the next expected
3923 * (rtx-)pseudo-cumack.
3905 * True non-retransmited
3906 * chunk
3924 */
3907 */
3925 tp1->whoTo->new_pseudo_cumack = 1;
3926 tp1->whoTo->find_pseudo_cumack = 1;
3927 tp1->whoTo->find_rtx_pseudo_cumack = 1;
3908 tp1->whoTo->net_ack2 +=
3909 tp1->send_size;
3928
3910
3929 if (sctp_logging_level & SCTP_CWND_LOGGING_ENABLE) {
3930 sctp_log_cwnd(stcb, tp1->whoTo, tp1->rec.data.TSN_seq, SCTP_CWND_LOG_FROM_SACK);
3911 /* update RTO too? */
3912 if (tp1->do_rtt) {
3913 tp1->whoTo->RTO =
3914 sctp_calculate_rto(stcb,
3915 asoc, tp1->whoTo,
3916 &tp1->sent_rcv_time,
3917 sctp_align_safe_nocopy);
3918 tp1->do_rtt = 0;
3931 }
3932 }
3919 }
3920 }
3933 if (tp1->sent == SCTP_DATAGRAM_RESEND) {
3934 sctp_ucount_decr(asoc->sent_queue_retran_cnt);
3921 /*
3922 * CMT: CUCv2 algorithm. From the
3923 * cumack'd TSNs, for each TSN being
3924 * acked for the first time, set the
3925 * following variables for the
3926 * corresp destination.
3927 * new_pseudo_cumack will trigger a
3928 * cwnd update.
3929 * find_(rtx_)pseudo_cumack will
3930 * trigger search for the next
3931 * expected (rtx-)pseudo-cumack.
3932 */
3933 tp1->whoTo->new_pseudo_cumack = 1;
3934 tp1->whoTo->find_pseudo_cumack = 1;
3935 tp1->whoTo->find_rtx_pseudo_cumack = 1;
3936
3937 if (sctp_logging_level & SCTP_CWND_LOGGING_ENABLE) {
3938 sctp_log_cwnd(stcb, tp1->whoTo, tp1->rec.data.TSN_seq, SCTP_CWND_LOG_FROM_SACK);
3935 }
3939 }
3936 if (tp1->rec.data.chunk_was_revoked) {
3937 /* deflate the cwnd */
3938 tp1->whoTo->cwnd -= tp1->book_size;
3939 tp1->rec.data.chunk_was_revoked = 0;
3940 }
3941 tp1->sent = SCTP_DATAGRAM_ACKED;
3942 }
3940 }
3941 if (tp1->sent == SCTP_DATAGRAM_RESEND) {
3942 sctp_ucount_decr(asoc->sent_queue_retran_cnt);
3943 }
3944 if (tp1->rec.data.chunk_was_revoked) {
3945 /* deflate the cwnd */
3946 tp1->whoTo->cwnd -= tp1->book_size;
3947 tp1->rec.data.chunk_was_revoked = 0;
3948 }
3949 tp1->sent = SCTP_DATAGRAM_ACKED;
3950 TAILQ_REMOVE(&asoc->sent_queue, tp1, sctp_next);
3951 if (tp1->data) {
3952 sctp_free_bufspace(stcb, asoc, tp1, 1);
3953 sctp_m_freem(tp1->data);
3954 }
3955 if (sctp_logging_level & SCTP_SACK_LOGGING_ENABLE) {
3956 sctp_log_sack(asoc->last_acked_seq,
3957 cumack,
3958 tp1->rec.data.TSN_seq,
3959 0,
3960 0,
3961 SCTP_LOG_FREE_SENT);
3962 }
3963 tp1->data = NULL;
3964 asoc->sent_queue_cnt--;
3965 sctp_free_a_chunk(stcb, tp1);
3966 tp1 = tp2;
3943 } else {
3944 break;
3945 }
3967 } else {
3968 break;
3969 }
3946 TAILQ_REMOVE(&asoc->sent_queue, tp1, sctp_next);
3947 if (tp1->data) {
3948 sctp_free_bufspace(stcb, asoc, tp1, 1);
3949 sctp_m_freem(tp1->data);
3950 }
3951 if (sctp_logging_level & SCTP_SACK_LOGGING_ENABLE) {
3952 sctp_log_sack(asoc->last_acked_seq,
3953 cumack,
3954 tp1->rec.data.TSN_seq,
3955 0,
3956 0,
3957 SCTP_LOG_FREE_SENT);
3958 }
3959 tp1->data = NULL;
3960 asoc->sent_queue_cnt--;
3961 sctp_free_a_chunk(stcb, tp1);
3962 tp1 = tp2;
3963 }
3970 }
3971
3964 }
3965 if (stcb->sctp_socket) {
3966 SOCKBUF_LOCK(&stcb->sctp_socket->so_snd);
3967 if (sctp_logging_level & SCTP_WAKE_LOGGING_ENABLE) {
3968 sctp_wakeup_log(stcb, cumack, 1, SCTP_WAKESND_FROM_SACK);
3969 }
3970 sctp_sowwakeup_locked(stcb->sctp_ep, stcb->sctp_socket);
3971 } else {

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

4263 /* CMT DAC algo */
4264 this_sack_lowest_newack = 0;
4265 j = 0;
4266 sack_length = (unsigned int)sack_len;
4267 /* ECN Nonce */
4268 SCTP_STAT_INCR(sctps_slowpath_sack);
4269 nonce_sum_flag = ch->ch.chunk_flags & SCTP_SACK_NONCE_SUM;
4270 cum_ack = last_tsn = ntohl(sack->cum_tsn_ack);
3972 }
3973 if (stcb->sctp_socket) {
3974 SOCKBUF_LOCK(&stcb->sctp_socket->so_snd);
3975 if (sctp_logging_level & SCTP_WAKE_LOGGING_ENABLE) {
3976 sctp_wakeup_log(stcb, cumack, 1, SCTP_WAKESND_FROM_SACK);
3977 }
3978 sctp_sowwakeup_locked(stcb->sctp_ep, stcb->sctp_socket);
3979 } else {

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

4271 /* CMT DAC algo */
4272 this_sack_lowest_newack = 0;
4273 j = 0;
4274 sack_length = (unsigned int)sack_len;
4275 /* ECN Nonce */
4276 SCTP_STAT_INCR(sctps_slowpath_sack);
4277 nonce_sum_flag = ch->ch.chunk_flags & SCTP_SACK_NONCE_SUM;
4278 cum_ack = last_tsn = ntohl(sack->cum_tsn_ack);
4279#ifdef SCTP_ASOCLOG_OF_TSNS
4280 stcb->asoc.cumack_log[stcb->asoc.cumack_log_at] = cum_ack;
4281 stcb->asoc.cumack_log_at++;
4282 if (stcb->asoc.cumack_log_at > SCTP_TSN_LOG_SIZE) {
4283 stcb->asoc.cumack_log_at = 0;
4284 }
4285#endif
4271 num_seg = ntohs(sack->num_gap_ack_blks);
4272 a_rwnd = rwnd;
4273
4274 if (sctp_logging_level & SCTP_LOG_SACK_ARRIVALS_ENABLE) {
4275 sctp_misc_ints(SCTP_SACK_LOG_NORMAL, cum_ack,
4276 rwnd, stcb->asoc.last_acked_seq, stcb->asoc.peers_rwnd);
4277 }
4278 /* CMT DAC algo */

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

4486 tp1->whoTo->net_ack2 +=
4487 tp1->send_size;
4488
4489 /* update RTO too? */
4490 if (tp1->do_rtt) {
4491 tp1->whoTo->RTO =
4492 sctp_calculate_rto(stcb,
4493 asoc, tp1->whoTo,
4286 num_seg = ntohs(sack->num_gap_ack_blks);
4287 a_rwnd = rwnd;
4288
4289 if (sctp_logging_level & SCTP_LOG_SACK_ARRIVALS_ENABLE) {
4290 sctp_misc_ints(SCTP_SACK_LOG_NORMAL, cum_ack,
4291 rwnd, stcb->asoc.last_acked_seq, stcb->asoc.peers_rwnd);
4292 }
4293 /* CMT DAC algo */

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

4501 tp1->whoTo->net_ack2 +=
4502 tp1->send_size;
4503
4504 /* update RTO too? */
4505 if (tp1->do_rtt) {
4506 tp1->whoTo->RTO =
4507 sctp_calculate_rto(stcb,
4508 asoc, tp1->whoTo,
4494 &tp1->sent_rcv_time);
4509 &tp1->sent_rcv_time,
4510 sctp_align_safe_nocopy);
4495 tp1->do_rtt = 0;
4496 }
4497 }
4498 /*
4499 * CMT: CUCv2 algorithm. From the
4500 * cumack'd TSNs, for each TSN being
4501 * acked for the first time, set the
4502 * following variables for the

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

4621 goto done_with_it;
4622 do {
4623 if (compare_with_wrap(tp1->rec.data.TSN_seq, cum_ack,
4624 MAX_TSN)) {
4625 break;
4626 }
4627 if (tp1->sent == SCTP_DATAGRAM_UNSENT) {
4628 /* no more sent on list */
4511 tp1->do_rtt = 0;
4512 }
4513 }
4514 /*
4515 * CMT: CUCv2 algorithm. From the
4516 * cumack'd TSNs, for each TSN being
4517 * acked for the first time, set the
4518 * following variables for the

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

4637 goto done_with_it;
4638 do {
4639 if (compare_with_wrap(tp1->rec.data.TSN_seq, cum_ack,
4640 MAX_TSN)) {
4641 break;
4642 }
4643 if (tp1->sent == SCTP_DATAGRAM_UNSENT) {
4644 /* no more sent on list */
4629 break;
4645 printf("Warning, tp1->sent == %d and its now acked?\n",
4646 tp1->sent);
4630 }
4631 tp2 = TAILQ_NEXT(tp1, sctp_next);
4632 TAILQ_REMOVE(&asoc->sent_queue, tp1, sctp_next);
4647 }
4648 tp2 = TAILQ_NEXT(tp1, sctp_next);
4649 TAILQ_REMOVE(&asoc->sent_queue, tp1, sctp_next);
4633 /*
4634 * Friendlier printf in lieu of panic now that I think its
4635 * fixed
4636 */
4637
4638 if (tp1->pr_sctp_on) {
4639 if (asoc->pr_sctp_cnt != 0)
4640 asoc->pr_sctp_cnt--;
4641 }
4642 if ((TAILQ_FIRST(&asoc->sent_queue) == NULL) &&
4643 (asoc->total_flight > 0)) {
4644#ifdef INVARIANTS
4645 panic("Warning flight size is postive and should be 0");

--- 833 unchanged lines hidden ---
4650 if (tp1->pr_sctp_on) {
4651 if (asoc->pr_sctp_cnt != 0)
4652 asoc->pr_sctp_cnt--;
4653 }
4654 if ((TAILQ_FIRST(&asoc->sent_queue) == NULL) &&
4655 (asoc->total_flight > 0)) {
4656#ifdef INVARIANTS
4657 panic("Warning flight size is postive and should be 0");

--- 833 unchanged lines hidden ---