aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorChang Xiangzhong <changxiangzhong@gmail.com>2013-11-13 18:58:26 -0500
committerDavid S. Miller <davem@davemloft.net>2013-11-14 16:35:09 -0500
commitd30a58ba2ef5092f10985d357d22acab232b6dcc (patch)
treed77f00f64662b1c41bceda5083c123b55650e11e /net
parentdccf76ca6b626c0c4a4e09bb221adee3270ab0ef (diff)
net: sctp: bug-fixing: retran_path not set properly after transports recovering (v3)
When a transport recovers due to the new coming sack, SCTP should iterate all of its transport_list to locate the __two__ most recently used transport and set to active_path and retran_path respectively. The exising code does not find the two properly - In case of the following list: [most-recent] -> [2nd-most-recent] -> ... Both active_path and retran_path would be set to the 1st element. The bug happens when: 1) multi-homing 2) failure/partial_failure transport recovers Both active_path and retran_path would be set to the same most-recent one, in other words, retran_path would not take its role - an end user might not even notice this issue. Signed-off-by: Chang Xiangzhong <changxiangzhong@gmail.com> Acked-by: Vlad Yasevich <vyasevich@gmail.com> Acked-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/sctp/associola.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/sctp/associola.c b/net/sctp/associola.c
index c9b91cb1cb0d..68a27f9796d2 100644
--- a/net/sctp/associola.c
+++ b/net/sctp/associola.c
@@ -907,8 +907,8 @@ void sctp_assoc_control_transport(struct sctp_association *asoc,
907 if (!first || t->last_time_heard > first->last_time_heard) { 907 if (!first || t->last_time_heard > first->last_time_heard) {
908 second = first; 908 second = first;
909 first = t; 909 first = t;
910 } 910 } else if (!second ||
911 if (!second || t->last_time_heard > second->last_time_heard) 911 t->last_time_heard > second->last_time_heard)
912 second = t; 912 second = t;
913 } 913 }
914 914
@@ -929,6 +929,8 @@ void sctp_assoc_control_transport(struct sctp_association *asoc,
929 first = asoc->peer.primary_path; 929 first = asoc->peer.primary_path;
930 } 930 }
931 931
932 if (!second)
933 second = first;
932 /* If we failed to find a usable transport, just camp on the 934 /* If we failed to find a usable transport, just camp on the
933 * primary, even if it is inactive. 935 * primary, even if it is inactive.
934 */ 936 */