]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 2640] STA_NANO can result in invalid ntv.constant
authorHarlan Stenn <stenn@ntp.org>
Thu, 28 Aug 2014 07:33:02 +0000 (03:33 -0400)
committerHarlan Stenn <stenn@ntp.org>
Thu, 28 Aug 2014 07:33:02 +0000 (03:33 -0400)
bk: 53fedb2e3FL9THwl0nvdeS1dXV2E1g

ChangeLog
ntpd/ntp_loopfilter.c

index 02ba53074fbd8f7ffa7cd3b6ae9b9cfff0dd7151..ca964d3e8d042bf9eee815eebd2c4ef62cbf5c6b 100644 (file)
--- 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 <stenn@ntp.org>
 * [Bug 2536] ntpd sandboxing support (libseccomp2) cleanup.
 (4.2.7p465) 2014/08/23 Released by Harlan Stenn <stenn@ntp.org>
index caa54a0903d7e5bcbaaef8799e3ca1f5a7bc994f..e087d79473aa0978e6f6c82a01da6377e1437ee4 100644 (file)
@@ -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);