aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/associola.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sctp/associola.c')
-rw-r--r--net/sctp/associola.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/net/sctp/associola.c b/net/sctp/associola.c
index 7b79d1e781a8..d5cc731b6798 100644
--- a/net/sctp/associola.c
+++ b/net/sctp/associola.c
@@ -1206,6 +1206,9 @@ void sctp_assoc_update_retran_path(struct sctp_association *asoc)
1206 struct list_head *head = &asoc->peer.transport_addr_list; 1206 struct list_head *head = &asoc->peer.transport_addr_list;
1207 struct list_head *pos; 1207 struct list_head *pos;
1208 1208
1209 if (asoc->peer.transport_count == 1)
1210 return;
1211
1209 /* Find the next transport in a round-robin fashion. */ 1212 /* Find the next transport in a round-robin fashion. */
1210 t = asoc->peer.retran_path; 1213 t = asoc->peer.retran_path;
1211 pos = &t->transports; 1214 pos = &t->transports;
@@ -1220,6 +1223,15 @@ void sctp_assoc_update_retran_path(struct sctp_association *asoc)
1220 1223
1221 t = list_entry(pos, struct sctp_transport, transports); 1224 t = list_entry(pos, struct sctp_transport, transports);
1222 1225
1226 /* We have exhausted the list, but didn't find any
1227 * other active transports. If so, use the next
1228 * transport.
1229 */
1230 if (t == asoc->peer.retran_path) {
1231 t = next;
1232 break;
1233 }
1234
1223 /* Try to find an active transport. */ 1235 /* Try to find an active transport. */
1224 1236
1225 if ((t->state == SCTP_ACTIVE) || 1237 if ((t->state == SCTP_ACTIVE) ||
@@ -1232,15 +1244,6 @@ void sctp_assoc_update_retran_path(struct sctp_association *asoc)
1232 if (!next) 1244 if (!next)
1233 next = t; 1245 next = t;
1234 } 1246 }
1235
1236 /* We have exhausted the list, but didn't find any
1237 * other active transports. If so, use the next
1238 * transport.
1239 */
1240 if (t == asoc->peer.retran_path) {
1241 t = next;
1242 break;
1243 }
1244 } 1247 }
1245 1248
1246 asoc->peer.retran_path = t; 1249 asoc->peer.retran_path = t;