svn commit: r280714 - head/sys/netinet

Michael Tuexen tuexen at FreeBSD.org
Thu Mar 26 22:05:33 UTC 2015


Author: tuexen
Date: Thu Mar 26 22:05:31 2015
New Revision: 280714
URL: https://svnweb.freebsd.org/changeset/base/280714

Log:
  Improve the selection of the destination address of SACK chunks.
  This fixes
  https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196755
  and is joint work with rrs at .
  
  MFC after: 1 week

Modified:
  head/sys/netinet/sctp_output.c
  head/sys/netinet/sctp_structs.h

Modified: head/sys/netinet/sctp_output.c
==============================================================================
--- head/sys/netinet/sctp_output.c	Thu Mar 26 21:58:06 2015	(r280713)
+++ head/sys/netinet/sctp_output.c	Thu Mar 26 22:05:31 2015	(r280714)
@@ -10409,32 +10409,17 @@ sctp_send_sack(struct sctp_tcb *stcb, in
 	a_chk->sent = SCTP_DATAGRAM_UNSENT;
 	a_chk->whoTo = NULL;
 
-	if ((asoc->numduptsns) ||
-	    (!(asoc->last_data_chunk_from->dest_state & SCTP_ADDR_REACHABLE))) {
+	if (!(asoc->last_data_chunk_from->dest_state & SCTP_ADDR_REACHABLE)) {
 		/*-
-		 * Ok, we have some duplicates or the destination for the
-		 * sack is unreachable, lets see if we can select an
-		 * alternate than asoc->last_data_chunk_from
+		 * Ok, the destination for the SACK is unreachable, lets see if
+		 * we can select an alternate to asoc->last_data_chunk_from
 		 */
-		if ((asoc->last_data_chunk_from->dest_state & SCTP_ADDR_REACHABLE) &&
-		    (asoc->used_alt_onsack > asoc->numnets)) {
-			/* We used an alt last time, don't this time */
-			a_chk->whoTo = NULL;
-		} else {
-			asoc->used_alt_onsack++;
-			a_chk->whoTo = sctp_find_alternate_net(stcb, asoc->last_data_chunk_from, 0);
-		}
+		a_chk->whoTo = sctp_find_alternate_net(stcb, asoc->last_data_chunk_from, 0);
 		if (a_chk->whoTo == NULL) {
 			/* Nope, no alternate */
 			a_chk->whoTo = asoc->last_data_chunk_from;
-			asoc->used_alt_onsack = 0;
 		}
 	} else {
-		/*
-		 * No duplicates so we use the last place we received data
-		 * from.
-		 */
-		asoc->used_alt_onsack = 0;
 		a_chk->whoTo = asoc->last_data_chunk_from;
 	}
 	if (a_chk->whoTo) {

Modified: head/sys/netinet/sctp_structs.h
==============================================================================
--- head/sys/netinet/sctp_structs.h	Thu Mar 26 21:58:06 2015	(r280713)
+++ head/sys/netinet/sctp_structs.h	Thu Mar 26 22:05:31 2015	(r280714)
@@ -1174,7 +1174,6 @@ struct sctp_association {
 
 	struct sctp_scoping scope;
 	/* flags to handle send alternate net tracking */
-	uint8_t used_alt_onsack;
 	uint8_t used_alt_asconfack;
 	uint8_t fast_retran_loss_recovery;
 	uint8_t sat_t3_loss_recovery;


More information about the svn-src-all mailing list