From: Harlan Stenn Date: Thu, 28 Aug 2014 07:33:02 +0000 (-0400) Subject: [Bug 2640] STA_NANO can result in invalid ntv.constant X-Git-Tag: NTP_4_2_7P467~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=19d69e3f22027249cd591c28e0c16a00febd0627;p=thirdparty%2Fntp.git [Bug 2640] STA_NANO can result in invalid ntv.constant bk: 53fedb2e3FL9THwl0nvdeS1dXV2E1g --- diff --git a/ChangeLog b/ChangeLog index 02ba53074..ca964d3e8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,5 @@ * [Bug 2639] Check return value of ntp_adjtime(). +* [Bug 2640] STA_NANO can result in invalid ntv.constant. (4.2.7p466) 2014/08/27 Released by Harlan Stenn * [Bug 2536] ntpd sandboxing support (libseccomp2) cleanup. (4.2.7p465) 2014/08/23 Released by Harlan Stenn diff --git a/ntpd/ntp_loopfilter.c b/ntpd/ntp_loopfilter.c index caa54a090..e087d7947 100644 --- a/ntpd/ntp_loopfilter.c +++ b/ntpd/ntp_loopfilter.c @@ -527,6 +527,9 @@ local_clock( dtemp); ntv.constant = sys_poll - 4; #endif /* STA_NANO */ + if (ntv.constant < 0) + ntv.constant = 0; + ntv.esterror = (u_int32)(clock_jitter * 1e6); ntv.maxerror = (u_int32)((sys_rootdelay / 2 + sys_rootdisp) * 1e6);