Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Jul 2010 09:20:55 +0000 (UTC)
From:      Randall Stewart <rrs@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r210493 - head/sys/netinet
Message-ID:  <201007260920.o6Q9KtAx022875@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rrs
Date: Mon Jul 26 09:20:55 2010
New Revision: 210493
URL: http://svn.freebsd.org/changeset/base/210493

Log:
  When counting the number of chunks in the
  retransmission queue to validate the retran count, we
  need to include the chunks in the control send queue
  too. Otherwise the count will not match and you will get
  the invarient warning if invarients are on.
  
  MFC after:	2 weeks

Modified:
  head/sys/netinet/sctp_timer.c

Modified: head/sys/netinet/sctp_timer.c
==============================================================================
--- head/sys/netinet/sctp_timer.c	Mon Jul 26 02:05:36 2010	(r210492)
+++ head/sys/netinet/sctp_timer.c	Mon Jul 26 09:20:55 2010	(r210493)
@@ -870,6 +870,26 @@ start_again:
 	}
 #endif
 	*num_marked = num_mk;
+	/*
+	 * Now check for a ECN Echo that may be stranded And include the
+	 * cnt_mk'd to have all resends in the control queue.
+	 */
+	TAILQ_FOREACH(chk, &stcb->asoc.control_send_queue, sctp_next) {
+		if (chk->sent == SCTP_DATAGRAM_RESEND) {
+			cnt_mk++;
+		}
+		if ((chk->whoTo == net) &&
+		    (chk->rec.chunk_id.id == SCTP_ECN_ECHO)) {
+			sctp_free_remote_addr(chk->whoTo);
+			chk->whoTo = alt;
+			if (chk->sent != SCTP_DATAGRAM_RESEND) {
+				chk->sent = SCTP_DATAGRAM_RESEND;
+				sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt);
+				cnt_mk++;
+			}
+			atomic_add_int(&alt->ref_count, 1);
+		}
+	}
 	if ((stcb->asoc.sent_queue_retran_cnt == 0) && (could_be_sent)) {
 		/* fix it so we retransmit the highest acked anyway */
 		sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt);
@@ -885,19 +905,6 @@ start_again:
 		stcb->asoc.sent_queue_retran_cnt = cnt_mk;
 #endif
 	}
-	/* Now check for a ECN Echo that may be stranded */
-	TAILQ_FOREACH(chk, &stcb->asoc.control_send_queue, sctp_next) {
-		if ((chk->whoTo == net) &&
-		    (chk->rec.chunk_id.id == SCTP_ECN_ECHO)) {
-			sctp_free_remote_addr(chk->whoTo);
-			chk->whoTo = alt;
-			if (chk->sent != SCTP_DATAGRAM_RESEND) {
-				chk->sent = SCTP_DATAGRAM_RESEND;
-				sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt);
-			}
-			atomic_add_int(&alt->ref_count, 1);
-		}
-	}
 	if (audit_tf) {
 		SCTPDBG(SCTP_DEBUG_TIMER4,
 		    "Audit total flight due to negative value net:%p\n",



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201007260920.o6Q9KtAx022875>