summaryrefslogtreecommitdiffstats
path: root/hbeat.c
diff options
context:
space:
mode:
Diffstat (limited to 'hbeat.c')
-rw-r--r--hbeat.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/hbeat.c b/hbeat.c
index 902fe22..c51d159 100644
--- a/hbeat.c
+++ b/hbeat.c
@@ -86,7 +86,7 @@ unsigned int
hbeat(hbeat_t hbh)
{
struct hbeat_s *hbeatp = hbh;
- unsigned int hbeat;
+ unsigned int hbeat, hbeat2;
time_t current_time;
int retval;
@@ -97,6 +97,16 @@ hbeat(hbeat_t hbh)
}
hbeat = btime(hbeatp->host);
+ /* quickly sanity check that we're getting the same
+ * hbeat every time we ask for it
+ */
+ if (hbeatp->last_rhost_btime && hbeat != hbeatp->last_rhost_btime) {
+ hbeat2 = btime(hbeatp->host);
+ if (hbeat != hbeat2) {
+ fprintf(stderr, "Got conflicting hbeat times (%d and %d), discarding both\n", hbeat, hbeat2);
+ hbeat = btime(hbeatp->host);
+ }
+ }
current_time = time(NULL);
if (hbeat) { switch(hbeatp->rhost_state) {