X-Git-Url: http://git.sameswireless.fr/l2tpns.git/blobdiff_plain/4b16fcbdfd2ebf6e40c950c65b6f05220481d2f6..15086a9ad9feb93a4f7f983470e873f215569964:/cluster.c?ds=sidebyside diff --git a/cluster.c b/cluster.c index 4348b5a..3200c2f 100644 --- a/cluster.c +++ b/cluster.c @@ -1,6 +1,6 @@ // L2TPNS Clustering Stuff -char const *cvs_id_cluster = "$Id: cluster.c,v 1.10 2004/08/02 06:06:28 fred_nerk Exp $"; +char const *cvs_id_cluster = "$Id: cluster.c,v 1.12 2004/09/21 04:30:46 fred_nerk Exp $"; #include #include @@ -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 -// received it off the tap device. +// received it off the tun 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 * p = buf; + char *p = buf; 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) { - int i, count, tcount, high_sid = 0; + int i, count, tcount, high_unique_id = 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; - high_sid = 0; + high_unique_id = 0; 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. - if (session[i].sid >= high_sid) // This is different to the index into the session table!!! - high_sid = session[i].sid+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. @@ -603,7 +603,7 @@ void cluster_check_master(void) } 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(); @@ -1389,7 +1389,7 @@ int processcluster(char * data, int size, u32 addr) return 0; shortpacket: - log(0,0,0,0, "I got an 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; }