]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 2001] ntpdc timerstats reports overruns as handled.
authorDave Hart <hart@ntp.org>
Sat, 27 Aug 2011 03:34:10 +0000 (03:34 +0000)
committerDave Hart <hart@ntp.org>
Sat, 27 Aug 2011 03:34:10 +0000 (03:34 +0000)
bk: 4e5865b26oVJTZEA5qC3xi2qfNkzmA

ChangeLog
ntpd/ntp_request.c

index bf046154f2351f9097faffb639d4f56b1b03c9e8..480d74930b46fec6eb9bb869ed0a2bb303858a2e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
 
 * [Bug 1984] ntp/libisc fails to compile on OS X 10.7 (Lion).
 * [Bug 1985] "logconfig =allall" rejected.
+* [Bug 2001] ntpdc timerstats reports overruns as handled.
 * [Backward Incompatible] sntp: -l/--filelog -> -l/--logfile, to be
   consistent with ntpd.
 * libopts/file.c fix from Bruce Korb (arg-type=file).
index a172c5b582f7bbcddc6eddbba5af3f84d1daa677..bc490fae80b5f20f7b2b74ed8f0cfec9753905ae 100644 (file)
@@ -1255,26 +1255,21 @@ io_stats(
  */
 static void
 timer_stats(
-       sockaddr_u *srcadr,
-       struct interface *inter,
-       struct req_pkt *inpkt
+       sockaddr_u *            srcadr,
+       struct interface *      inter,
+       struct req_pkt *        inpkt
        )
 {
-       register struct info_timer_stats *ts;
-
-       /*
-        * Importations from the timer module
-        */
-       extern u_long timer_timereset;
-       extern u_long timer_overflows;
-       extern u_long timer_xmtcalls;
+       struct info_timer_stats *       ts;
+       u_long                          sincereset;
 
-       ts = (struct info_timer_stats *)prepare_pkt(srcadr, inter, inpkt,
-                                                   sizeof(struct info_timer_stats));
+       ts = (struct info_timer_stats *)prepare_pkt(srcadr, inter,
+                                                   inpkt, sizeof(*ts));
 
-       ts->timereset = htonl((u_int32)(current_time - timer_timereset));
-       ts->alarms = htonl((u_int32)alarm_overflow);
-       ts->overflows = htonl((u_int32)timer_overflows);
+       sincereset = current_time - timer_timereset;
+       ts->timereset = htonl((u_int32)sincereset);
+       ts->alarms = ts->timereset;
+       ts->overflows = htonl((u_int32)alarm_overflow);
        ts->xmtcalls = htonl((u_int32)timer_xmtcalls);
 
        (void) more_pkt();