瀏覽代碼

sctp: correctly mark missing chunks in fast recovery

According to RFC 4960 Section 7.2.4:
 					If an endpoint is in Fast
   Recovery and a SACK arrives that advances the Cumulative TSN Ack
   Point, the miss indications are incremented for all TSNs reported
   missing in the SACK.

Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Vlad Yasevich 15 年之前
父節點
當前提交
ea862c8d1f
共有 1 個文件被更改,包括 13 次插入5 次删除
  1. 13 5
      net/sctp/outqueue.c

+ 13 - 5
net/sctp/outqueue.c

@@ -1154,6 +1154,7 @@ int sctp_outq_sack(struct sctp_outq *q, struct sctp_sackhdr *sack)
 	struct sctp_transport *primary = asoc->peer.primary_path;
 	struct sctp_transport *primary = asoc->peer.primary_path;
 	int count_of_newacks = 0;
 	int count_of_newacks = 0;
 	int gap_ack_blocks;
 	int gap_ack_blocks;
+	u8 accum_moved = 0;
 
 
 	/* Grab the association's destination address list. */
 	/* Grab the association's destination address list. */
 	transport_list = &asoc->peer.transport_addr_list;
 	transport_list = &asoc->peer.transport_addr_list;
@@ -1232,16 +1233,22 @@ int sctp_outq_sack(struct sctp_outq *q, struct sctp_sackhdr *sack)
 			count_of_newacks ++;
 			count_of_newacks ++;
 	}
 	}
 
 
+	/* Move the Cumulative TSN Ack Point if appropriate.  */
+	if (TSN_lt(asoc->ctsn_ack_point, sack_ctsn)) {
+		asoc->ctsn_ack_point = sack_ctsn;
+		accum_moved = 1;
+	}
+
 	if (gap_ack_blocks) {
 	if (gap_ack_blocks) {
+
+		if (asoc->fast_recovery && accum_moved)
+			highest_new_tsn = highest_tsn;
+
 		list_for_each_entry(transport, transport_list, transports)
 		list_for_each_entry(transport, transport_list, transports)
 			sctp_mark_missing(q, &transport->transmitted, transport,
 			sctp_mark_missing(q, &transport->transmitted, transport,
 					  highest_new_tsn, count_of_newacks);
 					  highest_new_tsn, count_of_newacks);
 	}
 	}
 
 
-	/* Move the Cumulative TSN Ack Point if appropriate.  */
-	if (TSN_lt(asoc->ctsn_ack_point, sack_ctsn))
-		asoc->ctsn_ack_point = sack_ctsn;
-
 	/* Update unack_data field in the assoc. */
 	/* Update unack_data field in the assoc. */
 	sctp_sack_update_unack_data(asoc, sack);
 	sctp_sack_update_unack_data(asoc, sack);
 
 
@@ -1685,7 +1692,8 @@ static void sctp_mark_missing(struct sctp_outq *q,
 	struct sctp_chunk *chunk;
 	struct sctp_chunk *chunk;
 	__u32 tsn;
 	__u32 tsn;
 	char do_fast_retransmit = 0;
 	char do_fast_retransmit = 0;
-	struct sctp_transport *primary = q->asoc->peer.primary_path;
+	struct sctp_association *asoc = q->asoc;
+	struct sctp_transport *primary = asoc->peer.primary_path;
 
 
 	list_for_each_entry(chunk, transmitted_queue, transmitted_list) {
 	list_for_each_entry(chunk, transmitted_queue, transmitted_list) {