summaryrefslogtreecommitdiff
path: root/net/sctp
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-06-17 05:25:48 +0400
committerDavid S. Miller <davem@davemloft.net>2008-06-17 05:25:48 +0400
commitcaea902f72b053fd0c76d0d3b6b2e057beb3fc64 (patch)
tree74e8d476b2c51480420e2ef7c9bbae249b6edbc9 /net/sctp
parent0b4419162aa6c4204843f3a13b48d9ab821d3167 (diff)
parent65c3e4715b1b934f8dcc002d9f46b4371ca7a9b1 (diff)
downloadlinux-caea902f72b053fd0c76d0d3b6b2e057beb3fc64.tar.xz
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: drivers/net/wireless/rt2x00/Kconfig drivers/net/wireless/rt2x00/rt2x00usb.c net/sctp/protocol.c
Diffstat (limited to 'net/sctp')
-rw-r--r--net/sctp/associola.c13
-rw-r--r--net/sctp/protocol.c19
2 files changed, 26 insertions, 6 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)
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. */
@@ -501,12 +510,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.
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index d6af466091d2..23aaffb97ca3 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -108,16 +108,27 @@ static __init int sctp_proc_init(void)
}
if (sctp_snmp_proc_init())
- goto out_nomem;
+ goto out_snmp_proc_init;
if (sctp_eps_proc_init())
- goto out_nomem;
+ goto out_eps_proc_init;
if (sctp_assocs_proc_init())
- goto out_nomem;
+ goto out_assocs_proc_init;
if (sctp_remaddr_proc_init())
- goto out_nomem;
+ goto out_remaddr_proc_init;
return 0;
+out_remaddr_proc_init:
+ sctp_remaddr_proc_exit();
+out_assocs_proc_init:
+ sctp_eps_proc_exit();
+out_eps_proc_init:
+ sctp_snmp_proc_exit();
+out_snmp_proc_init:
+ if (proc_net_sctp) {
+ proc_net_sctp = NULL;
+ remove_proc_entry("sctp", init_net.proc_net);
+ }
out_nomem:
return -ENOMEM;
}