diff options
-rw-r--r-- | hbeat.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -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) { |