Author: rrs
Date: Tue Apr 14 07:50:29 2009
New Revision: 191049
URL: http://svn.freebsd.org/changeset/base/191049

Log:
  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.

Modified:
  head/sys/netinet/sctp_indata.c

Modified: head/sys/netinet/sctp_indata.c
==============================================================================
--- head/sys/netinet/sctp_indata.c      Tue Apr 14 06:35:37 2009        
(r191048)
+++ head/sys/netinet/sctp_indata.c      Tue Apr 14 07:50:29 2009        
(r191049)
@@ -3833,9 +3833,30 @@ sctp_strike_gap_ack_chunks(struct sctp_t
                        }
                }
                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_t
                                 */
                                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);
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to