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