From f695020b186a8c60293e8fa88f1f054c1c6d27bf Mon Sep 17 00:00:00 2001 From: Gui Jianfeng Date: Wed, 4 Jun 2008 12:37:33 -0700 Subject: [PATCH] --- yaml --- r: 97671 b: refs/heads/master c: 4141ddc02a92a6e3e5793601554c6033e83c25b9 h: refs/heads/master i: 97669: ec772e2e99fa71a8b0fe06003a80af650a416ae1 97667: 5be8da73aeacc239d8305c0d03d3ccb682b7627f 97663: 1c219ddfeefcf5ab3667da354a130aa84329808e v: v3 --- [refs] | 2 +- trunk/net/sctp/associola.c | 21 ++++++++++++--------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/[refs] b/[refs] index e0375092bb17..28c17ccf2c45 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: aed5a833fb18123d7cfc6ce3810ab97efd4869b3 +refs/heads/master: 4141ddc02a92a6e3e5793601554c6033e83c25b9 diff --git a/trunk/net/sctp/associola.c b/trunk/net/sctp/associola.c index b4cd2b71953f..532634861db1 100644 --- a/trunk/net/sctp/associola.c +++ b/trunk/net/sctp/associola.c @@ -1203,6 +1203,9 @@ void sctp_assoc_update_retran_path(struct sctp_association *asoc) struct list_head *head = &asoc->peer.transport_addr_list; struct list_head *pos; + if (asoc->peer.transport_count == 1) + return; + /* Find the next transport in a round-robin fashion. */ t = asoc->peer.retran_path; pos = &t->transports; @@ -1217,6 +1220,15 @@ void sctp_assoc_update_retran_path(struct sctp_association *asoc) t = list_entry(pos, struct sctp_transport, transports); + /* We have exhausted the list, but didn't find any + * other active transports. If so, use the next + * transport. + */ + if (t == asoc->peer.retran_path) { + t = next; + break; + } + /* Try to find an active transport. */ if ((t->state == SCTP_ACTIVE) || @@ -1229,15 +1241,6 @@ void sctp_assoc_update_retran_path(struct sctp_association *asoc) if (!next) next = t; } - - /* We have exhausted the list, but didn't find any - * other active transports. If so, use the next - * transport. - */ - if (t == asoc->peer.retran_path) { - t = next; - break; - } } asoc->peer.retran_path = t;