Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Dec 2016 17:58:07 +0000 (UTC)
From:      Michael Tuexen <tuexen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r309744 - head/sys/netinet
Message-ID:  <201612091758.uB9Hw7lK087325@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tuexen
Date: Fri Dec  9 17:58:07 2016
New Revision: 309744
URL: https://svnweb.freebsd.org/changeset/base/309744

Log:
  Don't bundle a SACK chunk with a SHUTDOWN chunk if it is not required.
  
  MFC after:	1 week

Modified:
  head/sys/netinet/sctp_indata.c

Modified: head/sys/netinet/sctp_indata.c
==============================================================================
--- head/sys/netinet/sctp_indata.c	Fri Dec  9 17:57:17 2016	(r309743)
+++ head/sys/netinet/sctp_indata.c	Fri Dec  9 17:58:07 2016	(r309744)
@@ -2437,13 +2437,17 @@ sctp_sack_check(struct sctp_tcb *stcb, i
 {
 	struct sctp_association *asoc;
 	uint32_t highest_tsn;
+	int is_a_gap;
 
+	sctp_slide_mapping_arrays(stcb);
 	asoc = &stcb->asoc;
 	if (SCTP_TSN_GT(asoc->highest_tsn_inside_nr_map, asoc->highest_tsn_inside_map)) {
 		highest_tsn = asoc->highest_tsn_inside_nr_map;
 	} else {
 		highest_tsn = asoc->highest_tsn_inside_map;
 	}
+	/* Is there a gap now? */
+	is_a_gap = SCTP_TSN_GT(highest_tsn, stcb->asoc.cumulative_tsn);
 
 	/*
 	 * Now we need to see if we need to queue a sack or just start the
@@ -2462,13 +2466,10 @@ sctp_sack_check(struct sctp_tcb *stcb, i
 		}
 		sctp_send_shutdown(stcb,
 		    ((stcb->asoc.alternate) ? stcb->asoc.alternate : stcb->asoc.primary_destination));
-		sctp_send_sack(stcb, SCTP_SO_NOT_LOCKED);
+		if (is_a_gap) {
+			sctp_send_sack(stcb, SCTP_SO_NOT_LOCKED);
+		}
 	} else {
-		int is_a_gap;
-
-		/* is there a gap now ? */
-		is_a_gap = SCTP_TSN_GT(highest_tsn, stcb->asoc.cumulative_tsn);
-
 		/*
 		 * CMT DAC algorithm: increase number of packets received
 		 * since last ack



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