Index: global_structures.h =================================================================== --- global_structures.h (revision 15419) +++ global_structures.h (working copy) @@ -199,7 +199,7 @@ u32 timestamps[NUM_SEQ_SAMPLES]; int index; u16 ipids[NUM_SEQ_SAMPLES]; - time_t lastboot; /* 0 means unknown */ + long int lastboot; /* 0 means unknown */ }; /* Different kinds of Ipids. */ Index: osscan2.cc =================================================================== --- osscan2.cc (revision 15417) +++ osscan2.cc (working copy) @@ -1886,6 +1886,7 @@ 5) Same with ~100/sec */ if (hss->si.ts_seqclass == TS_SEQ_UNKNOWN && hss->si.responses >= 2) { + double lastboot = 0.0; avg_ts_hz = 0.0; for(i=0; i < hss->si.responses - 1; i++) { double dhz; @@ -1897,30 +1898,32 @@ if (avg_ts_hz > 0 && avg_ts_hz < 5.66) { /* relatively wide range because sampling time so short and frequency so slow */ hss->si.ts_seqclass = TS_SEQ_2HZ; + lastboot = (double) hss->seq_send_times[0].tv_sec - (hss->si.timestamps[0] / 2); hss->si.lastboot = hss->seq_send_times[0].tv_sec - (hss->si.timestamps[0] / 2); } else if (avg_ts_hz > 70 && avg_ts_hz < 150) { hss->si.ts_seqclass = TS_SEQ_100HZ; - hss->si.lastboot = hss->seq_send_times[0].tv_sec - (hss->si.timestamps[0] / 100); + lastboot = (double) hss->seq_send_times[0].tv_sec - (hss->si.timestamps[0] / 100); } else if (avg_ts_hz > 724 && avg_ts_hz < 1448) { hss->si.ts_seqclass = TS_SEQ_1000HZ; - hss->si.lastboot = hss->seq_send_times[0].tv_sec - (hss->si.timestamps[0] / 1000); + lastboot = (double) hss->seq_send_times[0].tv_sec - (hss->si.timestamps[0] / 1000); } else if (avg_ts_hz > 0) { hss->si.ts_seqclass = TS_SEQ_OTHER_NUM; - hss->si.lastboot = hss->seq_send_times[0].tv_sec - (hss->si.timestamps[0] / (unsigned int)(0.5 + avg_ts_hz)); + lastboot = (double) hss->seq_send_times[0].tv_sec - (hss->si.timestamps[0] / (unsigned int)(0.5 + avg_ts_hz)); } - if (hss->si.lastboot && (hss->seq_send_times[0].tv_sec - hss->si.lastboot > 63072000)) { + if (lastboot != 0.0 && (hss->seq_send_times[0].tv_sec - lastboot > 63072000)) { /* Up 2 years? Perhaps, but they're probably lying. */ if (o.debugging) { log_write(LOG_STDOUT, "Ignoring claimed %s uptime of %lu days", hss->target->targetipstr(), (hss->seq_send_times[0].tv_sec - hss->si.lastboot) / 86400); } - hss->si.lastboot = 0; + lastboot = 0; } + hss->si.lastboot = lastboot; } switch(hss->si.ts_seqclass) {