From 544e35bd976d33a1d95df0809d05b2f552e592ca Mon Sep 17 00:00:00 2001 From: Randall Stewart Date: Tue, 14 Apr 2009 07:50:29 +0000 Subject: [PATCH] Move the flight size reduction to right after we recognize its a retransmit, ahead of the PR-SCTP work. Without this fix, we end up NOT reducing flight size and causing an miscalculation when PR-SCTP is active and data is skipped. Obtained from: Michael Tuexen. --- sys/netinet/sctp_indata.c | 44 +++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/sys/netinet/sctp_indata.c b/sys/netinet/sctp_indata.c index 98dc28ea2121..8c9292864cc2 100644 --- a/sys/netinet/sctp_indata.c +++ b/sys/netinet/sctp_indata.c @@ -3833,9 +3833,30 @@ sctp_strike_gap_ack_chunks(struct sctp_tcb *stcb, struct sctp_association *asoc, } } if (tp1->sent == SCTP_DATAGRAM_RESEND) { - /* Increment the count to resend */ struct sctp_nets *alt; + /* fix counts and things */ + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FLIGHT_LOGGING_ENABLE) { + sctp_misc_ints(SCTP_FLIGHT_LOG_DOWN_RSND, + (tp1->whoTo ? (tp1->whoTo->flight_size) : 0), + tp1->book_size, + (uintptr_t) tp1->whoTo, + tp1->rec.data.TSN_seq); + } + if (tp1->whoTo) { + tp1->whoTo->net_ack++; + sctp_flight_size_decrease(tp1); + } + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOG_RWND_ENABLE) { + sctp_log_rwnd(SCTP_INCREASE_PEER_RWND, + asoc->peers_rwnd, tp1->send_size, SCTP_BASE_SYSCTL(sctp_peer_chunk_oh)); + } + /* add back to the rwnd */ + asoc->peers_rwnd += (tp1->send_size + SCTP_BASE_SYSCTL(sctp_peer_chunk_oh)); + + /* remove from the total flight */ + sctp_total_flight_decrease(stcb, tp1); + if ((stcb->asoc.peer_supports_prsctp) && (PR_SCTP_RTX_ENABLED(tp1->flags))) { /* @@ -3957,27 +3978,6 @@ sctp_strike_gap_ack_chunks(struct sctp_tcb *stcb, struct sctp_association *asoc, */ tp1->do_rtt = 0; } - /* fix counts and things */ - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FLIGHT_LOGGING_ENABLE) { - sctp_misc_ints(SCTP_FLIGHT_LOG_DOWN_RSND, - (tp1->whoTo ? (tp1->whoTo->flight_size) : 0), - tp1->book_size, - (uintptr_t) tp1->whoTo, - tp1->rec.data.TSN_seq); - } - if (tp1->whoTo) { - tp1->whoTo->net_ack++; - sctp_flight_size_decrease(tp1); - } - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOG_RWND_ENABLE) { - sctp_log_rwnd(SCTP_INCREASE_PEER_RWND, - asoc->peers_rwnd, tp1->send_size, SCTP_BASE_SYSCTL(sctp_peer_chunk_oh)); - } - /* add back to the rwnd */ - asoc->peers_rwnd += (tp1->send_size + SCTP_BASE_SYSCTL(sctp_peer_chunk_oh)); - - /* remove from the total flight */ - sctp_total_flight_decrease(stcb, tp1); if (alt != tp1->whoTo) { /* yes, there is an alternate. */ sctp_free_remote_addr(tp1->whoTo);