projects
/
l2tpns.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
hostname set via command line not config
[l2tpns.git]
/
cluster.c
diff --git
a/cluster.c
b/cluster.c
index
4348b5a
..
3200c2f
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.1
0 2004/08/02 06:06:28
fred_nerk Exp $";
+char const *cvs_id_cluster = "$Id: cluster.c,v 1.1
2 2004/09/21 04:30:46
fred_nerk Exp $";
#include <stdio.h>
#include <sys/file.h>
#include <stdio.h>
#include <sys/file.h>
@@
-256,12
+256,12
@@
int peer_send_message(u32 peer, int type, int more, char * data, int size)
// Forward a state changing packet to the master.
//
// The master just processes the payload as if it had
// Forward a state changing packet to the master.
//
// The master just processes the payload as if it had
-// received it off the t
ap
device.
+// received it off the t
un
device.
//
//
-int master_forward_packet(char *
data, int size, u32 addr, int port)
+int master_forward_packet(char *data, int size, u32 addr, int port)
{
char buf[65536]; // Vast overkill.
{
char buf[65536]; // Vast overkill.
- char *
p = buf;
+ char *p = buf;
if (!config->cluster_master_address) // No election has been held yet. Just skip it.
return -1;
if (!config->cluster_master_address) // No election has been held yet. Just skip it.
return -1;
@@
-470,7
+470,7
@@
void cluster_check_slaves(void)
//
void cluster_check_master(void)
{
//
void cluster_check_master(void)
{
- int i, count, tcount, high_
s
id = 0;
+ int i, count, tcount, high_
unique_
id = 0;
int last_free = 0;
clockt t = TIME;
static int probed = 0;
int last_free = 0;
clockt t = TIME;
static int probed = 0;
@@
-557,7
+557,7
@@
void cluster_check_master(void)
// Re-string the free list.
// Find the ID of the highest session.
last_free = 0;
// Re-string the free list.
// Find the ID of the highest session.
last_free = 0;
- high_
s
id = 0;
+ high_
unique_
id = 0;
config->cluster_highest_sessionid = 0;
for (i = 0, count = 0; i < MAXSESSION; ++i) {
if (session[i].tunnel == T_UNDEF) {
config->cluster_highest_sessionid = 0;
for (i = 0, count = 0; i < MAXSESSION; ++i) {
if (session[i].tunnel == T_UNDEF) {
@@
-584,8
+584,8
@@
void cluster_check_master(void)
session[i].radius = 0; // Reset authentication as the radius blocks aren't up to date.
session[i].radius = 0; // Reset authentication as the radius blocks aren't up to date.
- if (session[i].
sid >= high_sid)
// This is different to the index into the session table!!!
- high_
sid = session[i].s
id+1;
+ if (session[i].
unique_id >= high_unique_id)
// This is different to the index into the session table!!!
+ high_
unique_id = session[i].unique_
id+1;
session[i].tbf_in = session[i].tbf_out = 0; // Remove stale pointers from old master.
session[i].tbf_in = session[i].tbf_out = 0; // Remove stale pointers from old master.
@@
-603,7
+603,7
@@
void cluster_check_master(void)
}
session[last_free].next = 0; // End of chain.
}
session[last_free].next = 0; // End of chain.
- last_
sid = high_sid;
// Keep track of the highest used session ID.
+ last_
id = high_unique_id;
// Keep track of the highest used session ID.
become_master();
become_master();
@@
-1389,7
+1389,7
@@
int processcluster(char * data, int size, u32 addr)
return 0;
shortpacket:
return 0;
shortpacket:
- log(0,0,0,0, "I got a
n
cluster heartbeat packet! This means I'm probably out of sync!!\n");
+ log(0,0,0,0, "I got a
_short_
cluster heartbeat packet! This means I'm probably out of sync!!\n");
return -1;
}
return -1;
}