diff options
author | tuexen <tuexen@FreeBSD.org> | 2010-04-23 08:19:47 +0000 |
---|---|---|
committer | tuexen <tuexen@FreeBSD.org> | 2010-04-23 08:19:47 +0000 |
commit | 312805d71c96331a79af508c70e925b2eae8391f (patch) | |
tree | ebb52b4f90566ae17b214f34461eae41e1646314 /sys/netinet/sctp_indata.c | |
parent | 554a37655021e1b081ecac42b9ea477a79c115ea (diff) | |
download | FreeBSD-src-312805d71c96331a79af508c70e925b2eae8391f.zip FreeBSD-src-312805d71c96331a79af508c70e925b2eae8391f.tar.gz |
* Fix compilation when using SCTP_AUDITING_ENABLED.
* Fix delaying of SACK by taking out old optimization code
which does not optimize anymore.
* Fix fast retransmission of chunks abandoned by the
"number of retransmissions" policy.
MFC after: 3 days.
Diffstat (limited to 'sys/netinet/sctp_indata.c')
-rw-r--r-- | sys/netinet/sctp_indata.c | 58 |
1 files changed, 20 insertions, 38 deletions
diff --git a/sys/netinet/sctp_indata.c b/sys/netinet/sctp_indata.c index c1430a5..4b00fc3 100644 --- a/sys/netinet/sctp_indata.c +++ b/sys/netinet/sctp_indata.c @@ -2823,25 +2823,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *offset, int length, stcb->asoc.send_sack = 1; } /* Start a sack timer or QUEUE a SACK for sending */ - if ((stcb->asoc.cumulative_tsn == stcb->asoc.highest_tsn_inside_nr_map) && - (stcb->asoc.nr_mapping_array[0] != 0xff)) { - if ((stcb->asoc.data_pkts_seen >= stcb->asoc.sack_freq) || - (stcb->asoc.delayed_ack == 0) || - (stcb->asoc.numduptsns) || - (stcb->asoc.send_sack == 1)) { - if (SCTP_OS_TIMER_PENDING(&stcb->asoc.dack_timer.timer)) { - (void)SCTP_OS_TIMER_STOP(&stcb->asoc.dack_timer.timer); - } - sctp_send_sack(stcb); - } else { - if (!SCTP_OS_TIMER_PENDING(&stcb->asoc.dack_timer.timer)) { - sctp_timer_start(SCTP_TIMER_TYPE_RECV, - stcb->sctp_ep, stcb, NULL); - } - } - } else { - sctp_sack_check(stcb, was_a_gap, &abort_flag); - } + sctp_sack_check(stcb, was_a_gap, &abort_flag); if (abort_flag) return (2); @@ -3532,6 +3514,25 @@ sctp_strike_gap_ack_chunks(struct sctp_tcb *stcb, struct sctp_association *asoc, if (tp1->sent == SCTP_DATAGRAM_RESEND) { struct sctp_nets *alt; + if ((stcb->asoc.peer_supports_prsctp) && + (PR_SCTP_RTX_ENABLED(tp1->flags))) { + /* + * Has it been retransmitted tv_sec times? - + * we store the retran count there. + */ + if (tp1->snd_count > tp1->rec.data.timetodrop.tv_sec) { + /* Yes, so drop it */ + if (tp1->data != NULL) { + (void)sctp_release_pr_sctp_chunk(stcb, tp1, + (SCTP_RESPONSE_TO_USER_REQ | SCTP_NOTIFY_DATAGRAM_SENT), + SCTP_SO_NOT_LOCKED); + } + /* Make sure to flag we had a FR */ + tp1->whoTo->net_ack++; + tp1 = TAILQ_NEXT(tp1, sctp_next); + continue; + } + } /* fix counts and things */ if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FLIGHT_LOGGING_ENABLE) { sctp_misc_ints(SCTP_FLIGHT_LOG_DOWN_RSND, @@ -3554,25 +3555,6 @@ sctp_strike_gap_ack_chunks(struct sctp_tcb *stcb, struct sctp_association *asoc, /* remove from the total flight */ sctp_total_flight_decrease(stcb, tp1); - if ((stcb->asoc.peer_supports_prsctp) && - (PR_SCTP_RTX_ENABLED(tp1->flags))) { - /* - * Has it been retransmitted tv_sec times? - - * we store the retran count there. - */ - if (tp1->snd_count > tp1->rec.data.timetodrop.tv_sec) { - /* Yes, so drop it */ - if (tp1->data != NULL) { - (void)sctp_release_pr_sctp_chunk(stcb, tp1, - (SCTP_RESPONSE_TO_USER_REQ | SCTP_NOTIFY_DATAGRAM_SENT), - SCTP_SO_NOT_LOCKED); - } - /* Make sure to flag we had a FR */ - tp1->whoTo->net_ack++; - tp1 = TAILQ_NEXT(tp1, sctp_next); - continue; - } - } /* printf("OK, we are now ready to FR this guy\n"); */ if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FR_LOGGING_ENABLE) { sctp_log_fr(tp1->rec.data.TSN_seq, tp1->snd_count, |