From fa1c81ce3b31bd19d84e0386fba32df997ededa6 Mon Sep 17 00:00:00 2001 From: Vlad Yasevich Date: Mon, 16 Jun 2008 17:00:29 -0700 Subject: [PATCH] --- yaml --- r: 98221 b: refs/heads/master c: 319fa2a24f652dc35e613360c4532b8d2a771add h: refs/heads/master i: 98219: f02426e636cdaf1b0002fb054816b626e0cf5049 v: v3 --- [refs] | 2 +- trunk/net/sctp/associola.c | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 730163ea6424..759f6168baea 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 80896a3584bbff9ff9ad4dde735517c4de68d736 +refs/heads/master: 319fa2a24f652dc35e613360c4532b8d2a771add diff --git a/trunk/net/sctp/associola.c b/trunk/net/sctp/associola.c index 532634861db1..024c3ebd9661 100644 --- a/trunk/net/sctp/associola.c +++ b/trunk/net/sctp/associola.c @@ -474,6 +474,15 @@ static void sctp_association_destroy(struct sctp_association *asoc) void sctp_assoc_set_primary(struct sctp_association *asoc, 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; /* Set a default msg_name for events. */ @@ -499,12 +508,12 @@ void sctp_assoc_set_primary(struct sctp_association *asoc, * double switch to the same destination address. */ 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 * 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 * next_tsn_at_change.