projects
/
l2tpns.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Don't resend IPCP while still in progress
[l2tpns.git]
/
cluster.c
diff --git
a/cluster.c
b/cluster.c
index
9049079
..
a6b83e6
100644
(file)
--- a/
cluster.c
+++ b/
cluster.c
@@
-1,6
+1,6
@@
// L2TPNS Clustering Stuff
// L2TPNS Clustering Stuff
-char const *cvs_id_cluster = "$Id: cluster.c,v 1.4
0 2005/06/02 11:32:30
bodea Exp $";
+char const *cvs_id_cluster = "$Id: cluster.c,v 1.4
2 2005/06/14 05:37:09
bodea Exp $";
#include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
@@
-38,7
+38,7
@@
char const *cvs_id_cluster = "$Id: cluster.c,v 1.40 2005/06/02 11:32:30 bodea Ex
*/
// Module variables.
*/
// Module variables.
-
int cluster_sockfd = 0;
// The filedescriptor for the cluster communications port.
+
extern int cluster_sockfd;
// The filedescriptor for the cluster communications port.
in_addr_t my_address = 0; // The network address of my ethernet port.
static int walk_session_number = 0; // The next session to send when doing the slow table walk.
in_addr_t my_address = 0; // The network address of my ethernet port.
static int walk_session_number = 0; // The next session to send when doing the slow table walk.
@@
-1022,7
+1022,6
@@
static int cluster_add_peer(in_addr_t peer, time_t basetime, pingt *pp, int size
config->cluster_master_address = 0;
config->cluster_last_hb = 0; // Force an election.
cluster_check_master();
config->cluster_master_address = 0;
config->cluster_last_hb = 0; // Force an election.
cluster_check_master();
- return 0;
}
if (i >= num_peers)
}
if (i >= num_peers)
@@
-1069,6
+1068,16
@@
static int cluster_set_master(in_addr_t peer, in_addr_t master)
fmtaddr(master, 1));
config->cluster_master_address = master;
fmtaddr(master, 1));
config->cluster_master_address = master;
+ if (master)
+ {
+ // catchup with new master
+ peer_send_message(master, C_LASTSEEN, config->cluster_seq_number, NULL, 0);
+
+ // delay next election
+ config->cluster_last_hb = TIME;
+ }
+
+ // run election (or reset "probed" if master was set)
cluster_check_master();
return 0;
}
cluster_check_master();
return 0;
}