Skip to content

Commit

Permalink
net: sctp: bug-fixing: retran_path not set properly after transports …
Browse files Browse the repository at this point in the history
…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>
  • Loading branch information
Chang Xiangzhong authored and David S. Miller committed Nov 14, 2013
1 parent dccf76c commit d30a58b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions net/sctp/associola.c
Original file line number Diff line number Diff line change
Expand Up @@ -907,8 +907,8 @@ void sctp_assoc_control_transport(struct sctp_association *asoc,
if (!first || t->last_time_heard > first->last_time_heard) {
second = first;
first = t;
}
if (!second || t->last_time_heard > second->last_time_heard)
} else if (!second ||
t->last_time_heard > second->last_time_heard)
second = t;
}

Expand All @@ -929,6 +929,8 @@ void sctp_assoc_control_transport(struct sctp_association *asoc,
first = asoc->peer.primary_path;
}

if (!second)
second = first;
/* If we failed to find a usable transport, just camp on the
* primary, even if it is inactive.
*/
Expand Down

0 comments on commit d30a58b

Please sign in to comment.