From: Dave Hart Date: Sat, 27 Aug 2011 03:34:10 +0000 (+0000) Subject: [Bug 2001] ntpdc timerstats reports overruns as handled. X-Git-Tag: NTP_4_2_7P209~7^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8acc71a4a76c872fe3c4962ee6cb555f98ab20e3;p=thirdparty%2Fntp.git [Bug 2001] ntpdc timerstats reports overruns as handled. bk: 4e5865b26oVJTZEA5qC3xi2qfNkzmA --- diff --git a/ChangeLog b/ChangeLog index bf046154f..480d74930 100644 --- 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). diff --git a/ntpd/ntp_request.c b/ntpd/ntp_request.c index a172c5b58..bc490fae8 100644 --- a/ntpd/ntp_request.c +++ b/ntpd/ntp_request.c @@ -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();