diff options
-rw-r--r-- | net/sctp/outqueue.c | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c index ef5ea7423cc8..c8de4da57f36 100644 --- a/net/sctp/outqueue.c +++ b/net/sctp/outqueue.c | |||
@@ -1145,27 +1145,31 @@ int sctp_outq_sack(struct sctp_outq *q, struct sctp_sackhdr *sack) | |||
1145 | * on the current primary, the CHANGEOVER_ACTIVE flag SHOULD be | 1145 | * on the current primary, the CHANGEOVER_ACTIVE flag SHOULD be |
1146 | * cleared. The CYCLING_CHANGEOVER flag SHOULD also be cleared for | 1146 | * cleared. The CYCLING_CHANGEOVER flag SHOULD also be cleared for |
1147 | * all destinations. | 1147 | * all destinations. |
1148 | */ | ||
1149 | if (TSN_lte(primary->cacc.next_tsn_at_change, sack_ctsn)) { | ||
1150 | primary->cacc.changeover_active = 0; | ||
1151 | list_for_each_entry(transport, transport_list, | ||
1152 | transports) { | ||
1153 | transport->cacc.cycling_changeover = 0; | ||
1154 | } | ||
1155 | } | ||
1156 | |||
1157 | /* | ||
1158 | * SFR-CACC algorithm: | ||
1159 | * 2) If the SACK contains gap acks and the flag CHANGEOVER_ACTIVE | 1148 | * 2) If the SACK contains gap acks and the flag CHANGEOVER_ACTIVE |
1160 | * is set the receiver of the SACK MUST take the following actions: | 1149 | * is set the receiver of the SACK MUST take the following actions: |
1161 | * | 1150 | * |
1162 | * A) Initialize the cacc_saw_newack to 0 for all destination | 1151 | * A) Initialize the cacc_saw_newack to 0 for all destination |
1163 | * addresses. | 1152 | * addresses. |
1153 | * | ||
1154 | * Only bother if changeover_active is set. Otherwise, this is | ||
1155 | * totally suboptimal to do on every SACK. | ||
1164 | */ | 1156 | */ |
1165 | if (gap_ack_blocks && | 1157 | if (primary->cacc.changeover_active) { |
1166 | primary->cacc.changeover_active) { | 1158 | u8 clear_cycling = 0; |
1167 | list_for_each_entry(transport, transport_list, transports) { | 1159 | |
1168 | transport->cacc.cacc_saw_newack = 0; | 1160 | if (TSN_lte(primary->cacc.next_tsn_at_change, sack_ctsn)) { |
1161 | primary->cacc.changeover_active = 0; | ||
1162 | clear_cycling = 1; | ||
1163 | } | ||
1164 | |||
1165 | if (clear_cycling || gap_ack_blocks) { | ||
1166 | list_for_each_entry(transport, transport_list, | ||
1167 | transports) { | ||
1168 | if (clear_cycling) | ||
1169 | transport->cacc.cycling_changeover = 0; | ||
1170 | if (gap_ack_blocks) | ||
1171 | transport->cacc.cacc_saw_newack = 0; | ||
1172 | } | ||
1169 | } | 1173 | } |
1170 | } | 1174 | } |
1171 | 1175 | ||