Commit 319fa2a2 authored by Vlad Yasevich's avatar Vlad Yasevich Committed by David S. Miller

sctp: Correclty set changeover_active for SFR-CACC

Right now, any time we set a primary transport we set
the changeover_active flag.  As a result, we invoke SFR-CACC
even when there has been no changeover events.

Only set changeover_active, when there is a true changeover
event, i.e. we had a primary path and we are changing to
another transport.
Signed-off-by: default avatarVlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 80896a35
...@@ -474,6 +474,15 @@ static void sctp_association_destroy(struct sctp_association *asoc) ...@@ -474,6 +474,15 @@ static void sctp_association_destroy(struct sctp_association *asoc)
void sctp_assoc_set_primary(struct sctp_association *asoc, void sctp_assoc_set_primary(struct sctp_association *asoc,
struct sctp_transport *transport) struct sctp_transport *transport)
{ {
int changeover = 0;
/* it's a changeover only if we already have a primary path
* that we are changing
*/
if (asoc->peer.primary_path != NULL &&
asoc->peer.primary_path != transport)
changeover = 1 ;
asoc->peer.primary_path = transport; asoc->peer.primary_path = transport;
/* Set a default msg_name for events. */ /* Set a default msg_name for events. */
...@@ -499,12 +508,12 @@ void sctp_assoc_set_primary(struct sctp_association *asoc, ...@@ -499,12 +508,12 @@ void sctp_assoc_set_primary(struct sctp_association *asoc,
* double switch to the same destination address. * double switch to the same destination address.
*/ */
if (transport->cacc.changeover_active) if (transport->cacc.changeover_active)
transport->cacc.cycling_changeover = 1; transport->cacc.cycling_changeover = changeover;
/* 2) The sender MUST set CHANGEOVER_ACTIVE to indicate that /* 2) The sender MUST set CHANGEOVER_ACTIVE to indicate that
* a changeover has occurred. * a changeover has occurred.
*/ */
transport->cacc.changeover_active = 1; transport->cacc.changeover_active = changeover;
/* 3) The sender MUST store the next TSN to be sent in /* 3) The sender MUST store the next TSN to be sent in
* next_tsn_at_change. * next_tsn_at_change.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment