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.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/net/sctp/associola.c b/net/sctp/associola.c
index d5cc731b6798..35b6a023a6d0 100644
--- a/net/sctp/associola.c
+++ b/net/sctp/associola.c
@@ -476,6 +476,15 @@ static void sctp_association_destroy(struct sctp_association *asoc)
476void sctp_assoc_set_primary(struct sctp_association *asoc, 476void sctp_assoc_set_primary(struct sctp_association *asoc,
477 struct sctp_transport *transport) 477 struct sctp_transport *transport)
478{ 478{
479 int changeover = 0;
480
481 /* it's a changeover only if we already have a primary path
482 * that we are changing
483 */
484 if (asoc->peer.primary_path != NULL &&
485 asoc->peer.primary_path != transport)
486 changeover = 1 ;
487
479 asoc->peer.primary_path = transport; 488 asoc->peer.primary_path = transport;
480 489
481 /* Set a default msg_name for events. */ 490 /* Set a default msg_name for events. */
@@ -501,12 +510,12 @@ void sctp_assoc_set_primary(struct sctp_association *asoc,
501 * double switch to the same destination address. 510 * double switch to the same destination address.
502 */ 511 */
503 if (transport->cacc.changeover_active) 512 if (transport->cacc.changeover_active)
504 transport->cacc.cycling_changeover = 1; 513 transport->cacc.cycling_changeover = changeover;
505 514
506 /* 2) The sender MUST set CHANGEOVER_ACTIVE to indicate that 515 /* 2) The sender MUST set CHANGEOVER_ACTIVE to indicate that
507 * a changeover has occurred. 516 * a changeover has occurred.
508 */ 517 */
509 transport->cacc.changeover_active = 1; 518 transport->cacc.changeover_active = changeover;
510 519
511 /* 3) The sender MUST store the next TSN to be sent in 520 /* 3) The sender MUST store the next TSN to be sent in
512 * next_tsn_at_change. 521 * next_tsn_at_change.