reset .die on master takeover
authorBrendan O'Dea <bod@optus.net>
Fri, 1 Apr 2005 08:46:03 +0000 (08:46 +0000)
committerBrendan O'Dea <bod@optus.net>
Fri, 1 Apr 2005 08:46:03 +0000 (08:46 +0000)
Changes
cluster.c

diff --git a/Changes b/Changes
index 17db24a..47dd20f 100644 (file)
--- a/Changes
+++ b/Changes
@@ -39,7 +39,8 @@
 - Add result/error codes to CDN when shutting down sessions.  Sends 2/7
   (general error, try another LNS) when out of IP addresses, and 3
   (adminstrative) for everything else (suggestion from Chris Gates).
-- sessionshutdown: only send RADIUS stop when there's an ip address.
+- Only send RADIUS stop record in sessionshutdown when there's an ip address.
+- Reset .die on master takeover.
 
 * Fri Dec 17 2004 Brendan O'Dea <bod@optusnet.com.au> 2.0.13
 - Better cluster master collision resolution: keep a counter of state
index ba0fe12..4f728fd 100644 (file)
--- a/cluster.c
+++ b/cluster.c
@@ -1,6 +1,6 @@
 // L2TPNS Clustering Stuff
 
-char const *cvs_id_cluster = "$Id: cluster.c,v 1.31 2005-02-14 06:58:38 bodea Exp $";
+char const *cvs_id_cluster = "$Id: cluster.c,v 1.32 2005-04-01 08:46:03 bodea Exp $";
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -580,9 +580,12 @@ void cluster_check_master(void)
                        continue;
                }
 
-                       // Reset all the idle timeouts..
+                       // Reset idle timeouts..
                session[i].last_packet = time_now;
 
+                       // Reset die relative to our uptime rather than the old master's
+               if (session[i].die) session[i].die = TIME;
+
                        // Accumulate un-sent byte counters.
                session[i].cin += sess_local[i].cin;
                session[i].cout += sess_local[i].cout;