Compare commits

...
91 Commits
Author SHA1 Message Date
Gordon Tetlow 9e63140d5a Add UPDATING entries and bump version.
Approved by:	so
Approved by:	re (implicit for releng/12.2)
2020-09-15 21:48:24 +00:00
Gordon Tetlow 898f93d1b9 Fix ftpd privilege escalation via ftpchroot.
Approved by:	so
Approved by:	re (implicit for releng/12.2)
Security:	FreeBSD-SA-20:30.ftpd
Security:	CVE-2020-7468
2020-09-15 21:47:44 +00:00
Gordon Tetlow c85a9eeae6 Fix bhyve SVM guest escape.
This actually has a patch to sys/amd64/vmm/amd/svm.c that was accidentally
committed as part of r365779.

Approved by:	so
Approved by:	re (implicit for releng/12.2)
Security:	FreeBSD-SA-20:29.bhyve_svm
Security:	CVE-2020-7467
2020-09-15 21:46:39 +00:00
Gordon Tetlow ca6b56c16c Fix bhyve privilege escalation via VMCS access.
Approved by:	so
Approved by:	re (implicit for releng/12.2)
Security:	FreeBSD-SA-20:28.bhyve_vmcs
Security:	CVE-2020-24718
2020-09-15 21:43:41 +00:00
Gordon Tetlow f5dd94b4c4 Fix ure device driver susceptible to packet-in-packet attack.
Approved by:	so
Approved by:	re (implicit for releng/12.2)
Security:	FreeBSD-SA-20:27.ure
Security:	CVE-2020-7464
2020-09-15 21:42:05 +00:00
Gordon Tetlow 8768c95036 Add UPDATING entries and bump version.
Approved by:	so
2020-09-02 16:29:40 +00:00
Gordon Tetlow 4394bae0cd Fix dhclient heap overflow.
Approved by:	so
Security:	FreeBSD-SA-20:26.dhclient
Security:	CVE-2020-7461
2020-09-02 16:25:31 +00:00
Gordon Tetlow 411de40890 Fix SCTP socket use-after-free.
Approved by:	so
Security:	FreeBSD-SA-20:25.sctp
Security:	CVE-2020-7463
2020-09-02 16:24:32 +00:00
Gordon Tetlow b4e4841f64 Fix IPv6 Hop-by-Hop options use-after-free.
Approved by:	so
Security:	FreeBSD-SA-20:24.ipv6
Security:	CVE-2020-7462
2020-09-02 16:23:15 +00:00
Gordon Tetlow a89a428452 Fix getfsstat compatibility system call panic.
Approved by:	so
Security:	FreeBSD-EN-20:18.getfsstat
2020-09-02 16:22:14 +00:00
Gordon Tetlow e844367556 Fix FreeBSD Linux ABI kernel panic.
Approved by:	so
Security:	FreeBSD-EN-20:17.linuxthread
2020-09-02 16:21:27 +00:00
Gordon Tetlow 741c906c74 Add UPDATING entries and bump version.
Approved by:	so
2020-08-05 17:14:37 +00:00
Gordon Tetlow c1b9f05bfb Fix sendmsg(2) privilege escalation.
Approved by:	so
Security:	FreeBSD-SA-20:23.sendmsg
Security:	CVE-2020-7460
2020-08-05 17:14:01 +00:00
Gordon Tetlow 5464888fd1 Fix multiple vulnerabilities in sqlite3.
Approved by:	so
Security:	FreeBSD-SA-20:22.sqlite
Security:	CVE-2020-11655
Security:	CVE-2020-11656
Security:	CVE-2020-13434
Security:	CVE-2020-13435
Security:	CVE-2020-13630
Security:	CVE-2020-13631
Security:	CVE-2020-13632
2020-08-05 17:13:08 +00:00
Gordon Tetlow c8f3b2a43e Fix memory corruption in USB network device drivers.
Approved by:	so
Security:	FreeBSD-SA-20:21.usb_net
Security:	CVE-2020-7459
2020-08-05 17:11:18 +00:00
Gordon Tetlow 2c1bbcd8ea Add UPDATING entries and bump version.
Approved by:	so
2020-07-08 20:26:19 +00:00
Gordon Tetlow 4c9ce523b4 Fix multiple vulnerabilities in unbound.
Approved by:	so
Security:	FreeBSD-SA-20:19.unbound
Security:	CVE-2020-12662
Security:	CVE-2020-12663
2020-07-08 20:20:59 +00:00
Gordon Tetlow c1dc7dc530 Fix IPv6 socket option race condition and use after free.
Approved by:	so
Security:	FreeBSD-SA-20:20.ipv6
Security:	CVE-2020-7457
2020-07-08 20:11:40 +00:00
Gordon Tetlow aa78238eaa Fix kernel panic in mps(4) driver.
Approved by:	so
Security:	FreeBSD-EN-20:15.mps
2020-07-08 19:58:00 +00:00
Gordon Tetlow 7d6660ece9 Fix kernel panic in LinuxKPI subsystem.
Approved by:	so
Security:	FreeBSD-EN-20:14.linuxpki
2020-07-08 19:57:24 +00:00
Gordon Tetlow 180f40586f Add UPDATING entries and bump version.
Approved by:	so
Approved by:	re (implicit)
2020-06-09 16:15:07 +00:00
Gordon Tetlow d2e4dec37d Fix USB HID descriptor parsing error.
Approved by:	so
Approved by:	re (implicit)
Security:	FreeBSD-SA-20:17.usb
Security:	CVE-2020-7456
2020-06-09 16:13:54 +00:00
Gordon Tetlow a55891848c Add UPDATING entries and bump version.
Approved by:	so
Approved by:	re (implicit)
2020-05-12 17:00:23 +00:00
Gordon Tetlow 97ae574359 Fix use after free in cryptodev module.
Approved by:	so
Security:	FreeBSD-SA-20:15.cryptodev
Security:	CVE-2019-15879
2020-05-12 16:57:47 +00:00
Gordon Tetlow 033a6fb64c Fix improper checking in SCTP-AUTH shared key update.
Approved by:	so
Security:	FreeBSD-SA-20:14.sctp
Security:	CVE-2019-15878
2020-05-12 16:55:32 +00:00
Gordon Tetlow f2d4b4a5c3 Fix memory disclosure vulnerability in libalias.
Approved by:	so
Approved by:	re (implicit)
Security:	FreeBSD-SA-20:13.libalias
Security:	CVE-2020-7455
2020-05-12 16:54:39 +00:00
Gordon Tetlow 1d5d673d17 Fix insufficient packet length validation in libalias.
Approved by:	so
Approved by:	re (implicit)
Security:	FreeBSD-SA-20:12.libalias
Security:	CVE-2020-7454
2020-05-12 16:51:11 +00:00
Gordon Tetlow 152f31caec Update to tzdata 2020a.
Approved by:	so
Security:	EN-20:08.tzdata
2020-05-12 16:44:13 +00:00
Ed Maste ed730912a3 MF11 r352638,r358076: correct Clang and lld version checks
r352638 (mhorne): Allow for compiler versions >= 10
r358076 (dim): Correctly recognize linker versions greater than 10.0.

These routines determine the host compiler and linker version, and caused
attempts to build 12.1-RELEASE on 13-CURRENT to fail after the latter was
updated to Clang 10.  The host compiler version was also misdetected on
11.3 although it seems not to have caused the same build failure there.

We don't guarantee such a build config to work, but it is used by FreeBSD
ports build processes.  As a result the fixes from stable/11 will be
included with the next set of advisories, and are being committed to the
releng branch now to unblock ports builds.

PR:		245973
Reported by:	sbruno, antoine
Approved by:	so
Errata:		EN-20:10.build
Sponsored by:	The FreeBSD Foundation
2020-04-29 18:59:37 +00:00
Gordon Tetlow 2b90c1cd5f Add UPDATING entries and bump version.
Approved by:	so
2020-04-21 15:54:08 +00:00
Gordon Tetlow c4ea09589c Fix ipfw invalid mbuf handling.
Approved by:	so
Security:	FreeBSD-SA-20:10.ipfw
Security:	CVE-2019-5614
Security:	CVE-2019-15874
2020-04-21 15:52:22 +00:00
Gordon Tetlow 790d907487 Fix regression in rpc.rquotad with certain NFS servers.
Approved by:	so
Security:	FreeBSD-EN-20:07.quotad
2020-04-21 15:50:57 +00:00
Gordon Tetlow 70f203d99a Add UPDATING entries and bump version.
Approved by:	so
2020-03-19 17:01:57 +00:00
Gordon Tetlow dce57d8ed4 Fix multiple denial of service in ntpd.
Approved by:	so
Security:	FreeBSD-SA-20:09.ntp
2020-03-19 16:52:41 +00:00
Gordon Tetlow 565d73ca4d Fix kernel memory disclosure with nested jails.
Approved by:	so
Security:	FreeBSD-SA-20:08.jail
Security:	CVE-2020-7453
2020-03-19 16:51:33 +00:00
Gordon Tetlow 36f9f1c67c Fix incorrect user-controlled pointer use in epair.
Approved by:	so
Security:	FreeBSD-SA-20:07.epair
Security:	CVE-2020-7452
2020-03-19 16:50:36 +00:00
Gordon Tetlow 97281eaa79 Fix insufficient oce(4) ioctl(2) privilege checking.
Approved by:	so
Security:	FreeBSD-SA-20:05.if_oce_ioctl
Security:	CVE-2019-15876
2020-03-19 16:48:29 +00:00
Gordon Tetlow 986219318e Fix TCP IPv6 SYN cache kernel information disclosure.
Approved by:	so
Security:	FreeBSD-SA-20:04.tcp
Security:	CVE-2020-7451
2020-03-19 16:46:01 +00:00
Gordon Tetlow 1b8fd2b31f Fix incorrect checksum calculations with IPv6 extension headers.
Approved by:	so
Security:	FreeBSD-EN-20:06.ipv6
2020-03-19 16:43:37 +00:00
Gordon Tetlow 990dcdfafe Fix missing pfctl(8) tunable.
Approved by:	so
Security:	FreeBSD-EN-20:04.pfctl
2020-03-19 16:35:15 +00:00
Gordon Tetlow 48a0b4a7f4 Add UPDATING entries and bump version.
Approved by:	so
2020-01-28 18:58:37 +00:00
Gordon Tetlow e61f877b0f Fix kernel stack data disclosure
Reported by:	Ilja Van Sprundel
Approved by:	so
Security:	FreeBSD-SA-20:03.thrmisc
Security:	CVE-2019-15875
2020-01-28 18:57:45 +00:00
Gordon Tetlow 2beaaa98ba Fix libfetch buffer overflow
Reported by:	Duncan Overbruck
Approved by:	so
Security:	FreeBSD-SA-20:01.libfetch
Security:	CVE-2020-7450
2020-01-28 18:55:25 +00:00
Gordon Tetlow 48ba6a8ea7 Fix nmount invalid pointer dereference
Submitted by:	Andrew Turner
Approved by:	so
Security:	FreeBSD-EN-20:02.nmount
2020-01-28 18:54:15 +00:00
Gordon Tetlow d393ae5f47 Fix imprecise ordering of SSP canary initialization
Submitted by:	Kyle Evans
Approved by:	so
Security:	FreeBSD-EN-20:01.ssp
2020-01-28 18:53:14 +00:00
Gordon Tetlow 15f734663f Add UPDATING entries and bump version numbers.
Approved by:	so
2019-11-12 18:13:51 +00:00
Gordon Tetlow 693396e3f6 Fix Machine Check Exception on Page Size Change.
Approved by:	so
Security:	FreeBSD-SA-19:25.mcepsc
Security:	CVE-2018-12207
2019-11-12 18:13:04 +00:00
Gordon Tetlow 8a11c78433 Import tzdata 2019c.
Approved by:	so
Security:	FreeBSD-EN-19:18.tzdata
2019-10-23 03:25:32 +00:00
Gordon Tetlow d658a43e0c That's EN-19:17.ipfw. It's not an SA.
Reported by:	kevans@
Approved by:	so
2019-08-20 18:02:37 +00:00
Gordon Tetlow cd90da25db Bump version information and add UPDATING entries.
Approved by:	so
2019-08-20 17:52:28 +00:00
Gordon Tetlow 953fbfca21 Fix reference count overflow in mqueuefs.
Approved by:	so
Security:	FreeBSD-SA-19:24.mqueuefs
Security:	CVE-2019-5603
2019-08-20 17:51:32 +00:00
Gordon Tetlow be373cb5e6 Fix kernel memory disclosure from /dev/midistat.
Approved by:	so
Security:	FreeBSD-SA-19:23.midi
Security:	CVE-2019-5612
2019-08-20 17:50:33 +00:00
Gordon Tetlow 7b288b33a4 Fix IPv6 remote denial of service.
Approved by:	so
Security:	FreeBSD-SA-19:22.mbuf
Security:	CVE-2019-5611
2019-08-20 17:49:33 +00:00
Gordon Tetlow f7a2ee54e4 Fix ipfw(8) jail keyword prior to jail startup.
Approved by:	so
Security:	FreeBSD-EN-19:17.ipfw
2019-08-20 17:46:40 +00:00
Gordon Tetlow ed4170978b Add bhyve instruction emulation improvements (opcode 03H and F7H).
Approved by:	so
Security:	FreeBSD-EN-19:16.bhyve
2019-08-20 17:45:44 +00:00
Gordon Tetlow e595099936 Bump version information and add UPDATING entries.
Approved by:	so
2019-08-06 17:14:09 +00:00
Gordon Tetlow 744d41c234 Fix insufficient validation of guest-supplied data (e1000 device).
Approved by:	so
Security:	FreeBSD-SA-19:21.bhyve
Security:	CVE-2019-5609
2019-08-06 17:13:17 +00:00
Gordon Tetlow 2daf5f77a9 Fix insufficient message length validation in bsnmp library.
Approved by:	so
Security:	FreeBSD-SA-19:20.bsnmp
Security:	CVE-2019-5610
2019-08-06 17:12:17 +00:00
Gordon Tetlow 223655fa7e Fix ICMPv6 / MLDv2 out-of-bounds memory access.
Approved by:	so
Security:	FreeBSD-SA-19:19.mldv2
Security:	CVE-2019-5608
2019-08-06 17:11:17 +00:00
Gordon Tetlow aaa2c9e290 Fix multiple vulnerabilities in bzip2.
Approved by:	so
Security:	FreeBSD-SA-19:18.bzip2
Security:	CVE-2016-3189
Security:	CVE-2019-12900
2019-08-06 17:09:47 +00:00
Gordon Tetlow 5eda360114 Bump version information and update UPDATING.
Approved by:	so
2019-07-24 12:58:21 +00:00
Gordon Tetlow aba462a902 Fix file descriptor reference count leak.
Approved by:	so
Security:	FreeBSD-SA-19:17.fd
Security:	CVE-2019-5607
2019-07-24 12:57:49 +00:00
Gordon Tetlow 5b7c0b55b2 Fix byhve out-of-bounds read in XHCI device.
Approved by:	so
Security:	FreeBSD-SA-19:16.bhyve
Security:	CVE-2019-5604
2019-07-24 12:56:06 +00:00
Gordon Tetlow 9f848ff367 Fix reference count overflow in mqueuefs.
Approved by:	so
Security:	FreeBSD-SA-19:15.mqueuefs
Security:	CVE-2019-5603
2019-07-24 12:55:16 +00:00
Gordon Tetlow a86e99dd3c Fix kernel memory disclosure in freebsd32_ioctl.
Approved by:	so
Security:	FreeBSD-SA-19:14.freebsd32
Security:	CVE-2019-5605
2019-07-24 12:54:10 +00:00
Gordon Tetlow 7d79c961c5 Fix pts write-after-free.
Approved by:	so
Security:	FreeBSD-SA-19:13.pts
Security:	CVE-2019-5606
2019-07-24 12:53:06 +00:00
Gordon Tetlow 0fff92f8e7 Fix multiple telnet client vulnerabilities.
Approved by:	so
Security:	FreeBSD-SA-19:12.telnet
Security:	CVE-2019-0053
2019-07-24 12:51:52 +00:00
Gordon Tetlow c9f46d2d30 Fix panic from Intel CPU vulnerability mitigation.
Approved by:	so
Security:	FreeBSD-EN-19:13.mds
2019-07-24 12:50:46 +00:00
Glen Barber bf0104cf3d - Switch releng/11.3 to -RELEASE.
- Add the anticipated 11.3-RELEASE date to UPDATING.
- Set a static __FreeBSD_version.

Approved by:	re (implicit)
Sponsored by:	Rubicon Communications, LLC (Netgate)
2019-07-04 23:58:11 +00:00
Glen Barber cd5e4e1eca Document three open issues affecting 11.3-RELEASE.
Approved by:	re (implicit)
Sponsored by:	Rubicon Communications, LLC (Netgate)
2019-07-04 17:15:36 +00:00
Glen Barber ef5606456e Document SA-19:09, SA-19:11.
Approved by:	re (implicit)
Sponsored by:	Rubicon Communications, LLC (Netgate)
2019-07-03 01:04:11 +00:00
Glen Barber bf25cc88dd Document r349620, tzdata 2019b.
Approved by:	re (implicit)
Sponsored by:	Rubicon Communications, LLC (Netgate)
2019-07-03 00:58:10 +00:00
Gordon Tetlow b0562ee81b Update UPDATING and bump newvers.sh
Approved by:	so
Approved by:	re (implicit)
2019-07-03 00:04:50 +00:00
Gordon Tetlow 8b947d90f9 Fix privilege escalation in cd(4) driver.
Approved by:	so
Approved by:	re (implicit)
Security:	FreeBSD-SA-19:11.cd_ioctl
Security:	CVE-2019-5602
2019-07-03 00:03:55 +00:00
Gordon Tetlow ea75e84cbf Fix iconv buffer overflow.
Approved by:	so
Approved by:	re (implicit)
Security:	FreeBSD-SA-19:09.iconv
2019-07-03 00:00:39 +00:00
Gordon Tetlow a3c83fa574 Import tzdata 2019b.
Approved by:	so
Approved by:	re (implicit)
Security:	FreeBSD-EN-19:12.tzdata
2019-07-02 23:59:45 +00:00
Glen Barber 1d91a17f0e Update releng/11.3 to RC3 as part of the 11.3-RELEASE cycle.
Approved by:	re (implicit)
Sponsored by:	Rubicon Communications, LLC (Netgate)
2019-06-28 00:00:02 +00:00
Alexander Motin 51b3ef0ef8 MFC r349376: Fix strsep_quote() on strings without quotes.
For strings without quotes and escapes dstptr and srcptr are equal, so
zeroing *dstptr before checking *srcptr is not a good idea.  In practice
it means that in -maproot=65534:65533 everything after the colon is lost.

The problem was there since r293305, but before r346976 it was covered by
improper strsep_quote() usage.

PR:	238725

Approved by:	re (gjb)
2019-06-27 14:26:57 +00:00
Andrey V. Elsukov 9282df6f75 Merge from stable/11:
Fix the uninitialized use of source IPv6 address in NAT64LSN.

  This code is already refactored in head/, but due to the missing
  epoch(9) support it is impossible to merge. So, it is direct commit to
  stable/11.

  Reported by:	Patrick M. Hausen <hausen punkt de>
  Tested by:	Patrick M. Hausen <hausen punkt de>
Approved by: re (kib, gjb)
2019-06-26 17:21:30 +00:00
Glen Barber 988e93a467 Bump the release.manpath.freebsd macro version, although I do not
see any place this is actually used.

Approved by:	re (implicit)
Sponsored by:	Rubicon Communications, LLC (Netgate)
2019-06-26 15:16:23 +00:00
Glen Barber b004a3541a Connect the installation page to the build.
Approved by:	re (implicit)
Sponsored by:	Rubicon Communications, LLC (Netgate)
2019-06-25 19:36:01 +00:00
Glen Barber 3e5c576287 Release notes documentation:
- Update version numbers in the installation page.

Approved by:	re (implicit)
Sponsored by:	Rubicon Communications, LLC (Netgate)
2019-06-25 19:36:00 +00:00
Glen Barber ca259565e0 Release notes documentation:
- Add versions of ports-mgmt/pkg, x11/gnome3, and x11/kde5.

Approved by:	re (implicit)
Sponsored by:	Rubicon Communications, LLC (Netgate)
2019-06-25 19:35:58 +00:00
Glen Barber fa7cad41cb Release notes documentation:
- Remove empty sections.

Approved by:	re (implicit)
Sponsored by:	Rubicon Communications, LLC (Netgate)
2019-06-25 19:35:57 +00:00
Glen Barber 2cc15696e9 Release notes documentation:
- r338938, oce(4) version 11.0.50.0.
- r341987, mlx4en(4) and mlx5en(4) version 3.5.0.
- r349181, ixl(4) and ixlv(4) version 1.11.9 and 1.5.8.

Approved by:	re (implicit)
Sponsored by:	Rubicon Communications, LLC (Netgate)
2019-06-25 19:35:56 +00:00
Glen Barber 3f58dd9a83 Release notes documentation:
- r347037, virtual machine image reduction, and note how to resize
           the images.
- r346479, init_exec kenv(1) variable addition.
- r346518, spi(8) addition.
- r348482, deprecated IPSec algorithm warnings.
- r347962, driver deprecations.

Approved by:	re (implicit)
Sponsored by:	Rubicon Communications, LLC (Netgate)
2019-06-24 19:52:08 +00:00
Glen Barber e66c9e9aeb Update releng/11.3 to RC2 as part of the 11.3-RELEASE cycle.
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2019-06-21 00:01:12 +00:00
Glen Barber d5f8eb6073 Update the pkg.conf used to populate the dvd1.iso to use
the release_3 package set.

Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2019-06-19 15:26:52 +00:00
Eric Joyner 8fcfd86217 MFS r349163: ixl(4)/ixlv(4): Update Intel XL710 PF and VF drivers to ixl-1.11.9 and ixlv-1.5.8
Update the legacy (non-iflib) drivers in stable/11 with recent changes from the
Intel out-of-tree version.

Major changes:

- Support for new BASE-T device with additional link speeds (2.5G and 5G) and EEE
- Additional I2C access methods backported from ixl-iflib
- FW LLDP Agent control with sysctl added for X722 devices (this already
  existed for 710 devices)
- MAC/VLAN filters handling has been refactored
- Building and loading if_ixlv as a KLD has been fixed

This commit is not from CURRENT since the driver in 12/13 uses iflib, and the decision was
made to not use iflib in FreeBSD 11 releases.

Submitted by:	Krzysztof Galazka <[email protected]>
Approved by:	re@ (gjb@)
Sponsored by:	Intel Corporation
Differential Revision:	https://reviews.freebsd.org/D20290
2019-06-19 00:37:54 +00:00
Glen Barber 130e9cdb11 Post-branch updates to release-related documentation:
- Bump copyright years.
- Note in parenthesis 11.3 may be the last 11.x release.
- Prune stale errata items from 11.2-RELEASE.
- Fix mailing list in the readme page.
- Bump version numbers accordingly.

This has no effect or impact on the in-progress 11.3-RC1
build.

Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2019-06-14 00:30:52 +00:00
Glen Barber a1348a63d8 Copy stable/11@r349022 to releng/11.3 as part of the 11.3-RELEASE
cycle.
Update releng/11.3 from BETA3 to RC1.
Switch the default dvd1.iso pkg(8) repository from latest to
quarterly.
Bump __FreeBSD_version.
Prune vestigial svn:mergeinfo from the new branch.

Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2019-06-14 00:03:48 +00:00
717 changed files with 87827 additions and 25919 deletions

No files matched your search

+10
View File
@@ -474,6 +474,16 @@ OLD_FILES+=usr/include/c++/v1/tr1/__undef_min_max
OLD_FILES+=usr/share/dtrace/watch_execve
OLD_FILES+=usr/share/dtrace/watch_kill
OLD_FILES+=usr/share/dtrace/watch_vop_remove
# 20180512: Rename Unbound tools
OLD_FILES+=usr/sbin/unbound
OLD_FILES+=usr/sbin/unbound-anchor
OLD_FILES+=usr/sbin/unbound-checkconf
OLD_FILES+=usr/sbin/unbound-control
OLD_FILES+=usr/share/man/man5/unbound.conf.5.gz
OLD_FILES+=usr/share/man/man8/unbound-anchor.8.gz
OLD_FILES+=usr/share/man/man8/unbound-checkconf.8.gz
OLD_FILES+=usr/share/man/man8/unbound-control.8.gz
OLD_FILES+=usr/share/man/man8/unbound.8.gz
# 20180331: new clang import which bumps version from 5.0.1 to 6.0.0.
OLD_FILES+=usr/lib/clang/5.0.1/include/sanitizer/allocator_interface.h
OLD_FILES+=usr/lib/clang/5.0.1/include/sanitizer/asan_interface.h
+193
View File
@@ -16,6 +16,199 @@ from older versions of FreeBSD, try WITHOUT_CLANG and WITH_GCC to bootstrap to
the tip of head, and then rebuild without this option. The bootstrap process
from older version of current across the gcc/clang cutover is a bit fragile.
20200915 p14 FreeBSD-SA-20:27.ure
FreeBSD-SA-20:28.bhyve_vmcs
FreeBSD-SA-20:29.bhyve_svm
FreeBSD-SA-20:30.ftpd
Fix ure device driver susceptible to packet-in-packet attack.
[SA-20:27.ure]
Fix bhyve privilege escalation via VMCS access. [SA-20:28.bhyve_vmcs]
Fix bhyve SVM guest escape. [SA-20:29.bhyve_svm]
Fix ftpd privilege escalation via ftpchroot. [SA-20:30.ftpd]
20200902 p13 FreeBSD-EN-20:17.linuxthread
FreeBSD-EN-20:18.getfsstat
FreeBSD-SA-20:24.ipv6
FreeBSD-SA-20:25.sctp
FreeBSD-SA-20:26.dhclient
Fix FreeBSD Linux ABI kernel panic. [EN-20:17.linuxthread]
Fix getfsstat compatibility system call panic. [EN-20:18.getfsstat]
Fix IPv6 Hop-by-Hop options use-after-free. [SA-20:24.ipv6]
Fix SCTP socket use-after-free. [SA-20:25.sctp]
Fix dhclient heap overflow. [SA-20:26.dhclient]
20200805 p12 FreeBSD-SA-20:21.usb_net
FreeBSD-SA-20:22.unbound
FreeBSD-SA-20:23.ipv6
Fix memory corruption in USB network device drivers. [SA-20:21.usb_net]
Fix multiple vulnerabilities in sqlite3. [SA-20:22.sqlite]
Fix sendmsg(2) privilege escalation. [SA-20:23.sendmsg]
20200708 p11 FreeBSD-EN-20:14.linuxkpi
FreeBSD-EN-20:15.mps
FreeBSD-SA-20:19.unbound
FreeBSD-SA-20:20.ipv6
Fix kernel panic in LinuxKPI subsystem. [EN-20:14.linuxpki]
Fix kernel panic in mps(4) driver. [EN-20:15.mps]
Fix multiple vulnerabilities in unbound. [SA-20:19.unbound]
Fix IPv6 socket option race condition and use after free. [SA-20:20.ipv6]
20200609 p10 FreeBSD-SA-20:17.usb
Fix USB HID descriptor parsing error. [SA-20:17.usb]
20200512 p9 FreeBSD-EN-20:08.tzdata
FreeBSD-EN-20:10.build
FreeBSD-SA-20:12.libalias
FreeBSD-SA-20:13.libalias
FreeBSD-SA-20:14.sctp
FreeBSD-SA-20:15.cryptodev
Import tzdata 2020a. [EN-20:08.tzdata]
Fix incorrect build host Clang version detection [EN-20:10.build]
Fix insufficient packet length validation in libalias [SA-20:12.libalias]
Fix memory disclosure vulnerability in libalias [SA-20:13.libalias]
Fix improper checking in SCTP-AUTH shared key update [SA-20:14.sctp]
Fix use after free in cryptodev module [SA-20:15.cryptodev]
20200421 p8 FreeBSD-EN-20:07.quotad
FreeBSD-SA-20:10.ipfw
Fix regression in rpc.rquotad with certain NFS servers [EN-20:07.quotad]
Fix ipfw invalid mbuf handling [SA-20:10.ipfw]
20200319 p7 FreeBSD-EN-20:04.pfctl
FreeBSD-EN-20:06.ipv6
FreeBSD-SA-20:04.tcp
FreeBSD-SA-20:05.if_oce_ioctl
FreeBSD-SA-20:07.epair
FreeBSD-SA-20:08.jail
FreeBSD-SA-20:09.ntp
Fix missing pfctl(8) tunable [EN-20:04.pfctl]
Fix incorrect checksum calculations with IPv6 extension headers [EN-20:06.ipv6]
Fix TCP IPv6 SYN cache kernel information disclosure [SA-20:04.tcp]
Fix insufficient oce(4) ioctl(2) privilege checking [SA-20:05.if_oce_ioctl]
Fix incorrect user-controlled pointer use in epair [SA-20:07.epair]
Fix kernel memory disclosure with nested jails [SA-20:08.jail]
Fix multiple denial of service in ntpd [SA-20:09.ntp]
20200128 p6 FreeBSD-EN-20:01.ssp
FreeBSD-EN-20:02.nmount
FreeBSD-SA-20:01.libfetch
FreeBSD-SA-20:03.thrmisc
Fix imprecise ordering of SSP canary initialization [EN-20:01.ssp]
Fix nmount invalid pointer dereference [EN-20:02.nmount]
Fix libfetch buffer overflow [SA-20:01.libfetch]
Fix kernel stack data disclosure [SA-20:03.thrmisc]
20191112 p5 FreeBSD-SA-19:25.mcepsc
Fix Machine Check Exception on Page Size Change [SA-19:25.mcepsc]
20191023 p4 FreeBSD-EN-19:18.tzdata
Import tzdata 2019c. [EN-19:18.tzdata]
20190820 p3 FreeBSD-EN-19:16.bhyve
FreeBSD-EN-19:17.ipfw
FreeBSD-SA-19:22.mbuf
FreeBSD-SA-19:23.midi
FreeBSD-SA-19:24.mqueuefs
Bhyve instruction emulation improvements (opcode 03H and F7H).
[EN-19:16.bhyve]
Fix ipfw(8) jail keyword prior to jail startup. [EN-19:17.ipfw]
Fix IPv6 remote denial of service. [SA-19:22.mbuf]
Fix kernel memory disclosure from /dev/midistat. [SA-19:23.midi]
Fix reference count overflow in mqueuefs. [SA-19:24.mqueuefs]
20190806 p2 FreeBSD-SA-19:18.bzip2
FreeBSD-SA-19:19.mldv2
FreeBSD-SA-19:20.bsnmp
FreeBSD-SA-19:21.bhyve
Fix multiple vulnerabilities in bzip2. [SA-19:18.bzip2]
Fix ICMPv6 / MLDv2 out-of-bounds memory access. [SA-19:19.mldv2]
Fix insufficient message length validation in bsnmp library.
[SA-19:20.bsnmp]
Fix insufficient validation of guest-supplied data (e1000 device).
[SA-19:21.bhyve]
20190724 p1 FreeBSD-EN-19:13.mds
FreeBSD-SA-19:12.telnet
FreeBSD-SA-19:13.pts
FreeBSD-SA-19:14.freebsd32
FreeBSD-SA-19:15.mqueuefs
FreeBSD-SA-19:16.bhyve
FreeBSD-SA-19:17.fd
Fix panic from Intel CPU vulnerability mitigation. [EN-19:13.mds]
Fix multiple telnet client vulnerabilities. [SA-19:12.telnet]
Fix pts write-after-free. [SA-19:13.pts]
Fix kernel memory disclosure in freebsd32_ioctl. [SA-19:14.freebsd32]
Fix reference count overflow in mqueuefs. [SA-19:15.mqueuefs]
Fix byhve out-of-bounds read in XHCI device. [SA-19:16.bhyve]
Fix file descriptor reference count leak. [SA-19:17.fd]
20190709:
11.3-RELEASE.
20190702 FreeBSD-EN-19:12.tzdata
FreeBSD-SA-19:09.iconv
FreeBSD-SA-19:11.cd_ioctl
Import tzdata 2019b. [EN-19:12.tzdata]
Fix iconv buffer overflow. [SA-19:09.iconv]
Fix privilege escalation in cd(4) driver. [SA-19:11.cd_ioctl]
20190426:
CARP now sets DSCP value CS7(Network Traffic) in the flowlabel field
of packets by default instead of only setting TOS_LOWDELAY in IPv4,
+5
View File
@@ -100,6 +100,11 @@ asn_get_header(struct asn_buf *b, u_char *type, asn_len_t *len)
*len = *b->asn_cptr++;
b->asn_len--;
}
if (*len > b->asn_len) {
asn_error(b, "len %u exceeding asn_len %u", *len, b->asn_len);
return (ASN_ERR_EOBUF);
}
return (ASN_ERR_OK);
}
+15 -2
View File
@@ -2,8 +2,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
bzip2/libbzip2 version 1.0.7 of 27 June 2019
Copyright (C) 1996-2010 Julian Seward <jseward@acm.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
@@ -325,3 +325,16 @@ Security fix only. Fixes CERT-FI 20469 as it applies to bzip2.
Izdebski.
* Make the documentation build on Ubuntu 10.04
1.0.7 (27 Jun 19)
~~~~~~~~~~~~~~~~~
* Fix undefined behavior in the macros SET_BH, CLEAR_BH, & ISSET_BH
* bzip2: Fix return value when combining --test,-t and -q.
* bzip2recover: Fix buffer overflow for large argv[0]
* bzip2recover: Fix use after free issue with outFile (CVE-2016-3189)
* Make sure nSelectors is not out of range (CVE-2019-12900)
+2 -2
View File
@@ -36,7 +36,7 @@ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Julian Seward, jseward@bzip.org
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Julian Seward, jseward@acm.org
bzip2/libbzip2 version 1.0.7 of 27 June 2019
--------------------------------------------------------------------------
+8 -28
View File
@@ -6,8 +6,8 @@ This version is fully compatible with the previous public releases.
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
bzip2/libbzip2 version 1.0.7 of 27 June 2019
Copyright (C) 1996-2010 Julian Seward <jseward@acm.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in this file.
@@ -73,7 +73,7 @@ HOW TO BUILD -- Windows 95, NT, DOS, Mac, etc.
It's difficult for me to support compilation on all these platforms.
My approach is to collect binaries for these platforms, and put them
on the master web site (http://www.bzip.org). Look there. However
on the master web site (https://sourceware.org/bzip2/). Look there. However
(FWIW), bzip2-1.0.X is very standard ANSI C and should compile
unmodified with MS Visual C. If you have difficulties building, you
might want to read README.COMPILATION.PROBLEMS.
@@ -161,43 +161,22 @@ WHAT'S NEW IN 0.9.5 ?
* Many small improvements in file and flag handling.
* A Y2K statement.
WHAT'S NEW IN 1.0.0 ?
WHAT'S NEW IN 1.0.x ?
See the CHANGES file.
WHAT'S NEW IN 1.0.2 ?
See the CHANGES file.
WHAT'S NEW IN 1.0.3 ?
See the CHANGES file.
WHAT'S NEW IN 1.0.4 ?
See the CHANGES file.
WHAT'S NEW IN 1.0.5 ?
See the CHANGES file.
WHAT'S NEW IN 1.0.6 ?
See the CHANGES file.
I hope you find bzip2 useful. Feel free to contact me at
jseward@bzip.org
jseward@acm.org
if you have any suggestions or queries. Many people mailed me with
comments, suggestions and patches after the releases of bzip-0.15,
bzip-0.21, and bzip2 versions 0.1pl2, 0.9.0, 0.9.5, 1.0.0, 1.0.1,
1.0.2 and 1.0.3, and the changes in bzip2 are largely a result of this
feedback. I thank you for your comments.
bzip2's "home" is http://www.bzip.org/
bzip2's "home" is https://sourceware.org/bzip2/
Julian Seward
jseward@bzip.org
jseward@acm.org
Cambridge, UK.
18 July 1996 (version 0.15)
@@ -213,3 +192,4 @@ Cambridge, UK.
20 December 2006 (bzip2, version 1.0.4)
10 December 2007 (bzip2, version 1.0.5)
6 Sept 2010 (bzip2, version 1.0.6)
27 June 2019 (bzip2, version 1.0.7)
+3 -3
View File
@@ -2,8 +2,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
bzip2/libbzip2 version 1.0.7 of 27 June 2019
Copyright (C) 1996-2010 Julian Seward <jseward@acm.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
@@ -12,7 +12,7 @@ This program is released under the terms of the license contained
in the file LICENSE.
------------------------------------------------------------------
bzip2-1.0.6 should compile without problems on the vast majority of
bzip2 should compile without problems on the vast majority of
platforms. Using the supplied Makefile, I've built and tested it
myself for x86-linux and amd64-linux. With makefile.msc, Visual C++
6.0 and nmake, you can build a native Win32 version too. Large file
+5 -5
View File
@@ -8,8 +8,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
bzip2/libbzip2 version 1.0.7 of 27 June 2019
Copyright (C) 1996-2010 Julian Seward <jseward@acm.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
@@ -202,9 +202,9 @@ void fallbackQSort3 ( UInt32* fmap,
bhtab [ 0 .. 2+(nblock/32) ] destroyed
*/
#define SET_BH(zz) bhtab[(zz) >> 5] |= (1 << ((zz) & 31))
#define CLEAR_BH(zz) bhtab[(zz) >> 5] &= ~(1 << ((zz) & 31))
#define ISSET_BH(zz) (bhtab[(zz) >> 5] & (1 << ((zz) & 31)))
#define SET_BH(zz) bhtab[(zz) >> 5] |= ((UInt32)1 << ((zz) & 31))
#define CLEAR_BH(zz) bhtab[(zz) >> 5] &= ~((UInt32)1 << ((zz) & 31))
#define ISSET_BH(zz) (bhtab[(zz) >> 5] & ((UInt32)1 << ((zz) & 31)))
#define WORD_BH(zz) bhtab[(zz) >> 5]
#define UNALIGNED_BH(zz) ((zz) & 0x01f)
+4 -4
View File
@@ -1,6 +1,6 @@
.TH bzip2 1
.SH NAME
bzip2, bunzip2 \- a block-sorting file compressor, v1.0.6
bzip2, bunzip2 \- a block-sorting file compressor, v1.0.7
.br
bzcat \- decompresses files to stdout
.br
@@ -404,7 +404,7 @@ I/O error messages are not as helpful as they could be.
tries hard to detect I/O errors and exit cleanly, but the details of
what the problem is sometimes seem rather misleading.
This manual page pertains to version 1.0.6 of
This manual page pertains to version 1.0.7 of
.I bzip2.
Compressed data created by this version is entirely forwards and
backwards compatible with the previous public releases, versions
@@ -426,9 +426,9 @@ with MaybeUInt64 set to be an unsigned 64-bit integer.
.SH AUTHOR
Julian Seward, jsewardbzip.org.
Julian Seward, jseward@acm.org.
http://www.bzip.org
https://sourceware.org/bzip2/
The ideas embodied in
.I bzip2
+16 -14
View File
@@ -7,8 +7,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
bzip2/libbzip2 version 1.0.7 of 27 June 2019
Copyright (C) 1996-2010 Julian Seward <jseward@acm.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
@@ -554,7 +554,7 @@ static
Bool testStream ( FILE *zStream )
{
BZFILE* bzf = NULL;
Int32 bzerr, bzerr_dummy, ret, nread, streamNo, i;
Int32 bzerr, bzerr_dummy, ret, streamNo, i;
UChar obuf[5000];
UChar unused[BZ_MAX_UNUSED];
Int32 nUnused;
@@ -577,7 +577,7 @@ Bool testStream ( FILE *zStream )
streamNo++;
while (bzerr == BZ_OK) {
nread = BZ2_bzRead ( &bzerr, bzf, obuf, 5000 );
BZ2_bzRead ( &bzerr, bzf, obuf, 5000 );
if (bzerr == BZ_DATA_ERROR_MAGIC) goto errhandler;
}
if (bzerr != BZ_STREAM_END) goto errhandler;
@@ -749,7 +749,7 @@ void panic ( const Char* s )
"\n%s: PANIC -- internal consistency error:\n"
"\t%s\n"
"\tThis is a BUG. Please report it to me at:\n"
"\tjseward@bzip.org\n",
"\tjseward@acm.org\n",
progName, s );
showFileNames();
cleanUpAndFail( 3 );
@@ -829,7 +829,7 @@ void mySIGSEGVorSIGBUScatcher ( IntNative n )
" The user's manual, Section 4.3, has more info on (1) and (2).\n"
" \n"
" If you suspect this is a bug in bzip2, or are unsure about (1)\n"
" or (2), feel free to report it to me at: jseward@bzip.org.\n"
" or (2), feel free to report it to me at: jseward@acm.org.\n"
" Section 4.3 of the user's manual describes the info a useful\n"
" bug report should have. If the manual is available on your\n"
" system, please try and read it before mailing me. If you don't\n"
@@ -852,7 +852,7 @@ void mySIGSEGVorSIGBUScatcher ( IntNative n )
" The user's manual, Section 4.3, has more info on (2) and (3).\n"
" \n"
" If you suspect this is a bug in bzip2, or are unsure about (2)\n"
" or (3), feel free to report it to me at: jseward@bzip.org.\n"
" or (3), feel free to report it to me at: jseward@acm.org.\n"
" Section 4.3 of the user's manual describes the info a useful\n"
" bug report should have. If the manual is available on your\n"
" system, please try and read it before mailing me. If you don't\n"
@@ -1609,7 +1609,7 @@ void license ( void )
" \n"
" This program is free software; you can redistribute it and/or modify\n"
" it under the terms set out in the LICENSE file, which is included\n"
" in the bzip2-1.0.6 source distribution.\n"
" in the bzip2 source distribution.\n"
" \n"
" This program is distributed in the hope that it will be useful,\n"
" but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
@@ -2005,12 +2005,14 @@ IntNative main ( IntNative argc, Char *argv[] )
testf ( aa->name );
}
}
if (testFailsExist && noisy) {
fprintf ( stderr,
"\n"
"You can use the `bzip2recover' program to attempt to recover\n"
"data from undamaged sections of corrupted files.\n\n"
);
if (testFailsExist) {
if (noisy) {
fprintf ( stderr,
"\n"
"You can use the `bzip2recover' program to attempt to recover\n"
"data from undamaged sections of corrupted files.\n\n"
);
}
setExit(2);
exit(exitValue);
}
+6 -4
View File
@@ -7,8 +7,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
bzip2/libbzip2 version 1.0.7 of 27 June 2019
Copyright (C) 1996-2010 Julian Seward <jseward@acm.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
@@ -309,11 +309,12 @@ Int32 main ( Int32 argc, Char** argv )
UInt32 buffHi, buffLo, blockCRC;
Char* p;
strcpy ( progName, argv[0] );
strncpy ( progName, argv[0], BZ_MAX_FILENAME-1);
progName[BZ_MAX_FILENAME-1]='\0';
inFileName[0] = outFileName[0] = 0;
fprintf ( stderr,
"bzip2recover 1.0.6: extracts blocks from damaged .bz2 files.\n" );
"bzip2recover 1.0.7: extracts blocks from damaged .bz2 files.\n" );
if (argc != 2) {
fprintf ( stderr, "%s: usage is `%s damaged_file_name'.\n",
@@ -457,6 +458,7 @@ Int32 main ( Int32 argc, Char** argv )
bsPutUChar ( bsWr, 0x50 ); bsPutUChar ( bsWr, 0x90 );
bsPutUInt32 ( bsWr, blockCRC );
bsClose ( bsWr );
outFile = NULL;
}
if (wrBlock >= rbCtr) break;
wrBlock++;
+3 -3
View File
@@ -8,8 +8,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
bzip2/libbzip2 version 1.0.7 of 27 June 2019
Copyright (C) 1996-2010 Julian Seward <jseward@acm.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
@@ -47,7 +47,7 @@ void BZ2_bz__AssertH__fail ( int errcode )
fprintf(stderr,
"\n\nbzip2/libbzip2: internal error number %d.\n"
"This is a bug in bzip2/libbzip2, %s.\n"
"Please report it to me at: jseward@bzip.org. If this happened\n"
"Please report it to me at: jseward@acm.org. If this happened\n"
"when you were using some program which uses libbzip2 as a\n"
"component, you should also report this bug to the author(s)\n"
"of that program. Please make an effort to report this bug;\n"
+2 -2
View File
@@ -8,8 +8,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
bzip2/libbzip2 version 1.0.7 of 27 June 2019
Copyright (C) 1996-2010 Julian Seward <jseward@acm.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
+3 -3
View File
@@ -8,8 +8,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
bzip2/libbzip2 version 1.0.7 of 27 June 2019
Copyright (C) 1996-2010 Julian Seward <jseward@acm.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
@@ -36,7 +36,7 @@
/*-- General stuff. --*/
#define BZ_VERSION "1.0.6, 6-Sept-2010"
#define BZ_VERSION "1.0.7, 27-Jun-2019"
typedef char Char;
typedef unsigned char Bool;
+2 -2
View File
@@ -8,8 +8,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
bzip2/libbzip2 version 1.0.7 of 27 June 2019
Copyright (C) 1996-2010 Julian Seward <jseward@acm.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
+2 -2
View File
@@ -8,8 +8,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
bzip2/libbzip2 version 1.0.7 of 27 June 2019
Copyright (C) 1996-2010 Julian Seward <jseward@acm.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
+4 -4
View File
@@ -8,8 +8,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
bzip2/libbzip2 version 1.0.7 of 27 June 2019
Copyright (C) 1996-2010 Julian Seward <jseward@acm.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
@@ -285,9 +285,9 @@ Int32 BZ2_decompress ( DState* s )
/*--- Now the selectors ---*/
GET_BITS(BZ_X_SELECTOR_1, nGroups, 3);
if (nGroups < 2 || nGroups > 6) RETURN(BZ_DATA_ERROR);
if (nGroups < 2 || nGroups > BZ_N_GROUPS) RETURN(BZ_DATA_ERROR);
GET_BITS(BZ_X_SELECTOR_2, nSelectors, 15);
if (nSelectors < 1) RETURN(BZ_DATA_ERROR);
if (nSelectors < 1 || nSelectors > BZ_MAX_SELECTORS) RETURN(BZ_DATA_ERROR);
for (i = 0; i < nSelectors; i++) {
j = 0;
while (True) {
+2 -2
View File
@@ -8,8 +8,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
bzip2/libbzip2 version 1.0.7 of 27 June 2019
Copyright (C) 1996-2010 Julian Seward <jseward@acm.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
+2 -2
View File
@@ -8,8 +8,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
bzip2/libbzip2 version 1.0.7 of 27 June 2019
Copyright (C) 1996-2010 Julian Seward <jseward@acm.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
+2 -2
View File
@@ -13,8 +13,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
bzip2/libbzip2 version 1.0.7 of 27 June 2019
Copyright (C) 1996-2010 Julian Seward <jseward@acm.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
+2 -2
View File
@@ -17,8 +17,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
bzip2/libbzip2 version 1.0.7 of 27 June 2019
Copyright (C) 1996-2010 Julian Seward <jseward@acm.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
+1 -1
View File
@@ -1,5 +1,5 @@
Checking test results. If any of the four "cmp"s which follow
report any differences, something is wrong. If you can't easily
figure out what, please let me know (jseward@bzip.org).
figure out what, please let me know (jseward@acm.org).
+2 -2
View File
@@ -3,7 +3,7 @@ This file is automatically generated from html/copyright.html
jpg "Clone me," says Dolly sheepishly.
Last update: 2-Jan-2017 11:58 UTC
Last update: 4-Feb-2020 23:47 UTC
__________________________________________________________________
The following copyright notice applies to all files collectively called
@@ -32,7 +32,7 @@ This file is automatically generated from html/copyright.html
Burnicki is:
***********************************************************************
* *
* Copyright (c) Network Time Foundation 2011-2017 *
* Copyright (c) Network Time Foundation 2011-2020 *
* *
* All Rights Reserved *
* *
+96
View File
@@ -1,3 +1,99 @@
---
(4.2.8p14) 2020/03/03 Released by Harlan Stenn <[email protected]>
* [Sec 3610] process_control() should bail earlier on short packets. stenn@
- Reported by Philippe Antoine
* [Sec 3596] Highly predictable timestamp attack. <[email protected]>
- Reported by Miroslav Lichvar
* [Sec 3592] DoS attack on client ntpd <[email protected]>
- Reported by Miroslav Lichvar
* [Bug 3637] Emit the version of ntpd in saveconfig. stenn@
* [Bug 3636] NMEA: combine time/date from multiple sentences <[email protected]>
* [Bug 3635] Make leapsecond file hash check optional <[email protected]>
* [Bug 3634] Typo in discipline.html, reported by Jason Harrison. stenn@
* [Bug 3628] raw DCF decoding - improve robustness with Zeller's congruence
- implement Zeller's congruence in libparse and libntp <[email protected]>
* [Bug 3627] SIGSEGV on FreeBSD-12 with stack limit and stack gap <[email protected]>
- integrated patch by Cy Schubert
* [Bug 3620] memory leak in ntpq sysinfo <[email protected]>
- applied patch by Gerry Garvey
* [Bug 3619] Honour drefid setting in cooked mode and sysinfo <[email protected]>
- applied patch by Gerry Garvey
* [Bug 3617] Add support for ACE III and Copernicus II receivers <[email protected]>
- integrated patch by Richard Steedman
* [Bug 3615] accelerate refclock startup <[email protected]>
* [Bug 3613] Propagate noselect to mobilized pool servers <[email protected]>
- Reported by Martin Burnicki
* [Bug 3612] Use-of-uninitialized-value in receive function <[email protected]>
- Reported by Philippe Antoine
* [Bug 3611] NMEA time interpreted incorrectly <[email protected]>
- officially document new "trust date" mode bit for NMEA driver
- restore the (previously undocumented) "trust date" feature lost with [bug 3577]
* [Bug 3609] Fixing wrong falseticker in case of non-statistic jitter <[email protected]>
- mostly based on a patch by Michael Haardt, implementing 'fudge minjitter'
* [Bug 3608] libparse fails to compile on S11.4SRU13 and later <[email protected]>
- removed ffs() and fls() prototypes as per Brian Utterback
* [Bug 3604] Wrong param byte order passing into record_raw_stats() in
ntp_io.c <[email protected]>
- fixed byte and paramter order as suggested by [email protected]
* [Bug 3601] Tests fail to link on platforms with ntp_cv_gc_sections_runs=no <[email protected]>
* [Bug 3599] Build fails on linux-m68k due to alignment issues <[email protected]>
- added padding as suggested by John Paul Adrian Glaubitz
* [Bug 3594] ntpd discards messages coming through nmead <[email protected]>
* [Bug 3593] ntpd discards silently nmea messages after the 5th string <[email protected]>
* [Bug 3590] Update refclock_oncore.c to the new GPS date API <[email protected]>
* [Bug 3585] Unity tests mix buffered and unbuffered output <[email protected]>
- stdout+stderr are set to line buffered during test setup now
* [Bug 3583] synchronization error <[email protected]>
- set clock to base date if system time is before that limit
* [Bug 3582] gpsdjson refclock fudgetime1 adjustment is doubled <[email protected]>
* [Bug 3580] Possible bug ntpq-subs (NULL dereference in dogetassoc) <[email protected]>
- Reported by Paulo Neves
* [Bug 3577] Update refclock_zyfer.c to the new GPS date API <[email protected]>
- also updates for refclock_nmea.c and refclock_jupiter.c
* [Bug 3576] New GPS date function API <[email protected]>
* [Bug 3573] nptdate: missleading error message <[email protected]>
* [Bug 3570] NMEA driver docs: talker ID not mentioned, typo <[email protected]>
* [Bug 3569] cleanup MOD_NANO/STA_NANO handling for 'ntpadjtimex()' <[email protected]>
- sidekick: service port resolution in 'ntpdate'
* [Bug 3550] Reproducible build: Respect SOURCE_DATE_EPOCH <[email protected]>
- applied patch by Douglas Royds
* [Bug 3542] ntpdc monlist parameters cannot be set <[email protected]>
* [Bug 3533] ntpdc peer_info ipv6 issues <[email protected]>
- applied patch by Gerry Garvey
* [Bug 3531] make check: test-decodenetnum fails <[email protected]>
- try to harden 'decodenetnum()' against 'getaddrinfo()' errors
- fix wrong cond-compile tests in unit tests
* [Bug 3517] Reducing build noise <[email protected]>
* [Bug 3516] Require tooling from this decade <[email protected]>
- patch by Philipp Prindeville
* [Bug 3515] Refactor ntpdmain() dispatcher loop and group common code <[email protected]>
- patch by Philipp Prindeville
* [Bug 3511] Get rid of AC_LANG_SOURCE() warnings <[email protected]>
- patch by Philipp Prindeville
* [Bug 3510] Flatten out the #ifdef nesting in ntpdmain() <[email protected]>
- partial application of patch by Philipp Prindeville
* [Bug 3491] Signed values of LFP datatypes should always display a sign
- applied patch by Gerry Garvey & fixed unit tests <[email protected]>
* [Bug 3490] Patch to support Trimble Resolution Receivers <[email protected]>
- applied (modified) patch by Richard Steedman
* [Bug 3473] RefID of refclocks should always be text format <[email protected]>
- applied patch by Gerry Garvey (with minor formatting changes)
* [Bug 3132] Building 4.2.8p8 with disabled local libopts fails <[email protected]>
- applied patch by Miroslav Lichvar
* [Bug 3094] ntpd trying to listen for broadcasts on a completely ipv6 network
<[email protected]>
* [Bug 2420] ntpd doesn't run and exits with retval 0 when invalid user
is specified with -u <[email protected]>
- monitor daemon child startup & propagate exit codes
* [Bug 1433] runtime check whether the kernel really supports capabilities
- (modified) patch by Kurt Roeckx <[email protected]>
* Clean up sntp/networking.c:sendpkt() error message. <[email protected]>
* Provide more detail on unrecognized config file parser tokens. <[email protected]>
* Startup log improvements. <[email protected]>
* Update the copyright year.
* html/confopt.html: cleanup. <[email protected]>
---
(4.2.8p13) 2019/03/07 Released by Harlan Stenn <[email protected]>
+3435 -12
View File
File diff suppressed because it is too large. Load diff
+108
View File
@@ -1,3 +1,111 @@
---
NTP 4.2.8p14 (Harlan Stenn <[email protected]>, 2020 Mar 03)
Focus: Security, Bug fixes, enhancements.
Severity: MEDIUM
This release fixes three vulnerabilities: a bug that causes causes an ntpd
instance that is explicitly configured to override the default and allow
ntpdc (mode 7) connections to be made to a server to read some uninitialized
memory; fixes the case where an unmonitored ntpd using an unauthenticated
association to its servers may be susceptible to a forged packet DoS attack;
and fixes an attack against a client instance that uses a single
unauthenticated time source. It also fixes 46 other bugs and addresses
4 other issues.
* [Sec 3610] process_control() should bail earlier on short packets. stenn@
- Reported by Philippe Antoine
* [Sec 3596] Highly predictable timestamp attack. <[email protected]>
- Reported by Miroslav Lichvar
* [Sec 3592] DoS attack on client ntpd <[email protected]>
- Reported by Miroslav Lichvar
* [Bug 3637] Emit the version of ntpd in saveconfig. stenn@
* [Bug 3636] NMEA: combine time/date from multiple sentences <[email protected]>
* [Bug 3635] Make leapsecond file hash check optional <[email protected]>
* [Bug 3634] Typo in discipline.html, reported by Jason Harrison. stenn@
* [Bug 3628] raw DCF decoding - improve robustness with Zeller's congruence
- implement Zeller's congruence in libparse and libntp <[email protected]>
* [Bug 3627] SIGSEGV on FreeBSD-12 with stack limit and stack gap <[email protected]>
- integrated patch by Cy Schubert
* [Bug 3620] memory leak in ntpq sysinfo <[email protected]>
- applied patch by Gerry Garvey
* [Bug 3619] Honour drefid setting in cooked mode and sysinfo <[email protected]>
- applied patch by Gerry Garvey
* [Bug 3617] Add support for ACE III and Copernicus II receivers <[email protected]>
- integrated patch by Richard Steedman
* [Bug 3615] accelerate refclock startup <[email protected]>
* [Bug 3613] Propagate noselect to mobilized pool servers <[email protected]>
- Reported by Martin Burnicki
* [Bug 3612] Use-of-uninitialized-value in receive function <[email protected]>
- Reported by Philippe Antoine
* [Bug 3611] NMEA time interpreted incorrectly <[email protected]>
- officially document new "trust date" mode bit for NMEA driver
- restore the (previously undocumented) "trust date" feature lost with [bug 3577]
* [Bug 3609] Fixing wrong falseticker in case of non-statistic jitter <[email protected]>
- mostly based on a patch by Michael Haardt, implementing 'fudge minjitter'
* [Bug 3608] libparse fails to compile on S11.4SRU13 and later <[email protected]>
- removed ffs() and fls() prototypes as per Brian Utterback
* [Bug 3604] Wrong param byte order passing into record_raw_stats() in
ntp_io.c <[email protected]>
- fixed byte and paramter order as suggested by [email protected]
* [Bug 3601] Tests fail to link on platforms with ntp_cv_gc_sections_runs=no <[email protected]>
* [Bug 3599] Build fails on linux-m68k due to alignment issues <[email protected]>
- added padding as suggested by John Paul Adrian Glaubitz
* [Bug 3594] ntpd discards messages coming through nmead <[email protected]>
* [Bug 3593] ntpd discards silently nmea messages after the 5th string <[email protected]>
* [Bug 3590] Update refclock_oncore.c to the new GPS date API <[email protected]>
* [Bug 3585] Unity tests mix buffered and unbuffered output <[email protected]>
- stdout+stderr are set to line buffered during test setup now
* [Bug 3583] synchronization error <[email protected]>
- set clock to base date if system time is before that limit
* [Bug 3582] gpsdjson refclock fudgetime1 adjustment is doubled <[email protected]>
* [Bug 3580] Possible bug ntpq-subs (NULL dereference in dogetassoc) <[email protected]>
- Reported by Paulo Neves
* [Bug 3577] Update refclock_zyfer.c to the new GPS date API <[email protected]>
- also updates for refclock_nmea.c and refclock_jupiter.c
* [Bug 3576] New GPS date function API <[email protected]>
* [Bug 3573] nptdate: missleading error message <[email protected]>
* [Bug 3570] NMEA driver docs: talker ID not mentioned, typo <[email protected]>
* [Bug 3569] cleanup MOD_NANO/STA_NANO handling for 'ntpadjtimex()' <[email protected]>
- sidekick: service port resolution in 'ntpdate'
* [Bug 3550] Reproducible build: Respect SOURCE_DATE_EPOCH <[email protected]>
- applied patch by Douglas Royds
* [Bug 3542] ntpdc monlist parameters cannot be set <[email protected]>
* [Bug 3533] ntpdc peer_info ipv6 issues <[email protected]>
- applied patch by Gerry Garvey
* [Bug 3531] make check: test-decodenetnum fails <[email protected]>
- try to harden 'decodenetnum()' against 'getaddrinfo()' errors
- fix wrong cond-compile tests in unit tests
* [Bug 3517] Reducing build noise <[email protected]>
* [Bug 3516] Require tooling from this decade <[email protected]>
- patch by Philipp Prindeville
* [Bug 3515] Refactor ntpdmain() dispatcher loop and group common code <[email protected]>
- patch by Philipp Prindeville
* [Bug 3511] Get rid of AC_LANG_SOURCE() warnings <[email protected]>
- patch by Philipp Prindeville
* [Bug 3510] Flatten out the #ifdef nesting in ntpdmain() <[email protected]>
- partial application of patch by Philipp Prindeville
* [Bug 3491] Signed values of LFP datatypes should always display a sign
- applied patch by Gerry Garvey & fixed unit tests <[email protected]>
* [Bug 3490] Patch to support Trimble Resolution Receivers <[email protected]>
- applied (modified) patch by Richard Steedman
* [Bug 3473] RefID of refclocks should always be text format <[email protected]>
- applied patch by Gerry Garvey (with minor formatting changes)
* [Bug 3132] Building 4.2.8p8 with disabled local libopts fails <[email protected]>
- applied patch by Miroslav Lichvar
* [Bug 3094] ntpd trying to listen for broadcasts on a completely ipv6 network
<[email protected]>
* [Bug 2420] ntpd doesn't run and exits with retval 0 when invalid user
is specified with -u <[email protected]>
- monitor daemon child startup & propagate exit codes
* [Bug 1433] runtime check whether the kernel really supports capabilities
- (modified) patch by Kurt Roeckx <[email protected]>
* Clean up sntp/networking.c:sendpkt() error message. <[email protected]>
* Provide more detail on unrecognized config file parser tokens. <[email protected]>
* Startup log improvements. <[email protected]>
* Update the copyright year.
---
NTP 4.2.8p13 (Harlan Stenn <[email protected]>, 2019 Mar 07)
+3
View File
@@ -1215,6 +1215,9 @@
/* Define if C99-compliant `vsnprintf' is available. */
#undef HAVE_VSNPRINTF
/* Define to 1 if you have the `waitpid' function. */
#undef HAVE_WAITPID
/* Define to 1 if you have the <wchar.h> header file. */
#undef HAVE_WCHAR_H
+33 -10
View File
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for ntp 4.2.8p13.
# Generated by GNU Autoconf 2.69 for ntp 4.2.8p14.
#
# Report bugs to <http://bugs.ntp.org./>.
#
@@ -590,8 +590,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='ntp'
PACKAGE_TARNAME='ntp'
PACKAGE_VERSION='4.2.8p13'
PACKAGE_STRING='ntp 4.2.8p13'
PACKAGE_VERSION='4.2.8p14'
PACKAGE_STRING='ntp 4.2.8p14'
PACKAGE_BUGREPORT='http://bugs.ntp.org./'
PACKAGE_URL='http://www.ntp.org./'
@@ -1617,7 +1617,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures ntp 4.2.8p13 to adapt to many kinds of systems.
\`configure' configures ntp 4.2.8p14 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1687,7 +1687,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of ntp 4.2.8p13:";;
short | recursive ) echo "Configuration of ntp 4.2.8p14:";;
esac
cat <<\_ACEOF
@@ -1930,7 +1930,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
ntp configure 4.2.8p13
ntp configure 4.2.8p14
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2639,7 +2639,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by ntp $as_me 4.2.8p13, which was
It was created by ntp $as_me 4.2.8p14, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -3640,7 +3640,7 @@ fi
# Define the identity of the package.
PACKAGE='ntp'
VERSION='4.2.8p13'
VERSION='4.2.8p14'
cat >>confdefs.h <<_ACEOF
@@ -26091,6 +26091,17 @@ fi
done
for ac_func in waitpid
do :
ac_fn_c_check_func "$LINENO" "waitpid" "ac_cv_func_waitpid"
if test "x$ac_cv_func_waitpid" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_WAITPID 1
_ACEOF
fi
done
case "$host" in
*-convex-*)
for ac_header in /sys/sync/queue.h /sys/sync/sema.h
@@ -33331,6 +33342,10 @@ case "$ntp_ept:$cross:$host" in
no:0:*-*-solaris*) ;;
*) ntp_test_ntp_restrict="yes" ;;
esac
case "$ntp_cv_gc_sections_runs" in
no) ntp_test_ntp_restrict="no" ;;
* ) ;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_test_ntp_restrict" >&5
$as_echo "$ntp_test_ntp_restrict" >&6; }
if test x$ntp_test_ntp_restrict = xyes; then
@@ -33350,6 +33365,10 @@ case "$ntp_ept:$cross:$host" in
no:0:*-*-solaris*) ;;
*) ntp_test_ntp_scanner="yes" ;;
esac
case "$ntp_cv_gc_sections_runs" in
no) ntp_test_ntp_scanner="no" ;;
* ) ;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_test_ntp_scanner" >&5
$as_echo "$ntp_test_ntp_scanner" >&6; }
if test x$ntp_test_ntp_scanner = xyes; then
@@ -33369,6 +33388,10 @@ case "$ntp_ept:$cross:$host" in
no:0:*-*-solaris*) ;;
*) ntp_test_ntp_signd="yes" ;;
esac
case "$ntp_cv_gc_sections_runs" in
no) ntp_test_ntp_signd="no" ;;
* ) ;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_test_ntp_signd" >&5
$as_echo "$ntp_test_ntp_signd" >&6; }
if test x$ntp_test_ntp_signd = xyes; then
@@ -34151,7 +34174,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by ntp $as_me 4.2.8p13, which was
This file was extended by ntp $as_me 4.2.8p14, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -34218,7 +34241,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
ntp config.status 4.2.8p13
ntp config.status 4.2.8p14
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
+5 -7
View File
@@ -1,7 +1,7 @@
dnl NTP top-level configure.ac -*- Autoconf -*-
dnl
m4_include([sntp/m4/version.m4])
AC_PREREQ([2.61])
AC_PREREQ([2.68])
AC_INIT(
[ntp],
[VERSION_NUMBER],
@@ -42,13 +42,10 @@ ntp_configure_cache_version=20120806
NTP_CACHEVERSION([main], [$ntp_configure_cache_version])
AM_INIT_AUTOMAKE([1.10 foreign -Wall -Wno-gnu])
AM_INIT_AUTOMAKE([1.15 foreign -Wall -Wno-gnu])
AM_SILENT_RULES([yes])
dnl AM_SILENT_RULES req. automake 1.11. [yes] defaults V=0
m4_ifdef(
[AM_SILENT_RULES],
[AM_SILENT_RULES([yes])]
)
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
dnl the 'build' machine is where we run configure and compile
@@ -382,6 +379,7 @@ case "$host" in
esac
AC_CHECK_HEADERS([sys/stat.h sys/stream.h stropts.h sys/stropts.h sys/syssgi.h])
AC_CHECK_HEADERS([sys/systune.h sys/termios.h sys/tpro.h sys/wait.h])
AC_CHECK_FUNCS([waitpid])
case "$host" in
*-convex-*)
AC_CHECK_HEADERS([/sys/sync/queue.h /sys/sync/sema.h])
+7 -2
View File
@@ -55,8 +55,10 @@ the <a href="accopt.html">Access Control Support</a> page.</p>
</dl>
</dd>
<dt id="restrict"><tt>restrict [-4 | -6] default [ippeerlimit <i>num</i>]
[<i>flag</i>][...]<br> restrict source [ippeerlimit <i>num</i>]
[<i>flag</i>][...]<br> restrict <i>address</i> [mask <i>mask</i>]
[<i>flag</i>][...]</tt></dt>
<dt><tt>restrict source [ippeerlimit <i>num</i>]
[<i>flag</i>][...]</tt></dt>
<dt><tt>restrict <i>address</i> [mask <i>mask</i>]
[ippeerlimit <i>num</i>] [<i>flag</i>][...]</tt></dt>
<dd>The <tt><i>address</i></tt> argument expressed in IPv4 or IPv6 numeric
address form is the address of a host or network. Alternatively,
@@ -168,6 +170,9 @@ the <a href="accopt.html">Access Control Support</a> page.</p>
UDP port (123). A restrict line containing <tt>ntpport</tt> is
considered more specific than one with the same address and mask,
but lacking <tt>ntpport</tt>.</dd>
<dt><tt>serverresponse fuzz</tt></dt>
<dd>When reponding to server requests, fuzz the low order bits of
the <tt>reftime</tt>.</dd>
<dt><tt>version</tt></dt>
<dd>Deny packets that do not match the current NTP version.</dd>
</dl>
+17 -1
View File
@@ -10,7 +10,7 @@
<h3>Reference Clock Commands and Options</h3>
<img src="pic/stack1a.jpg" alt="gif" align="left">Master Time Facility at the <a href="http://www.eecis.udel.edu/%7emills/lab.html">UDel Internet Research Laboratory</a>
<p>Last update:
<!-- #BeginDate format:En2m -->11-Sep-2010 05:55<!-- #EndDate -->
<!-- #BeginDate format:En2m -->26-Sep-2019 06:34<!-- #EndDate -->
UTC</p>
<br clear="left">
<h4>Related Links</h4>
@@ -50,6 +50,22 @@
<dd>Specifies an ASCII string of from one to four characters which defines the reference identifier used by the driver. This string overrides the default identifier ordinarily assigned by the driver itself.</dd>
<dt><tt>flag1 flag2 flag3 flag4</tt></dt>
<dd>These four flags are used for customizing the clock driver. The interpretation of these values, and whether they are used at all, is a function of the particular driver. However, by convention <tt>flag4</tt> is used to enable recording monitoring data to the <tt>clockstats</tt> file configured with the <tt>filegen</tt> command. Additional information on the <tt>filegen</tt> command is on the <a href="monopt.html">Monitoring Options</a> page.</dd>
<dt><tt>minjitter <i>secs</i></tt></dt>
<dd>If the source has a jitter that cannot be sensibly estimated, because
it is not statistic jitter, the source will be detected as falseticker
sooner or later. This has been observed e.g. with the serial data of
certain GPS receivers. Enforcing a minimal jitter value avoids a too
low estimation, keeping the clock in the zoo while still detecting
higher jitter.
</dd><dd> Note: this changes the refclock samples and ends up in the
clock dispersion, not the clock jitter, despite being called jitter. To
see the modified values, check the NTP clock variable "filtdisp", not
"jitter".
</dd><dd>The falseticker problem can also be avoided by increasing <tt>tos
mindist</tt>, which extends the intersection interval, but that affects
the root dispersion and is intended for the case of multiple reference
clocks with reliable jitter that do not intersect otherwise.
</dd>
</dl>
</dd>
</dl>
+22 -9
View File
@@ -13,7 +13,7 @@
Walt Kelly</a>
<p>The chicken is getting configuration advice.</p>
<p>Last update:
<!-- #BeginDate format:En2m -->24-Jul-2018 07:27<!-- #EndDate -->
<!-- #BeginDate format:En2m -->13-Feb-2020 10:08<!-- #EndDate -->
UTC</p>
<br clear="left">
<h4>Related Links</h4>
@@ -33,12 +33,12 @@ Walt Kelly</a>
support for the IPv6 address family is generated in addition to the default IPv4 address family. IPv6 addresses can be identified by the presence of colons &quot;:&quot; in the address field. IPv6 addresses can be used almost everywhere where IPv4 addresses can be used, with the exception of reference clock addresses, which are always IPv4. Note that in contexts where a host name is expected, a <tt>-4</tt> qualifier preceding the host name forces DNS resolution to the IPv4 namespace, while a <tt>-6</tt> qualifier forces DNS resolution to the IPv6 namespace.</p>
<h4 id="command">Server Commands</h4>
<p>Unless noted otherwise, further information about these commands is on the <a href="assoc.html">Association Management</a> page.</p><dl>
<dt id="server"><tt>server <i>address</i> [options ...]</tt><br>
<tt>peer <i>address</i> [options ...]</tt><br>
<tt>broadcast <i>address</i> [options ...]</tt><br>
<tt>manycastclient <i>address</i> [options ...]</tt><br>
<tt>pool <i>address</i> [options ...]</tt><br>
<tt>unpeer [<i>address</i> | <i>associd</i>]</tt></dt>
<dt id="server"><tt>server <i>address</i> [options ...]</tt></dt>
<dt><tt>peer <i>address</i> [options ...]</tt></dt>
<dt><tt>broadcast <i>address</i> [options ...]</tt></dt>
<dt><tt>manycastclient <i>address</i> [options ...]</tt></dt>
<dt><tt>pool <i>address</i> [options ...]</tt></dt>
<dt><tt>unpeer [<i>address</i> | <i>associd</i>]</tt></dt>
<dd>These commands specify the remote server name or address to be used and the mode in which to operate. The <i>address</i> can be either a DNS name or a IPv4 or IPv6 address in standard notation. In general, multiple commands of each type can be used for different server and peer addresses or multicast groups.
<dl>
<dt><tt>server</tt></dt>
@@ -67,8 +67,14 @@ Walt Kelly</a>
<dt><tt>ident</tt> <em><tt>group</tt></em></dt>
<dd>Specify the group name for the association. See the <a href="autokey.html">Autokey Public-Key Authentication</a> page for further information.</dd>
<dt><tt>key</tt> <i><tt>key</tt></i></dt>
<dd>Send and receive packets authenticated by the symmetric key scheme described in the <a href="authentic.html">Authentication Support</a> page. The <i><tt>key</tt></i> specifies the key identifier with values from 1 to 65535, inclusive. This option is mutually exclusive with the <tt>autokey</tt> option.</dd> <dt><tt>minpoll <i>minpoll<br>
</i></tt><tt>maxpoll <i>maxpoll</i></tt></dt>
<dd>Send and receive packets authenticated by the symmetric key scheme
described in the <a href="authentic.html">Authentication Support</a>
page. The <i><tt>key</tt></i> specifies the key identifier with values
from 1 to 65535, inclusive. This option is mutually exclusive with
the <tt>autokey</tt>
option.</dd>
<dt><tt>minpoll <i>minpoll</i></tt></dt>
<dt><tt>maxpoll <i>maxpoll</i></tt></dt>
<dd>These options specify the minimum and maximum poll intervals for NTP messages, in seconds as a power of two. The maximum poll interval defaults to 10 (1024 s), but can be increased by the <tt>maxpoll</tt> option to an upper limit of 17 (36 hr). The minimum poll interval defaults to 6 (64 s), but can be decreased by the <tt>minpoll</tt> option to a lower limit of 3 (8 s). Additional information about this option is on the <a href="poll.html">Poll Program</a> page.</dd>
<dt><tt>mode <i>option</i></tt></dt>
<dd>Pass the <tt><i>option</i></tt> to a reference clock driver, where <tt><i>option</i></tt> is an integer in the range from 0 to 255, inclusive. This option is valid only with type r addresses.</dd>
@@ -87,6 +93,13 @@ Walt Kelly</a>
outgoing NTP packets. Versions 1-4 are the choices, with version 4 the default.</dd>
<dt><tt>xleave</tt></dt>
<dd>Operate in interleaved mode (symmetric and broadcast modes only). Further information is on the <a href="xleave.html">NTP Interleaved Modes</a> page.</dd>
<dt><tt>xmtnonce</tt></dt>
<dd>Allowed in the server and pool modes, this flag causes the
client to put a random number nonce in the transmit timestamp of
its outgoing packet. Since the server will reply copying the
incoming transmit timestamp to the outgoing origin timestamp, this
flag provides extra security for the loopback test, at the expense
of the server having no idea what time the client thinks it is.</dd>
</dl>
<h4 id="aux">Auxiliary Commands</h4>
<dl>
+2 -3
View File
@@ -3,14 +3,13 @@
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<title>Copyright Notice</title>
<!-- Changed by: Harlan Stenn, 10-Mar-2014 -->
<link href="scripts/style.css" type="text/css" rel="stylesheet">
</head>
<body>
<h3>Copyright Notice</h3>
<img src="pic/sheepb.jpg" alt="jpg" align="left"> "Clone me," says Dolly sheepishly.
<p>Last update:
<!-- #BeginDate format:En2m -->2-Jan-2017 11:58<!-- #EndDate -->
<!-- #BeginDate format:En2m -->4-Feb-2020 23:47<!-- #EndDate -->
UTC</p>
<br clear="left">
</p>
@@ -39,7 +38,7 @@
<pre>
***********************************************************************
* *
* Copyright (c) Network Time Foundation 2011-2017 *
* Copyright (c) Network Time Foundation 2011-2020 *
* *
* All Rights Reserved *
* *
+19 -18
View File
@@ -4,12 +4,13 @@
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<meta name="generator" content="HTML Tidy, see www.w3.org">
<title>Clock Discipline Algorithm</title>
<!-- Changed by: stenn, 03-Jan-2020 -->
<link href="scripts/style.css" type="text/css" rel="stylesheet">
</head>
<body>
<h3>Clock Discipline Algorithm</h3>
<p>Last update:
<!-- #BeginDate format:En2m -->10-Mar-2014 05:03<!-- #EndDate -->
<!-- #BeginDate format:En2m -->3-Jan-2020 02:12<!-- #EndDate -->
UTC</p>
<h4>Table of Contents</h4>
<ul>
@@ -20,29 +21,29 @@
</ul>
<hr>
<h4 id="intro">General Overview</h4>
<p>At the heart of the NTP specification and reference implementation is the clock discipline algorithm, which is best described as an adaptive parameter, hybrid phase/frequency-lock feedback loop. It is an intricately crafted algorithm that automatically adapts for optimum performance while minimizing network overhead. Operation is in two modes, phase-lock loop (PLL), which is used at poll intervals below the Allan intercept, by default 2048 s, and frequency-lock loop (FLL), which is used above that.</p>
<p>At the heart of the NTP specification and reference implementation is the clock discipline algorithm, which is best described as an adaptive parameter, hybrid phase/frequency-lock feedback loop. It is an intricately crafted algorithm that automatically adapts for optimum performance while minimizing network overhead. Operation is in two modes, phase-lock loop (PLL), which is used at poll intervals below the Allan intercept, by default 2048 s, and frequency-lock loop (FLL), which is used above that.</p>
<div align="center"> <img src="pic/discipline.gif" alt="gif">
<p>Figure 1. Clock Discipline Algorithm</p>
</div>
<h4 id="pll">Clock Discipline Operations</h4>
<p>A block diagram of the clock discipline is shown in Figure 1. The timestamp of a reference clock or remote server is compared with the timestamp of the system clock, represented as a variable frequency oscillator (VFO), to produce a raw offset sample <em>V<sub>d</sub></em>. Offset samples are processed by the clock filter to produce a filtered update <em>V<sub>s</sub></em>. The loop filter implements a type-2 proportional-integrator controller (PIC). The PIC can minimize errors in both time and frequency using predictors <em>x</em> and <em>y</em>, respectively. The clock adjust process samples these predictors once each second for the daemon discipline or once each tick interrupt for the kernel discipline to produce the system clock update <em>V<sub>c</sub></em>.</p>
<p>In PLL mode the frequency predictor is an integral of the offset over past updates, while the phase predictor is the offset amortized over time in order to avoid setting the clock backward. In FLL mode the phase predictor is not used, while the frequency predictor is similar to the NIST <em>lockclock</em> algorithm. In this algorithm, the frequency predictor is computed as a fraction of the current offset divided by the time since the last update in order to minimize the offset at the next update.</p>
<p>The discipline response in PLL mode is determined by the <em>time constant</em>, which results in a &quot;stiffness&quot; depending on the jitter of the available sources and the wander of the system clock oscillator. The scaled time constant is also used as the poll interval described on the <a href="poll.html">Poll Program</a> page. However, in NTP symmetric mode, each peer manages its own poll interval and the two might not be the same. In such cases either peer uses the minimum of its own poll interval and that of the other peer, which is included in the NTP packet header.</p>
<p>A block diagram of the clock discipline is shown in Figure 1. The timestamp of a reference clock or remote server is compared with the timestamp of the system clock, represented as a variable frequency oscillator (VFO), to produce a raw offset sample <em>V<sub>d</sub></em>. Offset samples are processed by the clock filter to produce a filtered update <em>V<sub>s</sub></em>. The loop filter implements a type-2 proportional-integrator controller (PIC). The PIC can minimize errors in both time and frequency using predictors <em>x</em> and <em>y</em>, respectively. The clock adjust process samples these predictors once each second for the daemon discipline or once each tick interrupt for the kernel discipline to produce the system clock update <em>V<sub>c</sub></em>.</p>
<p>In PLL mode the frequency predictor is an integral of the offset over past updates, while the phase predictor is the offset amortized over time in order to avoid setting the clock backward. In FLL mode the phase predictor is not used, while the frequency predictor is similar to the NIST <em>lockclock</em> algorithm. In this algorithm, the frequency predictor is computed as a fraction of the current offset divided by the time since the last update in order to minimize the offset at the next update.</p>
<p>The discipline response in PLL mode is determined by the <em>time constant</em>, which results in a &quot;stiffness&quot; depending on the jitter of the available sources and the wander of the system clock oscillator. The scaled time constant is also used as the poll interval described on the <a href="poll.html">Poll Program</a> page. However, in NTP symmetric mode, each peer manages its own poll interval and the two might not be the same. In such cases either peer uses the minimum of its own poll interval and that of the other peer, which is included in the NTP packet header.</p>
<h4 id="loop">Loop Dynamics</h4>
<p> It is necessary to verify that the clock discipline algorithm is stable and satisfies the Nyquist criterion, which requires that the sampling rate be at least twice the bandwidth. In this case the bandwidth can be approximated by the reciprocal of the time constant. In the NTP specification and reference implementation, time constants and poll intervals are expressed as exponents of 2. By construction, the time constant exponent is five times the poll interval exponent. Thus, the default poll exponent of 6 corresponds to a poll interval of 64 s and a time constant of 2048 s. A change in the poll interval changes the time constant by a corresponding amount.. The Nyquist criterion requires the sample interval to be not more than half the time constant or 1024 s. The clock filter guarantees at least one sample in eight poll intervals, so the sample interval is not more than 512 s. This would be described as oversampling by a factor of two. Finally, the PLL parameters have been chosen for a damping factor of 2, which results in a much faster risetime than with critical damping, but results in modest overshoot of 6 percent.</p>
<p> It is important to understand how the dynamics of the PLL are affected by the time constant and poll interval. At the default poll interval of 64 s and a step offset change of 100 ms, the time response crosses zero in about 50 min and overshoots about 6 ms, as per design. Ordinarily, a step correction would causes a temporary frequency surge of about 5 PPM, which along with the overshoot slowly dissipates over a few hours.</p>
<p>However, the clock state machine used with the discipline algorithm avoids this transient at startup. It does this using a previously saved frequency file, if present, or by measuring the oscillator frequency, if not. It then quickly amortizes the residual offset at startup without affecting the oscillator frequency. In this way the offset error is less than 0.5 ms within 5 min, if the file is present, and within 10 min if not. See the <a href="clock.html">Clock State Machine</a> page for further details.</p>
<p>Since the PLL is linear, the response with different offset step amplitudes and poll intervals has the same characteristic shape, but scaled differently in amplitude and time. The response scales exactly with step amplitude, so that the response to a 10-ms step has the same shape as at 64 s, but with amplitude compressed by one-tenth. The response scales exactly with poll interval, so that response at a poll interval of 8 s has the same shape as at 64 s, but with time compressed by one-eighth.</p>
<p>The optimum time constant, and thus the poll interval, depends on the network time jitter and the oscillator frequency wander. Errors due to jitter decrease as the time constant increases, while errors due to wander decrease as the time constant decreases. For typical Internet paths, the two error characteristics intersect at a point called the <em>Allan intercept</em>, which represents the optimum time constant. With a compromise Allan intercept of 2048 s, the optimum poll interval is about 64 s, which corresponds to a compromise poll exponent of 6. For fast LANs with modern computers, the Allan intercept is somewhat lower at around 512 s, so a compromise poll exponent of 4 (16 s) is appropriate. An intricate, heuristic algorithm is used to manage the actual poll interval within a specified range. Details are on the <a href="poll.html">Poll Program</a> page.</p>
<p>In the NTPv4 specification and reference implementation a state machine is used to manage the system clock under exceptional conditions, as when the daemon is first started or when encountering severe network congestion. In extreme cases not likely to be encountered in normal operation, the system time can be stepped forward or backward more than 128 ms. Further details are on the <a href="clock.html">Clock State Machine</a> page.</p>
<p> It is necessary to verify that the clock discipline algorithm is stable and satisfies the Nyquist criterion, which requires that the sampling rate be at least twice the bandwidth. In this case the bandwidth can be approximated by the reciprocal of the time constant. In the NTP specification and reference implementation, time constants and poll intervals are expressed as exponents of 2. By construction, the time constant exponent is five times the poll interval exponent. Thus, the default poll exponent of 6 corresponds to a poll interval of 64 s and a time constant of 2048 s. A change in the poll interval changes the time constant by a corresponding amount.. The Nyquist criterion requires the sample interval to be not more than half the time constant or 1024 s. The clock filter guarantees at least one sample in eight poll intervals, so the sample interval is not more than 512 s. This would be described as oversampling by a factor of two. Finally, the PLL parameters have been chosen for a damping factor of 2, which results in a much faster risetime than with critical damping, but results in modest overshoot of 6 percent.</p>
<p> It is important to understand how the dynamics of the PLL are affected by the time constant and poll interval. At the default poll interval of 64 s and a step offset change of 100 ms, the time response crosses zero in about 50 min and overshoots about 6 ms, as per design. Ordinarily, a step correction would causes a temporary frequency surge of about 5 PPM, which along with the overshoot slowly dissipates over a few hours.</p>
<p>However, the clock state machine used with the discipline algorithm avoids this transient at startup. It does this using a previously saved frequency file, if present, or by measuring the oscillator frequency, if not. It then quickly amortizes the residual offset at startup without affecting the oscillator frequency. In this way the offset error is less than 0.5 ms within 5 min, if the file is present, and within 10 min if not. See the <a href="clock.html">Clock State Machine</a> page for further details.</p>
<p>Since the PLL is linear, the response with different offset step amplitudes and poll intervals has the same characteristic shape, but scaled differently in amplitude and time. The response scales exactly with step amplitude, so that the response to a 10-ms step has the same shape as at 64 s, but with amplitude compressed by one-tenth. The response scales exactly with poll interval, so that response at a poll interval of 8 s has the same shape as at 64 s, but with time compressed by one-eighth.</p>
<p>The optimum time constant, and thus the poll interval, depends on the network time jitter and the oscillator frequency wander. Errors due to jitter decrease as the time constant increases, while errors due to wander decrease as the time constant decreases. For typical Internet paths, the two error characteristics intersect at a point called the <em>Allan intercept</em>, which represents the optimum time constant. With a compromise Allan intercept of 2048 s, the optimum poll interval is about 64 s, which corresponds to a compromise poll exponent of 6. For fast LANs with modern computers, the Allan intercept is somewhat lower at around 512 s, so a compromise poll exponent of 4 (16 s) is appropriate. An intricate, heuristic algorithm is used to manage the actual poll interval within a specified range. Details are on the <a href="poll.html">Poll Program</a> page.</p>
<p>In the NTPv4 specification and reference implementation a state machine is used to manage the system clock under exceptional conditions, as when the daemon is first started or when encountering severe network congestion. In extreme cases not likely to be encountered in normal operation, the system time can be stepped forward or backward more than 128 ms. Further details are on the <a href="clock.html">Clock State Machine</a> page.</p>
<h4 id="house">Clock Initialization and Management</h4>
<p>If left running continuously, an NTP client on a fast LAN in a home or office environment can maintain synchronization nominally within one millisecond. When the ambient temperature variations are less than a degree Celsius, the clock oscillator frequency is disciplined to within one part per million (PPM), even when the clock oscillator native frequency offset is 100 PPM or more.</p>
<p> For laptops and portable devices when the power is turned off, the battery backup clock offset error can increase as much as one second per day. When power is restored after several hours or days, the clock offset and oscillator frequency errors must be resolved by the clock discipline algorithm, but this can take several hours without specific provisions.</p>
<p> The provisions described in this section insure that, in all but pathological situations, the startup transient is suppressed to within nominal levels in no more than five minutes after a warm start or ten minutes after a cold start. Following is a summary of these provisions. A detailed discussion of these provisions is on the <a href="clock.html">Clock State Machine</a> page.</p>
<p> The reference implementation measures the clock oscillator frequency and updates a frequency file at intervals of one hour or more, depending on the measured frequency wander. This design is intended to minimize write cycles in NVRAM that might be used in a laptop or portable device. In a warm start, the frequency is initialized from this file, which avoids a possibly lengthy convergence time. In a cold start when no frequency file is available, the reference implementation first measures the oscillator frequency over a five-min interval. This generally results in a residual frequency error less than 1 PPM. The measurement interval can be changed using the <tt>stepout</tt> option of the <a href="miscopt.html#tinker"><tt>tinker</tt></a> command.</p>
<p>In order to reduce the clock offset error at restart, the reference implementation mext disables oscillator frequency discipline and enables clock offset discipline with a small time constant. This is designed to quickly reduce the clock offset error without causing a frequency surge. This configuration is continued for an interval of five-min, after which the clock offset error is usually no more than a millisecond. The measurement interval can be changed using the <tt>stepout</tt> option of the <a href="miscopt.html#tinker"><tt>tinker</tt></a> command.</p>
<p>Another concern at restart is the time necessary for the select and cluster algorithms to refine and validate the initial clock offset estimate. Normally, this takes several updates before setting the system clock. As the default minimum poll interval in most configurations is about one minute, it can take several minutes before setting the system clock. The <tt>iburst</tt> option of the <a href="confopt.html#burst"><tt>server</tt></a> command changes the behavior at restart and is recommended for client/server configurations. When this option is enabled, the client sends a volley of six requests at intervals of two seconds. This usually insures a reliable estimate is available in about ten seconds before setting the clock. Once this initial volley is complete, the procedures described above are executed.</p>
<p>As a result of the above considerations, when a backup source, such as the local clock driver, ACTS modem driver or orphan mode is included in the system configuration, it may happen that one or more of them are selectable before one or more of the regular sources are selectable. When backup sources are included in the configuration, the reference implementation waits an interval of several minutes without regular sources before switching to backup sources. This is generally enough to avoid startup transients due to premature switching to backup sources. The interval can be changed using the <tt>orphanwait</tt> option of the <a href="miscopt.html#tos"><tt>tos</tt></a> command.</p>
<p>If left running continuously, an NTP client on a fast LAN in a home or office environment can maintain synchronization nominally within one millisecond. When the ambient temperature variations are less than a degree Celsius, the clock oscillator frequency is disciplined to within one part per million (PPM), even when the clock oscillator native frequency offset is 100 PPM or more.</p>
<p> For laptops and portable devices when the power is turned off, the battery backup clock offset error can increase as much as one second per day. When power is restored after several hours or days, the clock offset and oscillator frequency errors must be resolved by the clock discipline algorithm, but this can take several hours without specific provisions.</p>
<p> The provisions described in this section insure that, in all but pathological situations, the startup transient is suppressed to within nominal levels in no more than five minutes after a warm start or ten minutes after a cold start. Following is a summary of these provisions. A detailed discussion of these provisions is on the <a href="clock.html">Clock State Machine</a> page.</p>
<p> The reference implementation measures the clock oscillator frequency and updates a frequency file at intervals of one hour or more, depending on the measured frequency wander. This design is intended to minimize write cycles in NVRAM that might be used in a laptop or portable device. In a warm start, the frequency is initialized from this file, which avoids a possibly lengthy convergence time. In a cold start when no frequency file is available, the reference implementation first measures the oscillator frequency over a five-min interval. This generally results in a residual frequency error less than 1 PPM. The measurement interval can be changed using the <tt>stepout</tt> option of the <a href="miscopt.html#tinker"><tt>tinker</tt></a> command.</p>
<p>In order to reduce the clock offset error at restart, the reference implementation next disables oscillator frequency discipline and enables clock offset discipline with a small time constant. This is designed to quickly reduce the clock offset error without causing a frequency surge. This configuration is continued for an interval of five-min, after which the clock offset error is usually no more than a millisecond. The measurement interval can be changed using the <tt>stepout</tt> option of the <a href="miscopt.html#tinker"><tt>tinker</tt></a> command.</p>
<p>Another concern at restart is the time necessary for the select and cluster algorithms to refine and validate the initial clock offset estimate. Normally, this takes several updates before setting the system clock. As the default minimum poll interval in most configurations is about one minute, it can take several minutes before setting the system clock. The <tt>iburst</tt> option of the <a href="confopt.html#burst"><tt>server</tt></a> command changes the behavior at restart and is recommended for client/server configurations. When this option is enabled, the client sends a volley of six requests at intervals of two seconds. This usually insures a reliable estimate is available in about ten seconds before setting the clock. Once this initial volley is complete, the procedures described above are executed.</p>
<p>As a result of the above considerations, when a backup source, such as the local clock driver, ACTS modem driver or orphan mode is included in the system configuration, it may happen that one or more of them are selectable before one or more of the regular sources are selectable. When backup sources are included in the configuration, the reference implementation waits an interval of several minutes without regular sources before switching to backup sources. This is generally enough to avoid startup transients due to premature switching to backup sources. The interval can be changed using the <tt>orphanwait</tt> option of the <a href="miscopt.html#tos"><tt>tos</tt></a> command.</p>
<hr>
<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
</body>
+161 -57
View File
@@ -1,7 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>Generic NMEA GPS Receiver</title>
<!-- Changed by: Harlan &, 31-Mar-2014 -->
<!-- Changed by: Pearly &, 04-Feb-2019 -->
<link href="scripts/style.css" type="text/css" rel="stylesheet">
<style type="text/css">
table.dlstable { font-size:85%; }
@@ -13,7 +13,7 @@
<body>
<h3>Generic NMEA GPS Receiver</h3>
<p>Last update:
<!-- #BeginDate format:En2m -->31-Mar-2014 03:55<!-- #EndDate -->
<!-- #BeginDate format:En2m -->13-Jan-2020 07:12<!-- #EndDate -->
UTC</p>
<hr>
<h4>Synopsis</h4>
@@ -41,6 +41,9 @@
second insertion in UTC.&nbsp; To avoid problems mixing UTC and GPS
timescales, the driver disables processing of UTC sentences
once <tt>$GPZDG</tt> is received.
<br>
<strong>Caveat:</strong> Please see <a href="#talkerids">Talker
IDs</a> when using non-GPS or multi-system receivers.
</p>
<p>
The driver expects the receiver to be set up to transmit at least one
@@ -80,7 +83,14 @@
</tr><tr>
<td class="ttf">$GPZDG,GPSTIME,DD,MM,YYYY,AA.BB,V*CS&lt;cr&gt;&lt;lf&gt;</td>
<td>Accord</td>
</tr>
</tr><tr>
</tr><tr>
<td class="ttf">$PGRMF,gpsWk,gpsTow,DATE,UTC,LEAPS,LAT,LAT_REF,LON,LON_REF,TYPE,MODE,SPD,HDOP,TDOP*CS&lt;cr&gt;&lt;lf&gt;</td>
<td>Garmin</td>
</tr><tr>
<td class="ttf">$PUBX,04,UTC,DATE,utcTow,utcWk,LEAPS,clkBias,clkDrift,tpGran,*CS&lt;cr&gt;&lt;lf&gt;</td>
<td>UBLOX</td>
</tr>
</tbody></table></p>
<p><table class="dlstable" border="1">
@@ -91,59 +101,17 @@
</tr>
<tr>
<td class="ttf">UTC</td>
<td>Time of day on UTC timescale. Hours, minutes and seconds [fraction (opt.)]. (hhmmss[.fff])</td>
</tr><tr>
<td class="ttf">POS_STAT</td>
<td>Position status. (A = Data valid, V = Data invalid)</td>
</tr><tr>
<td class="ttf">LAT</td>
<td>Latitude (llll.ll)</td>
</tr><tr>
<td class="ttf">LAT_REF</td>
<td>Latitude direction. (N = North, S = South)</td>
</tr><tr>
<td class="ttf">LON</td>
<td>Longitude (yyyyy.yy)</td>
</tr><tr>
<td class="ttf">LON_REF</td>
<td>Longitude direction (E = East, W = West)</td>
</tr><tr>
<td class="ttf">SPD</td>
<td>Speed over ground. (knots) (x.x)</td>
</tr><tr>
<td class="ttf">HDG</td>
<td>Heading/track made good (degrees True) (x.x)</td>
</tr><tr>
<td class="ttf">DATE</td>
<td>Date (ddmmyy)</td>
</tr><tr>
<td class="ttf">MAG_VAR</td>
<td>Magnetic variation (degrees) (x.x)</td>
</tr><tr>
<td class="ttf">MAG_REF</td>
<td>Magnetic variation (E = East, W = West)</td>
</tr><tr>
<td class="ttf">FIX_MODE</td>
<td>Position Fix Mode (0 = Invalid, &gt;0 = Valid)</td>
</tr><tr>
<td class="ttf">SAT_USED</td>
<td>Number of Satellites used in solution</td>
</tr><tr>
<td class="ttf">HDOP</td>
<td>Horizontal Dilution of Precision</td>
</tr><tr>
<td class="ttf">ALT</td>
<td>Antenna Altitude</td>
</tr><tr>
<td class="ttf">ALT_UNIT</td>
<td>Altitude Units (Metres/Feet)</td>
</tr><tr>
<td class="ttf">GEO</td>
<td>Geoid/Elipsoid separation</td>
<td class="ttf">DATE</td>
<td>Date (ddmmyy)</td>
</tr><tr>
<td class="ttf">G_UNIT</td>
<td>Geoid units (M/F)</td>
<td class="ttf">DD</td>
<td>Day of the month (1-31)</td>
</tr><tr>
<td class="ttf">D_AGE</td>
<td>Age of last DGPS Fix</td>
@@ -151,17 +119,77 @@
<td class="ttf">D_REF</td>
<td>Reference ID of DGPS station</td>
</tr><tr>
<td class="ttf">GPSTIME</td>
<td>Time of day on GPS timescale. Hours, minutes and seconds [fraction (opt.)]. (hhmmss[.f])</td>
<td class="ttf">FIX_MODE</td>
<td>Position Fix Mode (0 = Invalid, &gt;0 = Valid)</td>
</tr><tr>
<td class="ttf">DD</td>
<td>Day of the month (1-31)</td>
<td class="ttf">GEO</td>
<td>Geoid/Elipsoid separation</td>
</tr><tr>
<td class="ttf">GPSTIME</td>
<td>Time of day on GPS timescale. Hours, minutes and seconds [fraction (opt.)] (hhmmss[.f])</td>
</tr><tr>
<td class="ttf">gpsTow</td>
<td>GPS week time, seconds since start of GPS week (0..604799)</td>
</tr><tr>
<td class="ttf">gpsWk</td>
<td>Week number in the GPS time scale (may exceed 1024)</td>
</tr><tr>
<td class="ttf">G_UNIT</td>
<td>Geoid units (M/F)</td>
</tr><tr>
<td class="ttf">HDG</td>
<td>Heading/track made good (degrees True) (x.x)</td>
</tr><tr>
<td class="ttf">HDOP</td>
<td>Horizontal Dilution of Precision</td>
</tr><tr>
<td class="ttf">LAT</td>
<td>Latitude (llll.ll)</td>
</tr><tr>
<td class="ttf">LAT_REF</td>
<td>Latitude direction (N = North, S = South)</td>
</tr><tr>
<td class="ttf">LEAPS</td>
<td>Leap seconds or difference between GPS time scale and UTC</td>
</tr><tr>
<td class="ttf">LON</td>
<td>Longitude (yyyyy.yy)</td>
</tr><tr>
<td class="ttf">LON_REF</td>
<td>Longitude direction (E = East, W = West)</td>
</tr><tr>
<td class="ttf">MAG_REF</td>
<td>Magnetic variation (E = East, W = West)</td>
</tr><tr>
<td class="ttf">MAG_VAR</td>
<td>Magnetic variation (degrees) (x.x)</td>
</tr><tr>
<td class="ttf">MM</td>
<td>Month of the year (1-12)</td>
</tr><tr>
<td class="ttf">POS_STAT</td>
<td>Position status. (A = Data valid, V = Data invalid)</td>
</tr><tr>
<td class="ttf">SAT_USED</td>
<td>Number of Satellites used in solution</td>
</tr><tr>
<td class="ttf">SPD</td>
<td>Speed over ground. (knots) (x.x)</td>
</tr><tr>
<td class="ttf">UTC</td>
<td>Time of day on UTC timescale. Hours, minutes and seconds [fraction (opt.)] (hhmmss[.fff])</td>
</tr><tr>
<td class="ttf">YYYY</td>
<td>Year</td>
</tr><tr>
<td class="ttf">WEEK</td>
<td>GPS week (0-1023)</td>
</tr><tr>
<td class="ttf">WSEC</td>
<td>Seconds since start of week (0-604799)</td>
</tr><tr>
<td class="ttf">LEAP</td>
<td>GPS leap seconds, that is, seconds ahead of UTC</td>
</tr><tr>
<td class="ttf">AA.BB</td>
<td>Denotes the signal strength (should be &lt; 05.00)</td>
@@ -181,6 +209,36 @@
</tbody></table></p>
<h4><a name="talkerids"/>NMEA Talker IDs</h4>
<p>
GNSS receivers use a distinct talker ID for the GNSS they
process. Receivers capable of tracking different systems at the same time
can emit <tt>$GPRMC</tt> (GPS), <tt>$GLRMC</tt> (GLONASS),
<tt>$GARMC</tt> (Galileo), <tt>$GNRMC</tt> (generic/combined) and others
all in one data stream.
</p><p>
The driver supports this to a certain degree by ignoring the
talker ID on the standard sentences RMC, GLL, GGA, ZDA and ZDG. (It
possibly should not do that on the latter, but for now, that's the way
it is.) So whenever <tt>$GPRMC</tt> is mentioned in this document,
substitute any possible talker ID your receiver might emit -- it will
still match.
</p><p>
This approach has a drawback. It is easy to use for single-system
receivers, but it cannot separate the data streams for multi-system
receiver modules. It is therefore undefined which GNSS actually
provides the data, and this can lead to strange behavior. This is
especially true if the different GNSS provide very different signal
quality to the receiver; the driver is not able to cherry-pick the best
source and might actually end up in using the worst available. It is
therefore recommended to set up such a receiver to either use just a
single GNSS (which would defeat its purpose) or to emit only the
combined data, which usually has the <tt>GN</tt> talker ID defined by
the NMEA standard.
<p>
<h4>The 'mode' byte</h4>
<p>
@@ -202,7 +260,7 @@
<td align="center">0</td>
<td align="center">1</td>
<td align="center">1</td>
<td>process <tt>$GPMRC</tt></td>
<td>process <tt>$GPRMC</tt></td>
</tr><tr>
<td align="center">1</td>
<td align="center">2</td>
@@ -259,9 +317,14 @@
<td align="center">0x100</td>
<td>process <tt>$PGRMF</tt></td>
</tr><tr>
<td align="center">9-15</td>
<td align="center">9</td>
<td align="center">512</td>
<td align="center">0x200</td>
<td>process <tt>$PUBX,04</tt></td>
</tr><tr>
<td align="center">10-15</td>
<td align="center"></td>
<td align="center">0xFE00</td>
<td align="center">0xFC00</td>
<td>reserved - leave 0</td>
</tr><tr>
<td align="center">16</td>
@@ -269,6 +332,24 @@
<td align="center">0x10000</td>
<td>Append extra statistics to the clockstats line.
Details below.</td>
</tr><tr>
<td align="center">17</td>
<td align="center">131072</td>
<td align="center">0x20000</td>
<td>"Silent PPS" mode. Use the PPS channel (if enabled with
fudge flag 1) to get precise receive time stamps.
Do <em>not</em> set the PPS flag in the clock status, so the
clock is not considered as PPS peer.
</td>
</tr><tr>
<td align="center">18</td>
<td align="center">262144</td>
<td align="center">0x40000</td>
<td>Trust the date delivered via NMEA. Do this only if
you <em>really</em> trust the receiver!
See <a href="#datetrust">below</a>. <strong>Caveat:</strong>
This (hitherto undocumented) bit has moved!
</td>
</tr>
</tbody></table>
@@ -291,7 +372,7 @@
</li></ul>
The driver uses 4800 bits per second by default, but faster bitrates can
be selected using bits 4 to 6 of the mode field.
<p></p>
</p>
<p>
<strong>Caveat:</strong> Using higher line speeds does not necessarily
@@ -306,6 +387,29 @@
linespeed of 4800 bps or 9600 bps.
</p>
<h4><a name="datetrust"/>About distrusting NMEA date stamps</h4>
<p>
Trusting the calendar dates delivered via NMEA is a risky thing, and by
default these dates are handled with a huge dose of skepticism. Many
receivers deliver a correct calendar date for a period of just 1024 weeks,
with a starting point baked somewhere into their firmware. Beyond that,
they warp back to the begin of their era and simply provide wrong date
information. To battle this widely observed effect, the date delivered is
by default reduced to GPS time again and then (re-)mapped according to the
base date, either the implicit value or the value set via "tos basedate".
If the receiver can <em>really</em> be trusted to deliver the right date
(which is not impossible, just more expensive for the manufacturer), then
mode bit 18 can be used to bypass the era mapping. Setting this bit is
not needed under most circumstances, and setting it with an unreliable
receiver can have severe effects. Handle with care.
</p><p>
<strong>Note:</strong> This functionality was available for some time as
undocumented feature, with a different bit value. It was moved in the
process of becoming officially acknowledged to avoid excessive scattering
of the mode bit mask.
</p>
<h4>Monitor Data</h4>
<p>The last GPS sentence that is accepted or rejected is written to the
+68 -10
View File
@@ -11,7 +11,7 @@
<body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<h1><font size="+2">Trimble Palisade and Thunderbolt Receivers</font>
<p>Last update:
<!-- #BeginDate format:En2m -->21-Oct-2010 23:44<!-- #EndDate -->
<!-- #BeginDate format:En2m -->13-Sep-2019 08:07<!-- #EndDate -->
UTC</p>
<hr>
</h1>
@@ -69,13 +69,28 @@
</td>
<td><b>9600 baud, 8-bits, 1-stop, no parity</b></td>
</tr>
<tr>
<td>
<div align="right">
<tt><font size="+1">Serial I/O (Copernicus II):</font></tt></div>
</td>
<td><b>38400 baud, 8-bits, 1-stop, no parity</b></td>
</tr>
</table>
<h2><font size="+1">Description</font></h2>
The <b>refclock_palisade</b> driver supports <a href="http://www.trimble.com/products/ntp">Trimble Navigation's Palisade Smart Antenna GPS receiver</a>.<br>
Additional software and information about the Palisade GPS is available from: <a href="http://www.trimble.com/oem/ntp">http://www.trimble.com/oem/ntp</a>.<br>
Latest NTP driver source, executables and documentation is maintained at: <a href="ftp://ftp.trimble.com/pub/ntp">ftp://ftp.trimble.com/pub/ntp</a>
<p>This documentation describes version 7.12 of the GPS Firmware and version 2.46 (July 15, 1999) and later, of the driver source.<br>&nbsp;</p>
<p>This documentation describes version 7.12 of the GPS Firmware and version 2.46 (July 15, 1999) and later, of the driver source.</p>
<p>This documentation describes version 1 of the Thunderbolt Receiver Firmware, no tests have been made on further firmwares, please read "Notes on the Thunderbolt Receiver's Firmware" at the end of this documentation for more information.</p>
<p>This driver also supports the following receivers:</p>
<blockquote>
<p>Endrun Technologies Praecis NTP server with GPS</p>
<p>Trimble Acutime Gold smart antenna</p>
<p>Trimble Resolution family</p>
<p>Trimble ACE III</p>
<p>Trimble Copernicus II</p>
</blockquote>
<h2><font size="+1">Operating System Compatibility</font></h2>
The Palisade driver has been tested on the following software and hardware platforms:<br>&nbsp;
<center>
@@ -118,7 +133,7 @@
</tr>
</table>
</center><P>
<b>Attention</b>: Thunderbolt Receiver has not being tested on the previous software and hardware plataforms.
<b>Attention</b>: Other receiver types have not being tested on the previous software and hardware plataforms.
<h2><font size="+1">GPS Receiver</font></h2>
The Palisade GPS receiver is an 8-channel smart antenna, housing the GPS receiver, antenna and interface in a single unit, and is designed for rooftop deployment in static timing applications.
<p>Palisade generates a PPS synchronized to UTC within +/- 100 ns.&nbsp; The Palisade's external event input with 40 nanosecond resolution is utilized by the Palisade NTP driver for asynchronous precision time transfer.</p>
@@ -232,7 +247,41 @@
<tt># and set flag2 to turn off event polling.</tt><br>
<tt><a href="#flag2">fudge 127.127.29.0 flag2 1</a></tt><br>
<tt>#------------------------------------------------------------------------------</tt><br>&nbsp;</p>
Currently the Thunderbolt mode doesn't support event polling, the reasons are explained on the "Notes on the Thunderbolt Receiver's Firmware" section at the end of this documentation.
<h4>Resolution NTP Configuration file</h4>
<tt>#------------------------------------------------------------------------------</tt>
<p>Configuration without event polling:<br>
<tt>#------------------------------------------------------------------------------</tt><br>
<tt># The Primary reference</tt><br>
<tt>server 127.127.29.0 mode 5 # Trimble Resolution GPS (Stratum 1).</tt><br>
<tt># Set packet delay</tt><br>
<tt><a href="#time1">fudge 127.127.29.0 time1 0.410</a></tt><br>
<tt># and set flag2 to turn off event polling.</tt><br>
<tt><a href="#flag2">fudge 127.127.29.0 flag2 1</a></tt><br>
<tt>#------------------------------------------------------------------------------</tt><br>&nbsp;</p>
<h4>ACE III NTP Configuration file</h4>
<tt>#------------------------------------------------------------------------------</tt>
<p>Configuration with event polling:<br>
<tt>#------------------------------------------------------------------------------</tt><br>
<tt># The Primary reference</tt><br>
<tt>server 127.127.29.0 mode 6 # Trimble ACE III GPS (Stratum 1).</tt><br>
<tt># Set packet delay</tt><br>
<tt><a href="#time1">fudge 127.127.29.0 time1 0.720</a></tt><br>
<tt>#------------------------------------------------------------------------------</tt><br>&nbsp;</p>
<h4>Copernicus II NTP Configuration file</h4>
<tt>#------------------------------------------------------------------------------</tt>
<p>Configuration without event polling:<br>
<tt>#------------------------------------------------------------------------------</tt><br>
<tt># The Primary reference</tt><br>
<tt>server 127.127.29.0 mode 7 # Trimble Copernicus II GPS (Stratum 1).</tt><br>
<tt># Set packet delay</tt><br>
<tt><a href="#time1">fudge 127.127.29.0 time1 0.240</a></tt><br>
<tt># and set flag2 to turn off event polling.</tt><br>
<tt><a href="#flag2">fudge 127.127.29.0 flag2 1</a></tt><br>
<tt>#------------------------------------------------------------------------------</tt><br>&nbsp;</p>
Currently the Thunderbolt mode doesn't support event polling, the reasons are explained on the "Notes on the Thunderbolt Receiver's Firmware" section at the end of this documentation. The Resolution and Copernicus II modes require event polling to be disabled whereas the ACE III requires polling to be enabled.
<h2><a name="TimeTransfer"></a><font size="+1">Time Transfer and Polling</font></h2>
Time transfer to the NTP host is performed via the Palisade's comprehensive time packet output. The time packets are output once per second, and whenever an event timestamp is requested.
<p>The driver requests an event time stamp at the end of each polling interval, by pulsing the RTS (request to send) line on the serial port. The Palisade GPS responds with a time stamped event packet.</p>
@@ -269,7 +318,16 @@
<h2><font size="+1">Mode Parameter</font></h2>
<dl>
<dt><tt><font size="+1">mode <i>number</i></font></tt>
<dd>The mode parameter to the server command specifies the specific hardware this driver is for. The default is 0 for a normal Trimble Palisade. The other options are <b>1</b> for an <b>Endrun Praecis</b> in Trimble emulation mode, and <b>2</b> for the <b>Trimble Thunderbolt</b> GPS Disciplined Clock Receiver.
<dd>
The mode parameter to the server command specifies the specific hardware this driver is for. The default is 0 for a normal Trimble Palisade. The other options are:
<blockquote>
<p><b>1</b> for an <b>Endrun Praecis</b> in Trimble emulation mode</p>
<p><b>2</b> for the <b>Trimble Thunderbolt</b> GPS Disciplined Clock Receiver</p>
<p><b>3</b> for the <b>Acutime Gold</b> smart antenna</p>
<p><b>5</b> for <b>Trimble Resolution</b> devices</p>
<p><b>6</b> for the <b>Trimble ACE III</b> board</p>
<p><b>7</b> for the <b>Trimble Copernicus II</b> device</p>
</blockquote>
</dl>
<h2><font size="+1">DEFINEs</font></h2>
The following constants are defined in the driver source code. These defines may be modified to improve performance or adapt to new operating systems.<br>&nbsp;
@@ -290,16 +348,16 @@
<td>Accuracy of time transfer</td>
<td>1 microsecond</td>
</tr>
<tr>
<td>CURRENT_UTC</td>
<td>Valid GPS - UTC offset</td>
<td>13</td>
</tr>
<tr>
<td>SPEED232</td>
<td>Host RS-232 baud rate</td>
<td>B9600</td>
</tr>
<tr>
<td>SPEED232COP</td>
<td>Host RS-232 baud rate (Copernicus II mode)</td>
<td>B38400</td>
</tr>
<tr>
<td>TRMB_MINPOLL&nbsp;</td>
<td>Minimum polling interval</td>
+28 -5
View File
@@ -10,7 +10,7 @@
<img src="pic/boom3.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/~mills/pictures.html">from <i>Pogo</i>, Walt Kelly</a>
<p>We have three, now looking for more.</p>
<p>Last update:
<!-- #BeginDate format:En2m -->14-Oct-2017 08:34<!-- #EndDate -->
<!-- #BeginDate format:En2m -->11-Feb-2020 14:00<!-- #EndDate -->
UTC</p>
<br clear="left">
<h4>Related Links</h4>
@@ -63,8 +63,9 @@
<dd>This command allows additional configuration commands to be included from a separate file. Include files may be nested to a depth of five; upon reaching the end of any include file, command processing resumes in the previous configuration file. This option is useful for sites that run <tt>ntpd</tt> on multiple hosts, with (mostly) common options (e.g., a restriction list).</dd>
<dt id="interface"><tt>interface [listen | ignore | drop] [all | ipv4 | ipv6 | wildcard | <i>name</i> | <i>address</i>[/<i>prefixlen</i>]]</tt></dt>
<dd>This command controls which network addresses <tt>ntpd</tt> opens, and whether input is dropped without processing. The first parameter determines the action for addresses which match the second parameter. That parameter specifies a class of addresses, or a specific interface name, or an address. In the address case, <tt><i>prefixlen</i></tt> determines how many bits must match for this rule to apply. <tt>ignore</tt> prevents opening matching addresses, <tt>drop</tt> causes <tt>ntpd</tt> to open the address and drop all received packets without examination. Multiple <tt>interface</tt> commands can be used. The last rule which matches a particular address determines the action for it. <tt>interface</tt> commands are disabled if any <a href="ntpd.html#--interface"><tt>-I</tt></a>, <a href="ntpd.html#--interface"><tt>--interface</tt></a>, <a href="ntpd.html#--novirtualips"><tt>-L</tt></a>, or <a href="ntpd.html#--novirtualips"><tt>--novirtualips</tt></a> command-line options are used. If none of those options are used and no <tt>interface</tt> actions are specified in the configuration file, all available network addresses are opened. The <tt>nic</tt> command is an alias for <tt>interface</tt>.</dd>
<dt id="leapfile"><tt>leapfile <i>leapfile</i></tt></dt>
<dd>This command loads the IERS leapseconds file and initializes the leapsecond values for the next leapsecond time, expiration time and TAI offset. The file can be obtained directly from the IERS at <a href="https://hpiers.obspm.fr/iers/bul/bulc/ntp/leap-seconds.list">https://hpiers.obspm.fr/iers/bul/bulc/ntp/leap-seconds.list</a> or <a href="ftp://hpiers.obspm.fr/iers/bul/bulc/ntp/leap-seconds.list">ftp://hpiers.obspm.fr/iers/bul/bulc/ntp/leap-seconds.list</a>.</dd>
<dt id="leapfile"><tt>leapfile <i>leapfile</i> [checkhash|ignorehash]</tt></dt>
<dd>This command loads the IERS leapseconds file and initializes the leapsecond values for the next leapsecond time, expiration time and TAI offset. The file can be obtained directly from the IERS at <a href="https://hpiers.obspm.fr/iers/bul/bulc/ntp/leap-seconds.list">https://hpiers.obspm.fr/iers/bul/bulc/ntp/leap-seconds.list</a> or <a href="ftp://hpiers.obspm.fr/iers/bul/bulc/ntp/leap-seconds.list">ftp://hpiers.obspm.fr/iers/bul/bulc/ntp/leap-seconds.list</a>.
<tt>ignorehash</tt> instructs <tt>ntpd</tt> to ignore the hash signature on the file, <tt>checkhash</tt> (which is the default when omitted) needs a hash line in the file to be valid. Files without any hash signature are lodaed in both cases.</dd>
<dd>The <i>leapfile</i> is scanned when <tt>ntpd</tt> processes the <tt>leapfile</tt> directive or when <tt>ntpd</tt> detects that <i>leapfile</i> has changed. <tt>ntpd</tt> checks once a day to see if the <i>leapfile</i> has changed.</dd>
<dd>While not strictly a security function, the Autokey protocol provides means to securely retrieve the current or updated leapsecond values from a server.</dd>
<dt id="leapsmearinterval"><tt>leapsmearinterval <i>seconds</i></tt></dt>
@@ -108,6 +109,24 @@
For the ACTS modem driver (type 18), the arguments consist of a maximum of 10 telephone numbers used to dial USNO, NIST or European time services.
For the JJY driver (type 40 mode 100 - 180), the argument is one telephone number used to dial the telephone JJY service.
The Hayes command ATDT&nbsp;is normally prepended to the number, which can contain other modem control codes as well.</dd>
<dt id="pollskewlist"
><tt>pollskewlist</tt> <tt>[</tt><i>poll</i> <i>value</i><tt>
| </tt><i>value</i><tt>]</tt> <tt>...</tt> <tt>[default </tt><i>value</i><tt>
| </tt><i>value</i><tt>]</tt></dt>
<dd>Enable skewing of our poll requests to our servers.
<i>poll</i>
is a number between 3 and 17 inclusive, identifying a specific poll interval.
A poll interval is 2^n seconds in duration,
so a poll value of 3 corresponds to 8 seconds
and
a poll interval of 17 corresponds to
131,072 seconds, or about a day and a half.
The next two numbers must be between 0 and one-half of the poll interval,
inclusive.
The first number specifies how early the poll may start,
while
the second number specifies how late the poll may be delayed.
With no arguments, internally specified default values are chosen.</dd>
<dt id="reset"><tt>reset [allpeers] [auth] [ctl] [io] [mem] [sys] [timer]</tt></dt>
<dd>Reset one or more groups of counters maintained by ntpd and exposed by <tt>ntpq</tt> and <tt>ntpdc</tt>.</dd>
<dt id="rlimit"><tt>rlimit [memlock <i>Nmegabytes</i> | stacksize <i>N4kPages</i> | filenum <i>Nfiledescriptors</i>]</tt></dt>
@@ -147,12 +166,16 @@
<dd>Specifies the stepout threshold in seconds. The default without this command is 300 s. Since this option also affects the training and startup intervals, it should not be set less than the default. Further details are on the <a href="clock.html">Clock State Machine</a> page.</dd>
</dl>
</dd>
<dt id="tos"><tt>tos [basedate <i>date<i> | bcpollbstep <i>poll-gate</i> | beacon <i>beacon</i> | ceiling <i>ceiling</i> | cohort {0 | 1} | floor <i>floor</i> | maxclock <i>maxclock </i>| maxdist <i>maxdist</i> | minclock <i>minclock</i> | mindist <i>mindist </i>| minsane <i>minsane</i> | orphan <i>stratum</i> | orphanwait <em>delay</em>]</tt></dt>
<dt id="tos"><tt>tos [basedate <i>date</i> | bcpollbstep <i>poll-gate</i> | beacon <i>beacon</i> | ceiling <i>ceiling</i> | cohort {0 | 1} | floor <i>floor</i> | maxclock <i>maxclock </i>| maxdist <i>maxdist</i> | minclock <i>minclock</i> | mindist <i>mindist </i>| minsane <i>minsane</i> | orphan <i>stratum</i> | orphanwait <em>delay</em>]</tt></dt>
<dd>This command alters certain system variables used by the the clock selection and clustering algorithms. The default values of these variables have been carefully optimized for a wide range of network speeds and reliability expectations. Very rarely is it necessary to change the default values; but, some folks can't resist twisting the knobs. It can be used to select the quality and quantity of peers used to synchronize the system clock and is most useful in dynamic server discovery schemes. The options are as follows:</dd>
<dd>
<dl>
<dt><tt>basedate <i>date</i></tt></dt>
<dd>Set NTP era anchor. <tt><i>date</i></tt> is either a date in ISO8601 format (<i>YYYY-MM-DD<i>) or an integer giving the days since 1900-01-01, the start of the NTP epoch. <tt>ntpd</tt> will clamp the system time to an era starting with the begin of this this day (00:00:00Z), covering a range of 2<sup>32</sup> seconds or roughly 136 years. The default is the begin of the UNIX epoch, 1970-01-01.</dd>
<dd>Set NTP and GPS era anchor. <tt><i>date</i></tt> is either a date in ISO8601 format (<i>YYYY-MM-DD</i>) or an integer giving the days since 1900-01-01, the start of the NTP epoch. <tt>ntpd</tt> will clamp the system time to an era starting with the begin of this this day (00:00:00Z), covering a range of 2<sup>32</sup> seconds or roughly 136 years. The lowest accepted value is effectively 1970-01-02.<br>
The GPS era base is the next Sunday on or following the base date, but obviously not before 1980-01-06. GPS time stamps are mapped into the 1024 weeks following the GPS base.<br>
The default value is derived from the repository or build time stamp, minus 11 days. 1970-01-02 was chosen as lower bound so the <em>local</em> time is always after 1970-01-01,00:00. Some systems get into trouble if this is not the case.<p>
<b><u>ATTENTION:</u></b> If the system clock is before the effective (implied or specific) basedate, the system clock will be set to the base date once and immediately when <tt>ntpd</tt> starts. This helps systems that have lost time completely to recover. Though not noticeable under normal conditions, it <em>can</em> happen. Check the logs if starting <tt>ntpd</tt> causes sudden clock moves.
</dd>
<dt><tt>bcpollbstep <i>poll-gate</i></tt></dt>
<dd>This option will cause the client to delay believing backward time steps from a broadcast server for <tt>bcpollbstep</tt> poll intervals. NTP Broadcast networks are expected to be trusted, and if the server's time gets stepped backwards then it's desireable that the clients follow this change as soon as possible. However, in spite of various protections built-in to the broadcast protocol, it is possible that an attacker could perform a carefully-constructed replay attack and cause clients to erroneously step their clocks backward. If the risk of a successful broadcast replay attack is greater than the risk of the clients being out of sync in the event that there is a backward step on the broadcast time servers, this option may be used to cause the clients to delay beliveving backward time steps until <i>poll-gate</i> consecutive polls have been received. The default is 0, which means the client will accept these steps upon receipt. Any value from 0 to 4 can be specified.</dd>
<dt><tt>beacon <i>beacon</i></tt></dt>
+3
View File
@@ -25,6 +25,7 @@ noinst_HEADERS = \
ntp.h \
ntp_assert.h \
ntp_calendar.h \
ntp_calgps.h \
ntp_cmdargs.h \
ntp_config.h \
ntp_control.h \
@@ -46,6 +47,7 @@ noinst_HEADERS = \
ntp_md5.h \
ntp_net.h \
ntp_proto.h \
ntp_psl.h \
ntp_random.h \
ntp_refclock.h \
ntp_request.h \
@@ -76,6 +78,7 @@ noinst_HEADERS = \
timespecops.h \
timetoa.h \
timevalops.h \
timexsup.h \
trimble.h \
vint64ops.h \
$(NULL)
+3
View File
@@ -511,6 +511,7 @@ noinst_HEADERS = \
ntp.h \
ntp_assert.h \
ntp_calendar.h \
ntp_calgps.h \
ntp_cmdargs.h \
ntp_config.h \
ntp_control.h \
@@ -532,6 +533,7 @@ noinst_HEADERS = \
ntp_md5.h \
ntp_net.h \
ntp_proto.h \
ntp_psl.h \
ntp_random.h \
ntp_refclock.h \
ntp_request.h \
@@ -562,6 +564,7 @@ noinst_HEADERS = \
timespecops.h \
timetoa.h \
timevalops.h \
timexsup.h \
trimble.h \
vint64ops.h \
$(NULL)
+8 -2
View File
@@ -359,6 +359,7 @@ struct peer {
l_fp aorg; /* origin timestamp */
l_fp borg; /* alternate origin timestamp */
l_fp bxmt; /* most recent broadcast transmit timestamp */
l_fp nonce; /* Value of nonce we sent as the xmt stamp */
double offset; /* peer clock offset */
double delay; /* peer roundtrip delay */
double jitter; /* peer jitter (squares) */
@@ -466,6 +467,7 @@ struct peer {
# define FLAG_ASSOC 0x8000 /* autokey request */
#endif /* OPENSSL */
#define FLAG_TSTAMP_PPS 0x10000 /* PPS source provides absolute timestamp */
#define FLAG_LOOPNONCE 0x20000 /* Use a nonce for the loopback test */
/*
* Definitions for the clear() routine. We use memset() to clear
@@ -841,6 +843,7 @@ struct restrict_u_tag {
u_short rflags; /* restrict (accesslist) flags */
u_short mflags; /* match flags */
short ippeerlimit; /* IP peer limit */
int srvfuzrftpoll; /* server response: fuzz reftime */
u_long expire; /* valid until time */
union { /* variant starting here */
res_addr4 v4;
@@ -885,13 +888,16 @@ char *build_rflags(u_short rflags);
#define RES_MSSNTP 0x1000 /* enable MS-SNTP authentication */
#define RES_FLAKE 0x2000 /* flakeway - drop 10% */
#define RES_NOMRULIST 0x4000 /* mode 6 mrulist denied */
#define RES_UNUSED 0x8000 /* Unused flag bits */
#define RES_SRVRSPFUZ 0x8000 /* Server response: fuzz */
#define RES_UNUSED 0x0000 /* Unused flag bits (none left) */
#define RES_ALLFLAGS (RES_FLAGS | RES_NOQUERY | \
RES_NOMODIFY | RES_NOTRAP | \
RES_LPTRAP | RES_KOD | \
RES_MSSNTP | RES_FLAKE | \
RES_NOMRULIST)
RES_NOMRULIST | RES_SRVRSPFUZ )
/*
* Match flags (mflags)
+71 -2
View File
@@ -19,6 +19,8 @@ struct calendar {
uint8_t second; /* second of minute */
uint8_t weekday; /* 0..7, 0=Sunday */
};
typedef struct calendar TCivilDate;
typedef struct calendar const TcCivilDate;
/* ISO week calendar date */
struct isodate {
@@ -29,6 +31,8 @@ struct isodate {
uint8_t minute; /* minute of hour */
uint8_t second; /* second of minute */
};
typedef struct isodate TIsoDate;
typedef struct isodate const TcIsoDate;
/* general split representation */
typedef struct {
@@ -109,6 +113,7 @@ extern systime_func_ptr ntpcal_set_timefunc(systime_func_ptr);
extern const char * const months[12];
extern const char * const daynames[7];
extern char * ntpcal_iso8601std(char*, size_t, struct calendar const*);
extern void caljulian (uint32_t, struct calendar *);
extern uint32_t caltontp (const struct calendar *);
@@ -151,6 +156,13 @@ ntpcal_ntp_to_ntp(uint32_t /* ntp */, const time_t * /* pivot */);
extern ntpcal_split
ntpcal_daysplit(const vint64 *);
/*
* Split a time stamp in seconds into elapsed weeks and elapsed seconds
* since start of week.
*/
extern ntpcal_split
ntpcal_weeksplit(const vint64 *);
/*
* Merge a number of days and a number of seconds into seconds,
* expressed in 64 bits to avoid overflow.
@@ -158,6 +170,13 @@ ntpcal_daysplit(const vint64 *);
extern vint64
ntpcal_dayjoin(int32_t /* days */, int32_t /* seconds */);
/*
* Merge a number of weeks and a number of seconds into seconds,
* expressed in 64 bits to avoid overflow.
*/
extern vint64
ntpcal_weekjoin(int32_t /* weeks */, int32_t /* seconds */);
/* Get the number of leap years since epoch for the number of elapsed
* full years
*/
@@ -431,7 +450,7 @@ basedate_expand_gpsweek(unsigned short weekno);
/*
* Start day of the GPS epoch. This is the Rata Die of 1980-01-06
*/
#define DAY_GPS_STARTS 722819
#define DAY_GPS_STARTS 722820
/*
* Difference between UN*X and NTP epoch (25567).
@@ -467,6 +486,56 @@ basedate_expand_gpsweek(unsigned short weekno);
*/
#define GREGORIAN_CYCLE_WEEKS (GREGORIAN_CYCLE_DAYS / 7)
#define is_leapyear(y) (!((y) % 4) && !(!((y) % 100) && (y) % 400))
/*
* Is a Greogorian calendar year a leap year? The obvious solution is to
* test the expression
*
* (y % 4 == 0) && ((y % 100 != 0) || (y % 400 == 0))
*
* This needs (in theory) 2 true divisions -- most compilers check the
* (mod 4) condition by doing a bit test. Some compilers have been
* even observed to partially fuse the (mod 100) and (mod 400) test,
* but there is an alternative formula that gives the compiler even
* better chances:
*
* (y % 4 == 0) && ((y % 16 == 0) || (y % 25 != 0))
*
* The order of checks is chosen so that the shorcut evaluation can fix
* the result as soon as possible. And the compiler has to do only one
* true division here -- the (mod 4) and (mod 16) can be done with
* direct bit tests. *If* the compiler chooses to do so.
*
* The deduction is as follows: rewrite the standard formula as
* (y % 4 == 0) && ((y % 4*25 != 0) || (y % 16*25 == 0))
*
* then split the congruences:
* (y % 4 == 0) && ((y % 4 != 0 || y % 25 != 0) || (y % 16 == 0 && y % 25 == 0))
*
* eliminate the 1st inner term, as it is provably false:
* (y % 4 == 0) && (y % 25 != 0 || (y % 16 == 0 && y % 25 == 0))
*
* Use the distributive laws on the second major group:
* (y % 4 == 0) && ((y % 25 != 0 || y % 16 == 0) && (y % 25 != 0 || y % 25 == 0))
*
* Eliminate the constant term, reorder, and voila:
*/
static inline int
is_leapyear(int32_t y) {
return !(y % 4) && (!(y % 16) || (y % 25));
}
/* The (mod 4) test eliminates 3/4 (or 12/16) of all values.
* The (mod 16) test eliminates another 1/16 of all values.
* 3/16 of all values reach the final division.
* Assuming that the true division is the most costly operation, this
* sequence should give most bang for the buck.
*/
/* misc */
extern int u32mod7(uint32_t x);
extern int i32mod7(int32_t x);
extern uint32_t i32fmod(int32_t x, uint32_t d);
extern int32_t ntpcal_expand_century(uint32_t y, uint32_t m, uint32_t d, uint32_t wd);
#endif
+151
View File
@@ -0,0 +1,151 @@
/*
* ntp_calgps.h - calendar for GPS/GNSS based clocks
*
* Written by Juergen Perlinger (perlinger@ntp.org) for the NTP project.
* The contents of 'html/copyright.html' apply.
*
* --------------------------------------------------------------------
*
* This module implements stuff often used with GPS/GNSS receivers
*/
#ifndef NTP_CALGPS_H
#define NTP_CALGPS_H
#include <time.h>
#include "ntp_types.h"
#include "ntp_fp.h"
#include "ntp_calendar.h"
/* GPS week calendar (extended weeks)
* We use weeks based on 1899-31-12, which was the last Sunday before
* the begin of the NTP epoch. (Which is equivalent to saying 1900-01-01
* was a Monday...)
*
* We simply pre-calculate the offsets and cycle shifts for the real GPS
* calendar, which starts at 1980-01-06, to simplyfy some expressions.
*
* This has a fringe benefit that should not be overlooked: Since week zero
* is around 1900, and we should never have to deal with dates before
* 1970 or 1980, a week number of zero can be easily used to indicate
* an invalid week time stamp.
*/
#define GPSNTP_WSHIFT 4175 /* weeks 1899-31-12 --> 1980-01-06 */
#define GPSNTP_WCYCLE 79 /* above, modulo 1024 */
#define GPSNTP_DSHIFT 1 /* day number of 1900-01-01 in week */
struct gpsdatum {
uint32_t weeks; /* weeks since GPS epoch */
int32_t wsecs; /* seconds since week start */
uint32_t frac; /* fractional seconds */
};
typedef struct gpsdatum TGpsDatum;
typedef struct gpsdatum const TcGpsDatum;
/* NTP date/time in split representation */
struct ntpdatum {
uint32_t days; /* since NTP epoch */
int32_t secs; /* since midnight, denorm is ok */
uint32_t frac; /* fractional seconds */
};
typedef struct ntpdatum TNtpDatum;
typedef struct ntpdatum const TcNtpDatum;
/*
* GPS week/sec calendar functions
*
* see the implementation for details, especially the
* 'gpscal_from_weektime{1,2}()'
*/
extern TGpsDatum
gpscal_fix_gps_era(TcGpsDatum *);
extern void
gpscal_add_offset(TGpsDatum *datum, l_fp offset);
extern TGpsDatum
gpscal_from_calendar_ex(TcCivilDate*, l_fp fofs, int/*BOOL*/ warp);
static inline TGpsDatum
gpscal_from_calendar(TcCivilDate *pCiv, l_fp fofs) {
return gpscal_from_calendar_ex(pCiv, fofs, TRUE);
}
extern TGpsDatum /* see source for semantic of the 'fofs' value! */
gpscal_from_gpsweek(uint16_t w, int32_t s, l_fp fofs);
extern TGpsDatum
gpscal_from_weektime1(int32_t wsecs, l_fp fofs, l_fp pivot);
extern TGpsDatum
gpscal_from_weektime2(int32_t wsecs, l_fp fofs, TcGpsDatum *pivot);
extern void
gpscal_to_calendar(TCivilDate*, TcGpsDatum*);
extern TGpsDatum
gpscal_from_gpsntp(TcNtpDatum*);
extern l_fp
ntpfp_from_gpsdatum(TcGpsDatum *);
/*
* NTP day/sec calendar functions
*
* see the implementation for details, especially the
* 'gpscal_from_daytime{1,2}()'
*/
extern TNtpDatum
gpsntp_fix_gps_era(TcNtpDatum *);
extern void
gpsntp_add_offset(TNtpDatum *datum, l_fp offset);
extern TNtpDatum
gpsntp_from_calendar_ex(TcCivilDate*, l_fp fofs, int/*BOOL*/ warp);
static inline TNtpDatum
gpsntp_from_calendar(TcCivilDate * pCiv, l_fp fofs) {
return gpsntp_from_calendar_ex(pCiv, fofs, TRUE);
}
extern TNtpDatum
gpsntp_from_daytime1_ex(TcCivilDate *dt, l_fp fofs, l_fp pivot, int/*BOOL*/ warp);
static inline TNtpDatum
gpsntp_from_daytime1(TcCivilDate *dt, l_fp fofs, l_fp pivot) {
return gpsntp_from_daytime1_ex(dt, fofs, pivot, TRUE);
}
extern TNtpDatum
gpsntp_from_daytime2_ex(TcCivilDate *dt, l_fp fofs, TcNtpDatum *pivot, int/*BOOL*/ warp);
static inline TNtpDatum
gpsntp_from_daytime2(TcCivilDate *dt, l_fp fofs, TcNtpDatum *pivot) {
return gpsntp_from_daytime2_ex(dt, fofs, pivot, TRUE);
}
extern TNtpDatum
gpsntp_from_gpscal_ex(TcGpsDatum*, int/*BOOL*/ warp);
static inline TNtpDatum
gpsntp_from_gpscal(TcGpsDatum *wd) {
return gpsntp_from_gpscal_ex(wd, FALSE);
}
extern void
gpsntp_to_calendar(TCivilDate*, TcNtpDatum*);
extern l_fp
ntpfp_from_ntpdatum(TcNtpDatum*);
/*
* Some helpers
*/
/* apply fudge to time stamp: *SUBTRACT* the given offset from an l_fp*/
extern l_fp
ntpfp_with_fudge(l_fp lfp, double ofs);
#endif /*!defined(NTP_CALGPS_H)*/
+30 -9
View File
@@ -6,6 +6,7 @@
#endif /* HAVE_SYS_RESOURCE_H */
#include "ntp_machine.h"
#include "ntp_psl.h"
#include "ntpsim.h"
@@ -68,12 +69,13 @@ struct attr_val_tag {
attr_val * link;
int attr;
int type; /* T_String, T_Integer, ... */
int flag; /* auxiliary flags */
union val {
int i;
u_int u;
int_range r;
double d;
char * s;
double d; /* T_Double */
int i; /* T_Integer */
int_range r; /* T_Intrange */
char * s; /* T_String */
u_int u; /* T_U_int */
} value;
};
@@ -110,9 +112,10 @@ struct restrict_node_tag {
restrict_node * link;
address_node * addr;
address_node * mask;
int_fifo * flag_tok_fifo;
attr_val_fifo * flag_tok_fifo;
int line_no;
short ippeerlimit;
short srvfuzrft;
};
typedef DECL_FIFO_ANCHOR(restrict_node) restrict_fifo;
@@ -246,6 +249,7 @@ struct config_tree_tag {
attr_val_fifo * vars;
nic_rule_fifo * nic_rules;
int_fifo * reset_counters;
attr_val_fifo * pollskewlist;
sim_fifo * sim_details;
int mdnstries;
@@ -272,6 +276,23 @@ typedef struct settrap_parms_tag {
} settrap_parms;
/*
* Poll Skew List
*/
psl_item psl[17-3+1]; /* values for polls 3-17 */
/* To simplify the runtime code we */
/* don't want to have to special-case */
/* dealing with a default */
/*
** Data Minimization Items
*/
/* Serverresponse fuzz reftime: stored in 'restrict' fifos */
/* get text from T_ tokens */
const char * token_name(int token);
@@ -298,9 +319,9 @@ address_node *create_address_node(char *addr, int type);
void destroy_address_node(address_node *my_node);
attr_val *create_attr_dval(int attr, double value);
attr_val *create_attr_ival(int attr, int value);
attr_val *create_attr_uval(int attr, u_int value);
attr_val *create_attr_rangeval(int attr, int first, int last);
attr_val *create_attr_rval(int attr, int first, int last);
attr_val *create_attr_sval(int attr, const char *s);
attr_val *create_attr_uval(int attr, u_int value);
void destroy_attr_val(attr_val *node);
filegen_node *create_filegen_node(int filegen_token,
attr_val_fifo *options);
@@ -308,7 +329,7 @@ string_node *create_string_node(char *str);
restrict_node *create_restrict_node(address_node *addr,
address_node *mask,
short ippeerlimit,
int_fifo *flags, int line_no);
attr_val_fifo *flags, int line_no);
int_node *create_int_node(int val);
addr_opts_node *create_addr_opts_node(address_node *addr,
attr_val_fifo *options);
+4
View File
@@ -1,3 +1,5 @@
#ifndef NTP_CONTROL_H
#define NTP_CONTROL_H
/*
* ntp_control.h - definitions related to NTP mode 6 control messages
*/
@@ -190,3 +192,5 @@ extern struct ctl_trap ctl_traps[CTL_MAXTRAPS];
#define IFSTATS_FIELDS 12
#define RESLIST_FIELDS 4
#endif /* NTP_CONTROL_H */
+2 -2
View File
@@ -344,8 +344,8 @@ typedef u_int32 u_fp;
/*
* Prototypes
*/
extern char * dofptoa (u_fp, int, short, int);
extern char * dolfptoa (u_int32, u_int32, int, short, int);
extern char * dofptoa (u_fp, char, short, int);
extern char * dolfptoa (u_int32, u_int32, char, short, int);
extern int atolfp (const char *, l_fp *);
extern int buftvtots (const char *, l_fp *);
+1 -1
View File
@@ -84,7 +84,7 @@ typedef enum {
extern int qos;
SOCKET move_fd(SOCKET fd);
isc_boolean_t get_broadcastclient_flag(void);
/*isc_boolean_t get_broadcastclient_flag(void);*/
extern void sau_from_netaddr(sockaddr_u *, const isc_netaddr_t *);
extern void add_nic_rule(nic_rule_match match_type,
const char *if_name, int prefixlen,
+17
View File
@@ -0,0 +1,17 @@
#ifndef NTP_PSL_H
#define NTP_PSL_H
/*
* Poll Skew List Item
*/
typedef struct psl_item_tag {
int sub; /* int or short? unsigned is OK, but why? */
int qty; /* int or short? unsigned is OK, but why? */
int msk; /* int or short? unsigned is OK */
} psl_item;
int get_pollskew(int, psl_item *);
#endif /* !defined(NTP_PSL_H) */
+25 -10
View File
@@ -14,11 +14,6 @@
#include "recvbuff.h"
#define SAMPLE(x) pp->coderecv = (pp->coderecv + 1) % MAXSTAGE; \
pp->filter[pp->coderecv] = (x); \
if (pp->coderecv == pp->codeproc) \
pp->codeproc = (pp->codeproc + 1) % MAXSTAGE;
/*
* Macros to determine the clock type and unit numbers from a
* 127.127.t.u address
@@ -54,6 +49,7 @@ extern struct clktype clktypes[];
#define CLK_HAVEFLAG2 0x20
#define CLK_HAVEFLAG3 0x40
#define CLK_HAVEFLAG4 0x80
#define CLK_HAVEMINJIT 0x100
/*
* Constant for disabling event reporting in
@@ -68,7 +64,7 @@ extern struct clktype clktypes[];
struct refclockstat {
u_char type; /* clock type */
u_char flags; /* clock flags */
u_char haveflags; /* bit array of valid flags */
u_short haveflags; /* bit array of valid flags */
u_short lencode; /* length of last timecode */
const char *p_lastcode; /* last timecode received */
u_int32 polls; /* transmit polls */
@@ -77,6 +73,7 @@ struct refclockstat {
u_int32 baddata; /* invalid data timecode received */
u_int32 timereset; /* driver resets */
const char *clockdesc; /* ASCII description */
double fudgeminjitter; /* configure fudge minjitter */
double fudgetime1; /* configure fudge time1 */
double fudgetime2; /* configure fudge time2 */
int32 fudgeval1; /* configure fudge value1 */
@@ -133,13 +130,12 @@ extern HANDLE WaitableIoEventHandle;
* Structure interface between the reference clock support
* ntp_refclock.c and the driver utility routines
*/
#define MAXSTAGE 60 /* max median filter stages */
#define MAXSTAGE 64 /* max median filter stages */
#define NSTAGE 5 /* default median filter stages */
#define BMAX 128 /* max timecode length */
#define GMT 0 /* I hope nobody sees this */
#define MAXDIAL 60 /* max length of modem dial strings */
struct refclockproc {
void * unitptr; /* pointer to unit structure */
struct refclock * conf; /* refclock_conf[type] */
@@ -148,6 +144,7 @@ struct refclockproc {
u_char currentstatus; /* clock status */
u_char lastevent; /* last exception event */
u_char type; /* clock type */
u_char inpoll; /* waiting for 'refclock_receive()' */
const char *clockdesc; /* clock description */
u_long nextaction; /* local activity timeout */
void (*action)(struct peer *); /* timeout callback */
@@ -162,8 +159,8 @@ struct refclockproc {
int second; /* second of minute */
long nsec; /* nanosecond of second */
u_long yearstart; /* beginning of year */
int coderecv; /* put pointer */
int codeproc; /* get pointer */
u_int coderecv; /* put pointer */
u_int codeproc; /* get pointer */
l_fp lastref; /* reference timestamp */
l_fp lastrec; /* receive timestamp */
double offset; /* mean offset */
@@ -176,6 +173,7 @@ struct refclockproc {
*/
double fudgetime1; /* fudge time1 */
double fudgetime2; /* fudge time2 */
double fudgeminjitter; /* manually set lower bound for jitter */
u_char stratum; /* server stratum */
u_int32 refid; /* reference identifier */
u_char sloppyclockflag; /* fudge flags */
@@ -229,12 +227,29 @@ extern int refclock_process(struct refclockproc *);
extern int refclock_process_f(struct refclockproc *, double);
extern void refclock_process_offset(struct refclockproc *, l_fp,
l_fp, double);
extern int refclock_samples_avail(struct refclockproc const *);
extern int refclock_samples_expire(struct refclockproc *, int);
extern void refclock_report (struct peer *, int);
extern int refclock_gtlin (struct recvbuf *, char *, int, l_fp *);
extern int refclock_gtraw (struct recvbuf *, char *, int, l_fp *);
extern int indicate_refclock_packet(struct refclockio *,
struct recvbuf *);
extern void process_refclock_packet(struct recvbuf *);
/* save string as la_code, size==(size_t)-1 ==> ASCIIZ string */
extern void refclock_save_lcode(
struct refclockproc *, char const *, size_t);
/* format data into la_code */
extern void refclock_format_lcode(
struct refclockproc *, char const *, ...);
extern void refclock_vformat_lcode(
struct refclockproc *, char const *, va_list);
struct refclock_atom;
extern int refclock_ppsaugment(
const struct refclock_atom*, l_fp *rcvtime ,
double rcvfudge, double ppsfudge);
#endif /* REFCLOCK */
#endif /* NTP_REFCLOCK_H */
+3 -1
View File
@@ -670,8 +670,10 @@ struct conf_restrict {
u_int32 addr; /* match address */
u_int32 mask; /* match mask */
short ippeerlimit; /* ip peer limit */
u_short flags; /* restrict flags */
int srvfuzrft; /* server response fuzz reftime: poll */
u_short flags; /* restrict flags XXX: OLD size and name */
u_short mflags; /* match flags */
short unused1; /* (unused) padding for v6_flag */
u_int v6_flag; /* is this v6 or not */
struct in6_addr addr6; /* match address (v6) */
struct in6_addr mask6; /* match mask (v6) */
+1 -1
View File
@@ -159,7 +159,7 @@ extern const char * modetoa (size_t);
extern const char * eventstr (int);
extern const char * ceventstr (int);
extern const char * res_match_flags(u_short);
extern const char * res_access_flags(u_short);
extern const char * res_access_flags(u_int32);
#ifdef KERNEL_PLL
extern const char * k_st_flags (u_int32);
#endif
+3
View File
@@ -83,4 +83,7 @@ do { \
msyslog msl_args; \
} while (FALSE)
extern int change_iobufs(int how);
/* how: 0->unbuffered, 1->linebuffer, 2->full */
#endif /* NTP_SYSLOG_H */
+3 -3
View File
@@ -232,7 +232,7 @@ extern double sys_mindisp;
extern double sys_maxdist;
extern char *sys_ident; /* identity scheme */
extern void poll_update (struct peer *, u_char);
extern void poll_update (struct peer *, u_char, u_char);
extern void clear (struct peer *);
extern void clock_filter (struct peer *, double, double, double);
@@ -282,7 +282,7 @@ extern u_char sys_automax; /* session key timeout */
/* ntp_util.c */
extern void init_util (void);
extern void write_stats (void);
extern void stats_config (int, const char *);
extern void stats_config (int, const char *, int optflag);
extern void record_peer_stats (sockaddr_u *, int, double, double, double, double);
extern void record_proto_stats (char *);
extern void record_loop_stats (double, double, double, double, int);
@@ -568,7 +568,7 @@ extern char *group; /* group to switch to */
extern const char *chrootdir; /* directory to chroot() to */
#endif
#ifdef HAVE_WORKING_FORK
extern int waitsync_fd_to_close; /* -w/--wait-sync */
extern int daemon_pipe[2]; /* startup monitoring */
#endif
/* ntservice.c */
+8 -179
View File
@@ -56,68 +56,11 @@
/* predicate: returns TRUE if the nanoseconds are out-of-bounds */
#define timespec_isdenormal(x) (!timespec_isnormal(x))
/* conversion between l_fp fractions and nanoseconds */
#ifdef HAVE_U_INT64
# define FTOTVN(tsf) \
((int32) \
(((u_int64)(tsf) * NANOSECONDS + 0x80000000) >> 32))
# define TVNTOF(tvu) \
((u_int32) \
((((u_int64)(tvu) << 32) + NANOSECONDS / 2) / \
NANOSECONDS))
#else
# define NSECFRAC (FRAC / NANOSECONDS)
# define FTOTVN(tsf) \
((int32)((tsf) / NSECFRAC + 0.5))
# define TVNTOF(tvu) \
((u_int32)((tvu) * NSECFRAC + 0.5))
#endif
/* make sure nanoseconds are in nominal range */
static inline struct timespec
normalize_tspec(
struct timespec x
)
{
#if SIZEOF_LONG > 4
long z;
/*
* tv_nsec is of type 'long', and on a 64-bit machine using only
* loops becomes prohibitive once the upper 32 bits get
* involved. On the other hand, division by constant should be
* fast enough; so we do a division of the nanoseconds in that
* case. The floor adjustment step follows with the standard
* normalisation loops. And labs() is intentionally not used
* here: it has implementation-defined behaviour when applied
* to LONG_MIN.
*/
if (x.tv_nsec < -3l * NANOSECONDS ||
x.tv_nsec > 3l * NANOSECONDS) {
z = x.tv_nsec / NANOSECONDS;
x.tv_nsec -= z * NANOSECONDS;
x.tv_sec += z;
}
#endif
/* since 10**9 is close to 2**32, we don't divide but do a
* normalisation in a loop; this takes 3 steps max, and should
* outperform a division even if the mul-by-inverse trick is
* employed. */
if (x.tv_nsec < 0)
do {
x.tv_nsec += NANOSECONDS;
x.tv_sec--;
} while (x.tv_nsec < 0);
else if (x.tv_nsec >= NANOSECONDS)
do {
x.tv_nsec -= NANOSECONDS;
x.tv_sec++;
} while (x.tv_nsec >= NANOSECONDS);
return x;
}
extern struct timespec normalize_tspec(struct timespec x);
/* x = a + b */
static inline struct timespec
@@ -196,45 +139,13 @@ neg_tspec(
}
/* x = abs(a) */
static inline struct timespec
abs_tspec(
struct timespec a
)
{
struct timespec c;
c = normalize_tspec(a);
if (c.tv_sec < 0) {
if (c.tv_nsec != 0) {
c.tv_sec = -c.tv_sec - 1;
c.tv_nsec = NANOSECONDS - c.tv_nsec;
} else {
c.tv_sec = -c.tv_sec;
}
}
return c;
}
struct timespec abs_tspec(struct timespec a);
/*
* compare previously-normalised a and b
* return 1 / 0 / -1 if a < / == / > b
*/
static inline int
cmp_tspec(
struct timespec a,
struct timespec b
)
{
int r;
r = (a.tv_sec > b.tv_sec) - (a.tv_sec < b.tv_sec);
if (0 == r)
r = (a.tv_nsec > b.tv_nsec) -
(a.tv_nsec < b.tv_nsec);
return r;
}
extern int cmp_tspec(struct timespec a, struct timespec b);
/*
* compare possibly-denormal a and b
@@ -253,19 +164,7 @@ cmp_tspec_denorm(
* test previously-normalised a
* return 1 / 0 / -1 if a < / == / > 0
*/
static inline int
test_tspec(
struct timespec a
)
{
int r;
r = (a.tv_sec > 0) - (a.tv_sec < 0);
if (r == 0)
r = (a.tv_nsec > 0);
return r;
}
extern int test_tspec(struct timespec a);
/*
* test possibly-denormal a
@@ -293,20 +192,7 @@ tspectoa(
*/
/* convert from timespec duration to l_fp duration */
static inline l_fp
tspec_intv_to_lfp(
struct timespec x
)
{
struct timespec v;
l_fp y;
v = normalize_tspec(x);
y.l_uf = TVNTOF(v.tv_nsec);
y.l_i = (int32)v.tv_sec;
return y;
}
extern l_fp tspec_intv_to_lfp(struct timespec x);
/* x must be UN*X epoch, output will be in NTP epoch */
static inline l_fp
@@ -323,71 +209,14 @@ tspec_stamp_to_lfp(
}
/* convert from l_fp type, relative signed/unsigned and absolute */
static inline struct timespec
lfp_intv_to_tspec(
l_fp x
)
{
struct timespec out;
l_fp absx;
int neg;
neg = L_ISNEG(&x);
absx = x;
if (neg) {
L_NEG(&absx);
}
out.tv_nsec = FTOTVN(absx.l_uf);
out.tv_sec = absx.l_i;
if (neg) {
out.tv_sec = -out.tv_sec;
out.tv_nsec = -out.tv_nsec;
out = normalize_tspec(out);
}
return out;
}
static inline struct timespec
lfp_uintv_to_tspec(
l_fp x
)
{
struct timespec out;
out.tv_nsec = FTOTVN(x.l_uf);
out.tv_sec = x.l_ui;
return out;
}
extern struct timespec lfp_intv_to_tspec(l_fp x);
extern struct timespec lfp_uintv_to_tspec(l_fp x);
/*
* absolute (timestamp) conversion. Input is time in NTP epoch, output
* is in UN*X epoch. The NTP time stamp will be expanded around the
* pivot time *p or the current time, if p is NULL.
*/
static inline struct timespec
lfp_stamp_to_tspec(
l_fp x,
const time_t * p
)
{
struct timespec out;
vint64 sec;
sec = ntpcal_ntp_to_time(x.l_ui, p);
out.tv_nsec = FTOTVN(x.l_uf);
/* copying a vint64 to a time_t needs some care... */
#if SIZEOF_TIME_T <= 4
out.tv_sec = (time_t)sec.d_s.lo;
#elif defined(HAVE_INT64)
out.tv_sec = (time_t)sec.q_s;
#else
out.tv_sec = ((time_t)sec.d_s.hi << 32) | sec.d_s.lo;
#endif
return out;
}
extern struct timespec lfp_stamp_to_tspec(l_fp x, const time_t *pivot);
#endif /* TIMESPECOPS_H */
+42
View File
@@ -0,0 +1,42 @@
/*
* timexsup.h - 'struct timex' support functions
*
* Written by Juergen Perlinger (perlinger@ntp.org) for the NTP project.
* The contents of 'html/copyright.html' apply.
*/
#ifndef TIMEXSUP_H
#define TIMEXSUP_H
/* convert a 'long' time value (in usec or nsec) into seconds, expressed
* as a 'double'. If 'STA_NANO' is not defined, this will always convert
* from usec. ('STA_NANO' is Linux specific at the time of this
* writing.)
*
* If 'STA_NANO' is defined, it will be checked in 'status' to decide
* which time base (usec or nsec) applies for this conversion.
*/
extern double dbl_from_var_long(long lval, int status);
/* convert a 'long' time value in usec into seconds, expressed as
* 'double'. This function is there for pure symmetry right now -- it
* just casts and scales without any additional bells and whistles.
*/
extern double dbl_from_usec_long(long lval);
/* If MOD_NANO is defined, set the MOD_NANO bit in '*modes' and
* calculate the time stamp in nsec; otherwise, calculate the result in
* usec.
*
* Applies proper bounds checks and saturation on LONG_MAX/LONG_MIN to
* avoid undefined behaviour.
*/
extern long var_long_from_dbl(double dval, unsigned int *modes);
/* convert a 'double' time value (in seconds) into usec with proper
* bounds check and range clamp.
*/
extern long usec_long_from_dbl(double dval);
#endif
/* -*- that's all folks -*- */
+3
View File
@@ -81,6 +81,7 @@ libntp_a_SRCS = \
msyslog.c \
netof.c \
ntp_calendar.c \
ntp_calgps.c \
ntp_crypto_rnd.c \
ntp_intres.c \
ntp_libopts.c \
@@ -104,8 +105,10 @@ libntp_a_SRCS = \
strdup.c \
strl_obsd.c \
syssignal.c \
timespecops.c \
timetoa.c \
timevalops.c \
timexsup.c \
uglydate.c \
vint64ops.c \
work_fork.c \
+28 -19
View File
@@ -154,13 +154,14 @@ am__libntp_a_SOURCES_DIST = systime.c a_md5encrypt.c adjtime.c \
hextoint.c hextolfp.c humandate.c icom.c iosignal.c \
is_ip_address.c lib_strbuf.c libssl_compat.c machines.c \
mktime.c modetoa.c mstolfp.c msyslog.c netof.c ntp_calendar.c \
ntp_crypto_rnd.c ntp_intres.c ntp_libopts.c ntp_lineedit.c \
ntp_random.c ntp_rfc2553.c ntp_worker.c numtoa.c numtohost.c \
octtoint.c prettydate.c refidsmear.c recvbuff.c refnumtoa.c \
snprintf.c socket.c socktoa.c socktohost.c ssl_init.c \
statestr.c strdup.c strl_obsd.c syssignal.c timetoa.c \
timevalops.c uglydate.c vint64ops.c work_fork.c work_thread.c \
xsbprintf.c ymd2yd.c $(srcdir)/../lib/isc/assertions.c \
ntp_calgps.c ntp_crypto_rnd.c ntp_intres.c ntp_libopts.c \
ntp_lineedit.c ntp_random.c ntp_rfc2553.c ntp_worker.c \
numtoa.c numtohost.c octtoint.c prettydate.c refidsmear.c \
recvbuff.c refnumtoa.c snprintf.c socket.c socktoa.c \
socktohost.c ssl_init.c statestr.c strdup.c strl_obsd.c \
syssignal.c timespecops.c timetoa.c timevalops.c timexsup.c \
uglydate.c vint64ops.c work_fork.c work_thread.c xsbprintf.c \
ymd2yd.c $(srcdir)/../lib/isc/assertions.c \
$(srcdir)/../lib/isc/buffer.c \
$(srcdir)/../lib/isc/backtrace-emptytbl.c \
$(srcdir)/../lib/isc/backtrace.c \
@@ -213,7 +214,7 @@ am__objects_4 = a_md5encrypt.$(OBJEXT) adjtime.$(OBJEXT) \
is_ip_address.$(OBJEXT) lib_strbuf.$(OBJEXT) \
libssl_compat.$(OBJEXT) machines.$(OBJEXT) mktime.$(OBJEXT) \
modetoa.$(OBJEXT) mstolfp.$(OBJEXT) msyslog.$(OBJEXT) \
netof.$(OBJEXT) ntp_calendar.$(OBJEXT) \
netof.$(OBJEXT) ntp_calendar.$(OBJEXT) ntp_calgps.$(OBJEXT) \
ntp_crypto_rnd.$(OBJEXT) ntp_intres.$(OBJEXT) \
ntp_libopts.$(OBJEXT) ntp_lineedit.$(OBJEXT) \
ntp_random.$(OBJEXT) ntp_rfc2553.$(OBJEXT) \
@@ -222,10 +223,11 @@ am__objects_4 = a_md5encrypt.$(OBJEXT) adjtime.$(OBJEXT) \
recvbuff.$(OBJEXT) refnumtoa.$(OBJEXT) snprintf.$(OBJEXT) \
socket.$(OBJEXT) socktoa.$(OBJEXT) socktohost.$(OBJEXT) \
ssl_init.$(OBJEXT) statestr.$(OBJEXT) strdup.$(OBJEXT) \
strl_obsd.$(OBJEXT) syssignal.$(OBJEXT) timetoa.$(OBJEXT) \
timevalops.$(OBJEXT) uglydate.$(OBJEXT) vint64ops.$(OBJEXT) \
work_fork.$(OBJEXT) work_thread.$(OBJEXT) xsbprintf.$(OBJEXT) \
ymd2yd.$(OBJEXT) $(am__objects_3) $(am__objects_1)
strl_obsd.$(OBJEXT) syssignal.$(OBJEXT) timespecops.$(OBJEXT) \
timetoa.$(OBJEXT) timevalops.$(OBJEXT) timexsup.$(OBJEXT) \
uglydate.$(OBJEXT) vint64ops.$(OBJEXT) work_fork.$(OBJEXT) \
work_thread.$(OBJEXT) xsbprintf.$(OBJEXT) ymd2yd.$(OBJEXT) \
$(am__objects_3) $(am__objects_1)
am_libntp_a_OBJECTS = systime.$(OBJEXT) $(am__objects_4)
libntp_a_OBJECTS = $(am_libntp_a_OBJECTS)
libntpsim_a_AR = $(AR) $(ARFLAGS)
@@ -238,13 +240,14 @@ am__libntpsim_a_SOURCES_DIST = systime_s.c a_md5encrypt.c adjtime.c \
hextoint.c hextolfp.c humandate.c icom.c iosignal.c \
is_ip_address.c lib_strbuf.c libssl_compat.c machines.c \
mktime.c modetoa.c mstolfp.c msyslog.c netof.c ntp_calendar.c \
ntp_crypto_rnd.c ntp_intres.c ntp_libopts.c ntp_lineedit.c \
ntp_random.c ntp_rfc2553.c ntp_worker.c numtoa.c numtohost.c \
octtoint.c prettydate.c refidsmear.c recvbuff.c refnumtoa.c \
snprintf.c socket.c socktoa.c socktohost.c ssl_init.c \
statestr.c strdup.c strl_obsd.c syssignal.c timetoa.c \
timevalops.c uglydate.c vint64ops.c work_fork.c work_thread.c \
xsbprintf.c ymd2yd.c $(srcdir)/../lib/isc/assertions.c \
ntp_calgps.c ntp_crypto_rnd.c ntp_intres.c ntp_libopts.c \
ntp_lineedit.c ntp_random.c ntp_rfc2553.c ntp_worker.c \
numtoa.c numtohost.c octtoint.c prettydate.c refidsmear.c \
recvbuff.c refnumtoa.c snprintf.c socket.c socktoa.c \
socktohost.c ssl_init.c statestr.c strdup.c strl_obsd.c \
syssignal.c timespecops.c timetoa.c timevalops.c timexsup.c \
uglydate.c vint64ops.c work_fork.c work_thread.c xsbprintf.c \
ymd2yd.c $(srcdir)/../lib/isc/assertions.c \
$(srcdir)/../lib/isc/buffer.c \
$(srcdir)/../lib/isc/backtrace-emptytbl.c \
$(srcdir)/../lib/isc/backtrace.c \
@@ -675,6 +678,7 @@ libntp_a_SRCS = \
msyslog.c \
netof.c \
ntp_calendar.c \
ntp_calgps.c \
ntp_crypto_rnd.c \
ntp_intres.c \
ntp_libopts.c \
@@ -698,8 +702,10 @@ libntp_a_SRCS = \
strdup.c \
strl_obsd.c \
syssignal.c \
timespecops.c \
timetoa.c \
timevalops.c \
timexsup.c \
uglydate.c \
vint64ops.c \
work_fork.c \
@@ -834,6 +840,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netof.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netscope.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_calendar.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_calgps.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_crypto_rnd.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_intres.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_libopts.Po@am__quote@
@@ -870,8 +877,10 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/task.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/thread.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timespecops.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timetoa.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timevalops.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timexsup.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tsmemcmp.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uglydate.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vint64ops.Po@am__quote@
+57 -25
View File
@@ -15,6 +15,19 @@
#include "ntp_stdlib.h"
#include "ntp_assert.h"
#define PORTSTR(x) _PORTSTR(x)
#define _PORTSTR(x) #x
static int
isnumstr(
const char *s
)
{
while (*s >= '0' && *s <= '9')
++s;
return !*s;
}
/*
* decodenetnum convert text IP address and port to sockaddr_u
*
@@ -26,22 +39,25 @@ decodenetnum(
sockaddr_u *netnum
)
{
static const char * const servicename = "ntp";
static const char * const serviceport = PORTSTR(NTP_PORT);
struct addrinfo hints, *ai = NULL;
int err;
u_short port;
const char *cp;
const char *host_str;
const char *port_str;
char *pp;
char *np;
char name[80];
char nbuf[80];
REQUIRE(num != NULL);
if (strlen(num) >= sizeof(name)) {
return 0;
if (strlen(num) >= sizeof(nbuf)) {
printf("length error\n");
return FALSE;
}
port_str = NULL;
port_str = servicename;
if ('[' != num[0]) {
/*
* to distinguish IPv6 embedded colons from a port
@@ -50,37 +66,53 @@ decodenetnum(
*/
pp = strchr(num, ':');
if (NULL == pp)
cp = num; /* no colons */
host_str = num; /* no colons */
else if (NULL != strchr(pp + 1, ':'))
cp = num; /* two or more colons */
host_str = num; /* two or more colons */
else { /* one colon */
strlcpy(name, num, sizeof(name));
cp = name;
pp = strchr(cp, ':');
strlcpy(nbuf, num, sizeof(nbuf));
host_str = nbuf;
pp = strchr(nbuf, ':');
*pp = '\0';
port_str = pp + 1;
}
} else {
cp = num + 1;
np = name;
while (*cp && ']' != *cp)
*np++ = *cp++;
host_str = np = nbuf;
while (*++num && ']' != *num)
*np++ = *num;
*np = 0;
if (']' == cp[0] && ':' == cp[1] && '\0' != cp[2])
port_str = &cp[2];
cp = name;
if (']' == num[0] && ':' == num[1] && '\0' != num[2])
port_str = &num[2];
}
if ( ! *host_str)
return FALSE;
if ( ! *port_str)
port_str = servicename;
ZERO(hints);
hints.ai_flags = Z_AI_NUMERICHOST;
err = getaddrinfo(cp, "ntp", &hints, &ai);
hints.ai_flags |= Z_AI_NUMERICHOST;
if (isnumstr(port_str))
hints.ai_flags |= Z_AI_NUMERICSERV;
err = getaddrinfo(host_str, port_str, &hints, &ai);
/* retry with default service name if the service lookup failed */
if (err == EAI_SERVICE && strcmp(port_str, servicename)) {
hints.ai_flags &= ~Z_AI_NUMERICSERV;
port_str = servicename;
err = getaddrinfo(host_str, port_str, &hints, &ai);
}
/* retry another time with default service port if the service lookup failed */
if (err == EAI_SERVICE && strcmp(port_str, serviceport)) {
hints.ai_flags |= Z_AI_NUMERICSERV;
port_str = serviceport;
err = getaddrinfo(host_str, port_str, &hints, &ai);
}
if (err != 0)
return 0;
return FALSE;
INSIST(ai->ai_addrlen <= sizeof(*netnum));
ZERO(*netnum);
memcpy(netnum, ai->ai_addr, ai->ai_addrlen);
freeaddrinfo(ai);
if (NULL == port_str || 1 != sscanf(port_str, "%hu", &port))
port = NTP_PORT;
SET_PORT(netnum, port);
return 1;
return TRUE;
}
+5 -5
View File
@@ -12,7 +12,7 @@
char *
dofptoa(
u_fp fpv,
int neg,
char sign,
short ndec,
int msec
)
@@ -106,8 +106,8 @@ dofptoa(
* Copy it into the buffer, asciizing as we go.
*/
bp = buf;
if (neg)
*bp++ = '-';
if (sign)
*bp++ = sign;
while (cp < cpend) {
if (cp == cpdec)
@@ -135,7 +135,7 @@ fptoa(
plusfp = (u_fp)fpv;
}
return dofptoa(plusfp, neg, ndec, FALSE);
return dofptoa(plusfp, (neg?'-':0), ndec, FALSE);
}
@@ -155,5 +155,5 @@ fptoms(
plusfp = (u_fp)fpv;
}
return dofptoa(plusfp, neg, ndec, TRUE);
return dofptoa(plusfp, (neg?'-':0), ndec, TRUE);
}
+5 -5
View File
@@ -13,7 +13,7 @@ char *
dolfptoa(
u_int32 fpi,
u_int32 fpv,
int neg,
char sign,
short ndec,
int msec
)
@@ -120,8 +120,8 @@ dolfptoa(
cp = cpdec - 1;
bp = buf;
if (neg)
*bp++ = '-';
if (sign)
*bp++ = sign;
while (cp < cpend) {
if (cp == cpdec)
*bp++ = '.';
@@ -150,7 +150,7 @@ mfptoa(
M_NEG(fpi, fpf);
}
return dolfptoa(fpi, fpf, isneg, ndec, FALSE);
return dolfptoa(fpi, fpf, (isneg?'-':'+'), ndec, FALSE);
}
@@ -168,7 +168,7 @@ mfptoms(
M_NEG(fpi, fpf);
}
return dolfptoa(fpi, fpf, isneg, ndec, TRUE);
return dolfptoa(fpi, fpf, (isneg?'-':'+'), ndec, TRUE);
}
+3 -4
View File
@@ -22,7 +22,7 @@ mstolfp(
/*
* We understand numbers of the form:
*
* [spaces][-][digits][.][digits][spaces|\n|\0]
* [spaces][-|+][digits][.][digits][spaces|\n|\0]
*
* This is one enormous hack. Since I didn't feel like
* rewriting the decoding routine for milliseconds, what
@@ -35,9 +35,8 @@ mstolfp(
while (isspace((unsigned char)*cp))
cp++;
if (*cp == '-') {
*bp++ = '-';
cp++;
if (*cp == '-' || *cp == '+') {
*bp++ = *cp++;
}
if (*cp != '.' && !isdigit((unsigned char)*cp))
+38
View File
@@ -582,3 +582,41 @@ setup_logfile(
msyslog(LOG_ERR, "Cannot reopen log file %s, %m",
syslog_fname);
}
/* Helper for unit tests, where stdout + stderr are piped to the same
* stream. This works moderately reliable only if both streams are
* unbuffered or line buffered. Unfortunately stdout can be fully
* buffered on pipes or files...
*/
int
change_iobufs(
int how
)
{
int retv = 0;
# ifdef HAVE_SETVBUF
int mode;
switch (how) {
case 0 : mode = _IONBF; break; /* no buffering */
case 1 : mode = _IOLBF; break; /* line buffering */
case 2 : mode = _IOFBF; break; /* full buffering */
default: mode = _IOLBF; break; /* line buffering */
}
retv = 1;
if (setvbuf(stdout, NULL, mode, BUFSIZ) != 0)
retv = -1;
if (setvbuf(stderr, NULL, mode, BUFSIZ) != 0)
retv = -1;
# else
UNUSED_ARG(how);
# endif
return retv;
}
File diff suppressed because it is too large. Load diff
+634
View File
@@ -0,0 +1,634 @@
/*
* ntp_calgps.c - calendar for GPS/GNSS based clocks
*
* Written by Juergen Perlinger (perlinger@ntp.org) for the NTP project.
* The contents of 'html/copyright.html' apply.
*
* --------------------------------------------------------------------
*
* This module implements stuff often used with GPS/GNSS receivers
*/
#include <config.h>
#include <sys/types.h>
#include "ntp_types.h"
#include "ntp_calendar.h"
#include "ntp_calgps.h"
#include "ntp_stdlib.h"
#include "ntp_unixtime.h"
#include "ntp_fp.h"
#include "ntpd.h"
#include "vint64ops.h"
/* ====================================================================
* misc. helpers -- might go elsewhere sometime?
* ====================================================================
*/
l_fp
ntpfp_with_fudge(
l_fp lfp,
double ofs
)
{
l_fp fpo;
/* calculate 'lfp - ofs' as '(l_fp)(-ofs) + lfp': negating a
* double is cheap, as it only flips one bit...
*/
ofs = -ofs;
DTOLFP(ofs, &fpo);
L_ADD(&fpo, &lfp);
return fpo;
}
/* ====================================================================
* GPS calendar functions
* ====================================================================
*/
/* --------------------------------------------------------------------
* normalization functions for day/time and week/time representations.
* Since we only use moderate offsets (leap second corrections and
* alike) it does not really pay off to do a floor-corrected division
* here. We use compare/decrement/increment loops instead.
* --------------------------------------------------------------------
*/
static void
_norm_ntp_datum(
TNtpDatum * datum
)
{
static const int32_t limit = SECSPERDAY;
if (datum->secs >= limit) {
do
++datum->days;
while ((datum->secs -= limit) >= limit);
} else if (datum->secs < 0) {
do
--datum->days;
while ((datum->secs += limit) < 0);
}
}
static void
_norm_gps_datum(
TGpsDatum * datum
)
{
static const int32_t limit = 7 * SECSPERDAY;
if (datum->wsecs >= limit) {
do
++datum->weeks;
while ((datum->wsecs -= limit) >= limit);
} else if (datum->wsecs < 0) {
do
--datum->weeks;
while ((datum->wsecs += limit) < 0);
}
}
/* --------------------------------------------------------------------
* Add an offset to a day/time and week/time representation.
*
* !!Attention!! the offset should be small, compared to the time period
* (either a day or a week).
* --------------------------------------------------------------------
*/
void
gpsntp_add_offset(
TNtpDatum * datum,
l_fp offset
)
{
/* fraction can be added easily */
datum->frac += offset.l_uf;
datum->secs += (datum->frac < offset.l_uf);
/* avoid integer overflow on the seconds */
if (offset.l_ui >= INT32_MAX)
datum->secs -= (int32_t)~offset.l_ui + 1;
else
datum->secs += (int32_t)offset.l_ui;
_norm_ntp_datum(datum);
}
void
gpscal_add_offset(
TGpsDatum * datum,
l_fp offset
)
{
/* fraction can be added easily */
datum->frac += offset.l_uf;
datum->wsecs += (datum->frac < offset.l_uf);
/* avoid integer overflow on the seconds */
if (offset.l_ui >= INT32_MAX)
datum->wsecs -= (int32_t)~offset.l_ui + 1;
else
datum->wsecs += (int32_t)offset.l_ui;
_norm_gps_datum(datum);
}
/* -------------------------------------------------------------------
* API functions civil calendar and NTP datum
* -------------------------------------------------------------------
*/
static TNtpDatum
_gpsntp_fix_gps_era(
TcNtpDatum * in
)
{
/* force result in basedate era
*
* When calculating this directly in days, we have to execute a
* real modulus calculation, since we're obviously not doing a
* modulus by a power of 2. Executing this as true floor mod
* needs some care and is done under explicit usage of one's
* complement and masking to get mostly branchless code.
*/
static uint32_t const clen = 7*1024;
uint32_t base, days, sign;
TNtpDatum out = *in;
/* Get base in NTP day scale. No overflows here. */
base = (basedate_get_gpsweek() + GPSNTP_WSHIFT) * 7
- GPSNTP_DSHIFT;
days = out.days;
sign = (uint32_t)-(days < base);
days = sign ^ (days - base);
days %= clen;
days = base + (sign & clen) + (sign ^ days);
out.days = days;
return out;
}
TNtpDatum
gpsntp_fix_gps_era(
TcNtpDatum * in
)
{
TNtpDatum out = *in;
_norm_ntp_datum(&out);
return _gpsntp_fix_gps_era(&out);
}
/* ----------------------------------------------------------------- */
static TNtpDatum
_gpsntp_from_daytime(
TcCivilDate * jd,
l_fp fofs,
TcNtpDatum * pivot,
int warp
)
{
static const int32_t shift = SECSPERDAY / 2;
TNtpDatum retv;
/* set result based on pivot -- ops order is important here */
ZERO(retv);
retv.secs = ntpcal_date_to_daysec(jd);
gpsntp_add_offset(&retv, fofs); /* result is normalized */
retv.days = pivot->days;
/* Manual periodic extension without division: */
if (pivot->secs < shift) {
int32_t lim = pivot->secs + shift;
retv.days -= (retv.secs > lim ||
(retv.secs == lim && retv.frac >= pivot->frac));
} else {
int32_t lim = pivot->secs - shift;
retv.days += (retv.secs < lim ||
(retv.secs == lim && retv.frac < pivot->frac));
}
return warp ? _gpsntp_fix_gps_era(&retv) : retv;
}
/* -----------------------------------------------------------------
* Given the time-of-day part of a civil datum and an additional
* (fractional) offset, calculate a full time stamp around a given pivot
* time so that the difference between the pivot and the resulting time
* stamp is less or equal to 12 hours absolute.
*/
TNtpDatum
gpsntp_from_daytime2_ex(
TcCivilDate * jd,
l_fp fofs,
TcNtpDatum * pivot,
int/*BOOL*/ warp
)
{
TNtpDatum dpiv = *pivot;
_norm_ntp_datum(&dpiv);
return _gpsntp_from_daytime(jd, fofs, &dpiv, warp);
}
/* -----------------------------------------------------------------
* This works similar to 'gpsntp_from_daytime1()' and actually even uses
* it, but the pivot is calculated from the pivot given as 'l_fp' in NTP
* time scale. This is in turn expanded around the current system time,
* and the resulting absolute pivot is then used to calculate the full
* NTP time stamp.
*/
TNtpDatum
gpsntp_from_daytime1_ex(
TcCivilDate * jd,
l_fp fofs,
l_fp pivot,
int/*BOOL*/ warp
)
{
vint64 pvi64;
TNtpDatum dpiv;
ntpcal_split split;
pvi64 = ntpcal_ntp_to_ntp(pivot.l_ui, NULL);
split = ntpcal_daysplit(&pvi64);
dpiv.days = split.hi;
dpiv.secs = split.lo;
dpiv.frac = pivot.l_uf;
return _gpsntp_from_daytime(jd, fofs, &dpiv, warp);
}
/* -----------------------------------------------------------------
* Given a calendar date, zap it into a GPS time format and then convert
* that one into the NTP time scale.
*/
TNtpDatum
gpsntp_from_calendar_ex(
TcCivilDate * jd,
l_fp fofs,
int/*BOOL*/ warp
)
{
TGpsDatum gps;
gps = gpscal_from_calendar_ex(jd, fofs, warp);
return gpsntp_from_gpscal_ex(&gps, FALSE);
}
/* -----------------------------------------------------------------
* create a civil calendar datum from a NTP date representation
*/
void
gpsntp_to_calendar(
TCivilDate * cd,
TcNtpDatum * nd
)
{
memset(cd, 0, sizeof(*cd));
ntpcal_rd_to_date(
cd,
nd->days + DAY_NTP_STARTS + ntpcal_daysec_to_date(
cd, nd->secs));
}
/* -----------------------------------------------------------------
* get day/tod representation from week/tow datum
*/
TNtpDatum
gpsntp_from_gpscal_ex(
TcGpsDatum * gd,
int/*BOOL*/ warp
)
{
TNtpDatum retv;
vint64 ts64;
ntpcal_split split;
TGpsDatum date = *gd;
if (warp) {
uint32_t base = basedate_get_gpsweek() + GPSNTP_WSHIFT;
_norm_gps_datum(&date);
date.weeks = ((date.weeks - base) & 1023u) + base;
}
ts64 = ntpcal_weekjoin(date.weeks, date.wsecs);
ts64 = subv64u32(&ts64, (GPSNTP_DSHIFT * SECSPERDAY));
split = ntpcal_daysplit(&ts64);
retv.frac = gd->frac;
retv.secs = split.lo;
retv.days = split.hi;
return retv;
}
/* -----------------------------------------------------------------
* get LFP from ntp datum
*/
l_fp
ntpfp_from_ntpdatum(
TcNtpDatum * nd
)
{
l_fp retv;
retv.l_uf = nd->frac;
retv.l_ui = nd->days * (uint32_t)SECSPERDAY
+ nd->secs;
return retv;
}
/* -------------------------------------------------------------------
* API functions GPS week calendar
*
* Here we use a calendar base of 1899-12-31, so the NTP epoch has
* { 0, 86400.0 } in this representation.
* -------------------------------------------------------------------
*/
static TGpsDatum
_gpscal_fix_gps_era(
TcGpsDatum * in
)
{
/* force result in basedate era
*
* This is based on calculating the modulus to a power of two,
* so signed integer overflow does not affect the result. Which
* in turn makes for a very compact calculation...
*/
uint32_t base, week;
TGpsDatum out = *in;
week = out.weeks;
base = basedate_get_gpsweek() + GPSNTP_WSHIFT;
week = base + ((week - base) & (GPSWEEKS - 1));
out.weeks = week;
return out;
}
TGpsDatum
gpscal_fix_gps_era(
TcGpsDatum * in
)
{
TGpsDatum out = *in;
_norm_gps_datum(&out);
return _gpscal_fix_gps_era(&out);
}
/* -----------------------------------------------------------------
* Given a calendar date, zap it into a GPS time format and the do a
* proper era mapping in the GPS time scale, based on the GPS base date,
* if so requested.
*
* This function also augments the century if just a 2-digit year
* (0..99) is provided on input.
*
* This is a fail-safe against GPS receivers with an unknown starting
* point for their internal calendar calculation and therefore
* unpredictable (but reproducible!) rollover behavior. While there
* *are* receivers that create a full date in the proper way, many
* others just don't. The overall damage is minimized by simply not
* trusting the era mapping of the receiver and doing the era assignment
* with a configurable base date *inside* ntpd.
*/
TGpsDatum
gpscal_from_calendar_ex(
TcCivilDate * jd,
l_fp fofs,
int/*BOOL*/ warp
)
{
/* (-DAY_GPS_STARTS) (mod 7*1024) -- complement of cycle shift */
static const uint32_t s_compl_shift =
(7 * 1024) - DAY_GPS_STARTS % (7 * 1024);
TGpsDatum gps;
TCivilDate cal;
int32_t days, week;
/* if needed, convert from 2-digit year to full year
* !!NOTE!! works only between 1980 and 2079!
*/
cal = *jd;
if (cal.year < 80)
cal.year += 2000;
else if (cal.year < 100)
cal.year += 1900;
/* get RDN from date, possibly adjusting the century */
again: if (cal.month && cal.monthday) { /* use Y/M/D civil date */
days = ntpcal_date_to_rd(&cal);
} else { /* using Y/DoY date */
days = ntpcal_year_to_ystart(cal.year)
+ (int32_t)cal.yearday
- 1; /* both RDN and yearday start with '1'. */
}
/* Rebase to days after the GPS epoch. 'days' is positive here,
* but it might be less than the GPS epoch start. Depending on
* the input, we have to do different things to get the desired
* result. (Since we want to remap the era anyway, we only have
* to retain congruential identities....)
*/
if (days >= DAY_GPS_STARTS) {
/* simply shift to days since GPS epoch */
days -= DAY_GPS_STARTS;
} else if (jd->year < 100) {
/* Two-digit year on input: add another century and
* retry. This can happen only if the century expansion
* yielded a date between 1980-01-01 and 1980-01-05,
* both inclusive. We have at most one retry here.
*/
cal.year += 100;
goto again;
} else {
/* A very bad date before the GPS epoch. There's not
* much we can do, except to add the complement of
* DAY_GPS_STARTS % (7 * 1024) here, that is, use a
* congruential identity: Add the complement instead of
* subtracting the value gives a value with the same
* modulus. But of course, now we MUST to go through a
* cycle fix... because the date was obviously wrong!
*/
warp = TRUE;
days += s_compl_shift;
}
/* Splitting to weeks is simple now: */
week = days / 7;
days -= week * 7;
/* re-base on start of NTP with weeks mapped to 1024 weeks
* starting with the GPS base day set in the calendar.
*/
gps.weeks = week + GPSNTP_WSHIFT;
gps.wsecs = days * SECSPERDAY + ntpcal_date_to_daysec(&cal);
gps.frac = 0;
gpscal_add_offset(&gps, fofs);
return warp ? _gpscal_fix_gps_era(&gps) : gps;
}
/* -----------------------------------------------------------------
* get civil date from week/tow representation
*/
void
gpscal_to_calendar(
TCivilDate * cd,
TcGpsDatum * wd
)
{
TNtpDatum nd;
memset(cd, 0, sizeof(*cd));
nd = gpsntp_from_gpscal_ex(wd, FALSE);
gpsntp_to_calendar(cd, &nd);
}
/* -----------------------------------------------------------------
* Given the week and seconds in week, as well as the fraction/offset
* (which should/could include the leap seconds offset), unfold the
* weeks (which are assumed to have just 10 bits) into expanded weeks
* based on the GPS base date derived from the build date (default) or
* set by the configuration.
*
* !NOTE! This function takes RAW GPS weeks, aligned to the GPS start
* (1980-01-06) on input. The output weeks will be aligned to NTPD's
* week calendar start (1899-12-31)!
*/
TGpsDatum
gpscal_from_gpsweek(
uint16_t week,
int32_t secs,
l_fp fofs
)
{
TGpsDatum retv;
retv.frac = 0;
retv.wsecs = secs;
retv.weeks = week + GPSNTP_WSHIFT;
gpscal_add_offset(&retv, fofs);
return _gpscal_fix_gps_era(&retv);
}
/* -----------------------------------------------------------------
* internal work horse for time-of-week expansion
*/
static TGpsDatum
_gpscal_from_weektime(
int32_t wsecs,
l_fp fofs,
TcGpsDatum * pivot
)
{
static const int32_t shift = SECSPERWEEK / 2;
TGpsDatum retv;
/* set result based on pivot -- ops order is important here */
ZERO(retv);
retv.wsecs = wsecs;
gpscal_add_offset(&retv, fofs); /* result is normalized */
retv.weeks = pivot->weeks;
/* Manual periodic extension without division: */
if (pivot->wsecs < shift) {
int32_t lim = pivot->wsecs + shift;
retv.weeks -= (retv.wsecs > lim ||
(retv.wsecs == lim && retv.frac >= pivot->frac));
} else {
int32_t lim = pivot->wsecs - shift;
retv.weeks += (retv.wsecs < lim ||
(retv.wsecs == lim && retv.frac < pivot->frac));
}
return _gpscal_fix_gps_era(&retv);
}
/* -----------------------------------------------------------------
* expand a time-of-week around a pivot given as week datum
*/
TGpsDatum
gpscal_from_weektime2(
int32_t wsecs,
l_fp fofs,
TcGpsDatum * pivot
)
{
TGpsDatum wpiv = * pivot;
_norm_gps_datum(&wpiv);
return _gpscal_from_weektime(wsecs, fofs, &wpiv);
}
/* -----------------------------------------------------------------
* epand a time-of-week around an pivot given as LFP, which in turn
* is expanded around the current system time and then converted
* into a week datum.
*/
TGpsDatum
gpscal_from_weektime1(
int32_t wsecs,
l_fp fofs,
l_fp pivot
)
{
vint64 pvi64;
TGpsDatum wpiv;
ntpcal_split split;
/* get 64-bit pivot in NTP epoch */
pvi64 = ntpcal_ntp_to_ntp(pivot.l_ui, NULL);
/* convert to weeks since 1899-12-31 and seconds in week */
pvi64 = addv64u32(&pvi64, (GPSNTP_DSHIFT * SECSPERDAY));
split = ntpcal_weeksplit(&pvi64);
wpiv.weeks = split.hi;
wpiv.wsecs = split.lo;
wpiv.frac = pivot.l_uf;
return _gpscal_from_weektime(wsecs, fofs, &wpiv);
}
/* -----------------------------------------------------------------
* get week/tow representation from day/tod datum
*/
TGpsDatum
gpscal_from_gpsntp(
TcNtpDatum * gd
)
{
TGpsDatum retv;
vint64 ts64;
ntpcal_split split;
ts64 = ntpcal_dayjoin(gd->days, gd->secs);
ts64 = addv64u32(&ts64, (GPSNTP_DSHIFT * SECSPERDAY));
split = ntpcal_weeksplit(&ts64);
retv.frac = gd->frac;
retv.wsecs = split.lo;
retv.weeks = split.hi;
return retv;
}
/* -----------------------------------------------------------------
* convert week/tow to LFP stamp
*/
l_fp
ntpfp_from_gpsdatum(
TcGpsDatum * gd
)
{
l_fp retv;
retv.l_uf = gd->frac;
retv.l_ui = gd->weeks * (uint32_t)SECSPERWEEK
+ (uint32_t)gd->wsecs
- (uint32_t)SECSPERDAY * GPSNTP_DSHIFT;
return retv;
}
/* -*-EOF-*- */
-2
View File
@@ -226,7 +226,6 @@ get_full_recv_buffer(void)
LOCK();
#ifdef HAVE_SIGNALED_IO
/*
* make sure there are free buffers when we
* wander off to do lengthy packet processing with
@@ -241,7 +240,6 @@ get_full_recv_buffer(void)
*/
create_buffers(RECV_INC);
}
#endif
/*
* try to grab a full buffer
+12 -5
View File
@@ -181,16 +181,23 @@ static const struct codestring res_access_bits[] = {
{ RES_IGNORE, "ignore", 0 },
{ RES_DONTSERVE, "noserve", "serve" },
{ RES_DONTTRUST, "notrust", "trust" },
{ RES_NOQUERY, "noquery", "query" },
{ RES_NOMODIFY, "nomodify", 0 },
{ RES_VERSION, "version", 0 },
{ RES_NOPEER, "nopeer", "peer" },
{ RES_NOEPEER, "noepeer", "epeer" },
{ RES_LIMITED, "limited", 0 },
{ RES_NOQUERY, "noquery", "query" },
{ RES_NOMODIFY, "nomodify", 0 },
{ RES_NOTRAP, "notrap", "trap" },
{ RES_LPTRAP, "lptrap", 0 },
{ RES_LIMITED, "limited", 0 },
{ RES_VERSION, "version", 0 },
{ RES_KOD, "kod", 0 },
{ RES_MSSNTP, "mssntp", 0 },
{ RES_FLAKE, "flake", 0 },
{ RES_NOMRULIST, "nomrulist", 0 },
{ RES_SRVRSPFUZ, "serverresponse fuzz", 0 },
/* not used with getcode(), no terminating entry needed */
};
@@ -418,7 +425,7 @@ res_match_flags(
const char *
res_access_flags(
u_short af
u_int32 af
)
{
return decode_bitflags(af, " ", res_access_bits,
+11 -15
View File
@@ -619,12 +619,11 @@ clamp_systime(void)
{
#if SIZEOF_TIME_T > 4
struct timeval timetv, tvlast;
struct timeval tvbase, tvlast;
struct timespec timets;
uint32_t tdiff;
timetv.tv_sec = basedate_get_erabase();
tvbase.tv_sec = basedate_get_erabase();
tvbase.tv_usec = 0;
/* ---> time-critical path starts ---> */
@@ -636,28 +635,24 @@ clamp_systime(void)
tvlast.tv_usec -= 1000000;
tvlast.tv_sec += 1;
}
timetv.tv_usec = tvlast.tv_usec;
tdiff = (uint32_t)(tvlast.tv_sec & UINT32_MAX) -
(uint32_t)(timetv.tv_sec & UINT32_MAX);
timetv.tv_sec += tdiff;
if (timetv.tv_sec != tvlast.tv_sec) {
if (tvbase.tv_sec > tvlast.tv_sec) {
/* now set new system time */
if (ntp_set_tod(&timetv, NULL) != 0) {
if (ntp_set_tod(&tvbase, NULL) != 0) {
msyslog(LOG_ERR, "clamp-systime: %m");
return FALSE;
}
} else {
msyslog(LOG_INFO,
"clamp-systime: clock (%s) in allowed range",
tv_fmt_libbuf(&timetv));
tv_fmt_libbuf(&tvlast));
return FALSE;
}
/* <--- time-critical path ended with 'ntp_set_tod()' <--- */
sys_residual = 0;
lamport_violated = (timetv.tv_sec < tvlast.tv_sec);
lamport_violated = (tvbase.tv_sec < tvlast.tv_sec);
if (step_callback)
(*step_callback)();
@@ -668,15 +663,16 @@ clamp_systime(void)
_clear_adjtime();
# endif
update_uwtmp(timetv, tvlast);
update_uwtmp(tvbase, tvlast);
msyslog(LOG_WARNING,
"clamp-systime: clock stepped from %s to %s!",
tv_fmt_libbuf(&tvlast), tv_fmt_libbuf(&timetv));
tv_fmt_libbuf(&tvlast), tv_fmt_libbuf(&tvbase));
return TRUE;
#else
return 0;
return FALSE;
#endif
}
+233
View File
@@ -0,0 +1,233 @@
/*
* timespecops.c -- calculations on 'struct timespec' values
*
* Written by Juergen Perlinger (perlinger@ntp.org) for the NTP project.
* The contents of 'html/copyright.html' apply.
*
*/
#include "config.h"
#include <sys/types.h>
#include <stdio.h>
#include <math.h>
#include "ntp.h"
#include "timetoa.h"
#include "timespecops.h"
/* nanoseconds per second */
#define NANOSECONDS 1000000000
/* conversion between l_fp fractions and nanoseconds */
#ifdef HAVE_U_INT64
# define FTOTVN(tsf) \
((int32) \
(((u_int64)(tsf) * NANOSECONDS + 0x80000000) >> 32))
# define TVNTOF(tvu) \
((u_int32) \
((((u_int64)(tvu) << 32) + NANOSECONDS / 2) / \
NANOSECONDS))
#else
# define NSECFRAC (FRAC / NANOSECONDS)
# define FTOTVN(tsf) \
((int32)((tsf) / NSECFRAC + 0.5))
# define TVNTOF(tvu) \
((u_int32)((tvu) * NSECFRAC + 0.5))
#endif
/* make sure nanoseconds are in nominal range */
struct timespec
normalize_tspec(
struct timespec x
)
{
#if SIZEOF_LONG > 4
long z;
/*
* tv_nsec is of type 'long', and on a 64-bit machine using only
* loops becomes prohibitive once the upper 32 bits get
* involved. On the other hand, division by constant should be
* fast enough; so we do a division of the nanoseconds in that
* case. The floor adjustment step follows with the standard
* normalisation loops. And labs() is intentionally not used
* here: it has implementation-defined behaviour when applied
* to LONG_MIN.
*/
if (x.tv_nsec < -3l * NANOSECONDS ||
x.tv_nsec > 3l * NANOSECONDS) {
z = x.tv_nsec / NANOSECONDS;
x.tv_nsec -= z * NANOSECONDS;
x.tv_sec += z;
}
#endif
/* since 10**9 is close to 2**32, we don't divide but do a
* normalisation in a loop; this takes 3 steps max, and should
* outperform a division even if the mul-by-inverse trick is
* employed. */
if (x.tv_nsec < 0)
do {
x.tv_nsec += NANOSECONDS;
x.tv_sec--;
} while (x.tv_nsec < 0);
else if (x.tv_nsec >= NANOSECONDS)
do {
x.tv_nsec -= NANOSECONDS;
x.tv_sec++;
} while (x.tv_nsec >= NANOSECONDS);
return x;
}
/* x = abs(a) */
struct timespec
abs_tspec(
struct timespec a
)
{
struct timespec c;
c = normalize_tspec(a);
if (c.tv_sec < 0) {
if (c.tv_nsec != 0) {
c.tv_sec = -c.tv_sec - 1;
c.tv_nsec = NANOSECONDS - c.tv_nsec;
} else {
c.tv_sec = -c.tv_sec;
}
}
return c;
}
/*
* compare previously-normalised a and b
* return 1 / 0 / -1 if a < / == / > b
*/
int
cmp_tspec(
struct timespec a,
struct timespec b
)
{
int r;
r = (a.tv_sec > b.tv_sec) - (a.tv_sec < b.tv_sec);
if (0 == r)
r = (a.tv_nsec > b.tv_nsec) -
(a.tv_nsec < b.tv_nsec);
return r;
}
/*
* test previously-normalised a
* return 1 / 0 / -1 if a < / == / > 0
*/
int
test_tspec(
struct timespec a
)
{
int r;
r = (a.tv_sec > 0) - (a.tv_sec < 0);
if (r == 0)
r = (a.tv_nsec > 0);
return r;
}
/*
* convert to l_fp type, relative and absolute
*/
/* convert from timespec duration to l_fp duration */
l_fp
tspec_intv_to_lfp(
struct timespec x
)
{
struct timespec v;
l_fp y;
v = normalize_tspec(x);
y.l_uf = TVNTOF(v.tv_nsec);
y.l_i = (int32)v.tv_sec;
return y;
}
/* convert from l_fp type, relative signed/unsigned and absolute */
struct timespec
lfp_intv_to_tspec(
l_fp x
)
{
struct timespec out;
l_fp absx;
int neg;
neg = L_ISNEG(&x);
absx = x;
if (neg) {
L_NEG(&absx);
}
out.tv_nsec = FTOTVN(absx.l_uf);
out.tv_sec = absx.l_i;
if (neg) {
out.tv_sec = -out.tv_sec;
out.tv_nsec = -out.tv_nsec;
out = normalize_tspec(out);
}
return out;
}
struct timespec
lfp_uintv_to_tspec(
l_fp x
)
{
struct timespec out;
out.tv_nsec = FTOTVN(x.l_uf);
out.tv_sec = x.l_ui;
return out;
}
/*
* absolute (timestamp) conversion. Input is time in NTP epoch, output
* is in UN*X epoch. The NTP time stamp will be expanded around the
* pivot time *p or the current time, if p is NULL.
*/
struct timespec
lfp_stamp_to_tspec(
l_fp x,
const time_t * p
)
{
struct timespec out;
vint64 sec;
sec = ntpcal_ntp_to_time(x.l_ui, p);
out.tv_nsec = FTOTVN(x.l_uf);
/* copying a vint64 to a time_t needs some care... */
#if SIZEOF_TIME_T <= 4
out.tv_sec = (time_t)sec.d_s.lo;
#elif defined(HAVE_INT64)
out.tv_sec = (time_t)sec.q_s;
#else
out.tv_sec = ((time_t)sec.d_s.hi << 32) | sec.d_s.lo;
#endif
return out;
}
/* -*-EOF-*- */
+83
View File
@@ -0,0 +1,83 @@
/*
* timexsup.c - 'struct timex' support functions
*
* Written by Juergen Perlinger (perlinger@ntp.org) for the NTP project.
* The contents of 'html/copyright.html' apply.
*/
#include "config.h"
#include "timexsup.h"
#include <limits.h>
#include <math.h>
#ifdef HAVE_SYS_TIMEX_H
# include <sys/timex.h>
#endif
#if defined(MOD_NANO) != defined(STA_NANO)
# warning inconsistent definitions of MOD_NANO vs STA_NANO
#endif
static long
clamp_rounded(
double dval
)
{
/* round */
dval = floor(dval + 0.5);
/* clamp / saturate */
if (dval >= LONG_MAX)
return LONG_MAX;
if (dval <= LONG_MIN)
return LONG_MIN;
return (long)dval;
}
double
dbl_from_var_long(
long lval,
int status
)
{
#ifdef STA_NANO
if (status & STA_NANO)
return (double)lval * 1e-9;
#else
(void)status;
#endif
return (double)lval * 1e-6;
}
double
dbl_from_usec_long(
long lval
)
{
return (double)lval * 1e-6;
}
long
var_long_from_dbl(
double dval,
unsigned int * modes
)
{
#ifdef MOD_NANO
*modes |= MOD_NANO;
dval *= 1e+9;
#else
(void)modes;
dval *= 1e+6;
#endif
return clamp_rounded(dval);
}
long
usec_long_from_dbl(
double dval
)
{
return clamp_rounded(dval * 1e+6);
}
+3 -1
View File
@@ -164,9 +164,11 @@ parse: $(parsesolaris_OBJECTS) libparse_kernel.a ../libntp/libntp.a
parsesolaris.o: sys/systm.h
# [Bug3608] Solaris has inconsistent definitions of ffs() and fls(). Drop the
# ones from 'systm.h'.
sys/systm.h:
-mkdir sys
sed -e '/ffs(.*)/d' < /usr/include/sys/systm.h > sys/systm.h
sed -e '/f[fl]s(.*)/d' < /usr/include/sys/systm.h > sys/systm.h
## check-libparse is invoked by ntpd/Makefile.am
check-libparse: $(noinst_LIBRARIES)
+3 -1
View File
@@ -1000,9 +1000,11 @@ parse: $(parsesolaris_OBJECTS) libparse_kernel.a ../libntp/libntp.a
parsesolaris.o: sys/systm.h
# [Bug3608] Solaris has inconsistent definitions of ffs() and fls(). Drop the
# ones from 'systm.h'.
sys/systm.h:
-mkdir sys
sed -e '/ffs(.*)/d' < /usr/include/sys/systm.h > sys/systm.h
sed -e '/f[fl]s(.*)/d' < /usr/include/sys/systm.h > sys/systm.h
check-libparse: $(noinst_LIBRARIES)
@: do-nothing action to avoid default SCCS get
+55
View File
@@ -220,6 +220,58 @@ pcheck(
return psum;
}
static int/*BOOL*/
zeller_expand(
clocktime_t *clock_time,
unsigned int wd
)
{
unsigned int y = (unsigned int)clock_time->year;
unsigned int m = (unsigned int)clock_time->month - 1u;
unsigned int d = (unsigned int)clock_time->day - 1u;
unsigned int c;
/* Check basic constraints first. */
if ((y >= 100u) || (m >= 12u) || (d >= 31u) || (--wd >= 7u))
return FALSE;
/* Get weekday of date in 1st century by a variation on Zeller's
* congruence. All operands are non-negative, and the month
* formula is adjusted to use a divider of 32, so we can do a
* shift instead of a 'true' division:
*/
if ((m += 10u) >= 12u) /* shift base to 0000-03-01 */
m -= 12u;
else if (--y >= 100u)
y += 100;
d += y + (y >> 2) + 2u; /* year-related share */
d += (m * 83u + 16u) >> 5; /* month-related share */
/* The next step combines the exact division by modular inverse
* with the (mod 7) step in such way that no true division and
* only one multiplication is needed. The multiplier is
* M <- ceil((3*8)/7 * 2**29)
* and combines multiplication by invmod(5, 7) -> 3 and modulus
* by 7 transformation to (mod 8) in one step.
* Note that 252 == 0 (mod 7) and that 'd' is less than 185,
* so the number to invert and reduce is strictly positive. In
* the end, 'c' is number of centuries since start of a great
* cycle and must be in [0..3] or we had bad input.
*/
c = (((252u + wd - d) * 0x6db6db6eU) >> 29) & 7u;
if (c >= 4)
return FALSE;
/* undo calendar base shift now */
if ((m > 9u) && (++y >= 100u)) {
y -= 100u;
c = (c + 1u) & 3u;
}
/* combine year with centuries & map to [1970..2369] */
y += (c * 100u);
clock_time->year = (int)y + ((y < 370u) ? 2000 : 1600);
return TRUE;
}
static u_long
convert_rawdcf(
unsigned char *buffer,
@@ -288,6 +340,9 @@ convert_rawdcf(
clock_time->year = ext_bf(buffer, DCF_Y10, dcfprm->zerobits);
clock_time->year = TIMES10(clock_time->year) + ext_bf(buffer, DCF_Y1, dcfprm->zerobits);
if (!zeller_expand(clock_time, ext_bf(buffer, DCF_DW, dcfprm->zerobits)))
return CVT_FAIL|CVT_BADFMT;
switch (ext_bf(buffer, DCF_Z, dcfprm->zerobits))
{
case DCF_Z_MET:
+49 -7
View File
@@ -25,7 +25,7 @@ if SAVECONFIG_ENABLED
if NTP_CROSSCOMPILE
CHECK_SAVECONFIG=
else
CHECK_SAVECONFIG= check-saveconfig
CHECK_SAVECONFIG= check-saveconfig check-pslsaveconfig
endif
else !SAVECONFIG_ENABLED
CHECK_SAVECONFIG=
@@ -110,9 +110,20 @@ DISTCLEANFILES = \
$(NULL)
CLEANFILES = \
check-psl0 \
check-psl1 \
check-psl2 \
check-pslsaveconfig \
check-saveconfig \
compsave.conf \
compsave.conf+ \
k-g-u-submake \
psl0save.conf \
psl0save.conf+ \
psl1save.conf \
psl1save.conf+ \
psl2save.conf \
psl2save.conf+ \
$(EXTRA_PROGRAMS) \
$(NULL)
@@ -147,6 +158,9 @@ EXTRA_DIST = \
ntpd.html \
ntpd.texi \
ntpdbase-opts.def \
psl0.conf \
psl1.conf \
psl2.conf \
refclock_msfees.c \
$(B_S_DIST) \
$(NULL)
@@ -345,13 +359,13 @@ $(srcdir)/invoke-ntp.keys.menu: $(srcdir)/invoke-ntp.keys.texi
$(srcdir)/invoke-ntp.keys.texi: $(srcdir)/ntp.keys.def $(std_def_list)
$(run_ag) -Tagtexi-file.tpl -DLEVEL=section ntp.keys.def
$(srcdir)/ntp.conf.html: $(srcdir)/ntp.conf.texi $(top_srcdir)/sntp/include/version.texi
$(srcdir)/ntp.conf.html: $(srcdir)/ntp.conf.texi $(srcdir)/invoke-ntp.conf.texi $(top_srcdir)/sntp/include/version.texi
cd $(srcdir) && ( makeinfo --force --html --no-split -o ntp.conf.html ntp.conf.texi || true )
$(srcdir)/ntp.keys.html: $(srcdir)/ntp.keys.texi $(top_srcdir)/sntp/include/version.texi
$(srcdir)/ntp.keys.html: $(srcdir)/ntp.keys.texi $(srcdir)/invoke-ntp.keys.texi $(top_srcdir)/sntp/include/version.texi
cd $(srcdir) && ( makeinfo --force --html --no-split -o ntp.keys.html ntp.keys.texi || true )
$(srcdir)/ntpd.html: $(srcdir)/ntpd.texi $(top_srcdir)/sntp/include/version.texi
$(srcdir)/ntpd.html: $(srcdir)/ntpd.texi $(srcdir)/invoke-ntpd.texi $(top_srcdir)/sntp/include/version.texi
cd $(srcdir) && ( makeinfo --force --html --no-split -o ntpd.html ntpd.texi || true )
###
@@ -413,13 +427,41 @@ $(srcdir)/invoke-ntpd.texi: $(srcdir)/ntpd-opts.def $(srcdir)/ntpdbase-opts.def
$(PROGRAMS): $(LDADD)
compsave.conf: ntpd complete.conf
./ntpd --configfile complete.conf --saveconfigquit $@
check-saveconfig: complete.conf compsave.conf
-diff -u complete.conf compsave.conf
cmp complete.conf compsave.conf && echo stamp > $@
compsave.conf: ntpd complete.conf
./ntpd --configfile complete.conf --saveconfigquit $@+
grep -v '^#' $@+ > $@
check-pslsaveconfig: check-psl0 check-psl1 check-psl2
echo stamp > $@
check-psl0: psl0.conf psl0save.conf
-diff -u $< psl0save.conf
cmp $< psl0save.conf && echo stamp > $@
psl0save.conf: psl0.conf ntpd
./ntpd --configfile $< --saveconfigquit $@+
grep -v '^#' $@+ > $@
check-psl1: psl1.conf psl1save.conf
-diff -u $< psl1save.conf
cmp $< psl1save.conf && echo stamp > $@
psl1save.conf: psl1.conf ntpd
./ntpd --configfile $< --saveconfigquit $@+
grep -v '^#' $@+ > $@
check-psl2: psl2.conf psl2save.conf
-diff -u $< psl2save.conf
cmp $< psl2save.conf && echo stamp > $@
psl2save.conf: psl2.conf ntpd
./ntpd --configfile $< --saveconfigquit $@+
grep -v '^#' $@+ > $@
../libntp/libntpsim.a:
cd ../libntp && $(MAKE) $(AM_MAKEFLAGS) libntpsim.a
+43 -9
View File
@@ -615,7 +615,7 @@ AM_LDFLAGS = $(LDFLAGS_NTP) $(NTP_HARD_LDFLAGS)
# LDADD might need RESLIB and ADJLIB.
LDADD = version.o libntpd.a $(LIBPARSE)
AM_YFLAGS = -d -t -r all
@NTP_CROSSCOMPILE_FALSE@@SAVECONFIG_ENABLED_TRUE@CHECK_SAVECONFIG = check-saveconfig
@NTP_CROSSCOMPILE_FALSE@@SAVECONFIG_ENABLED_TRUE@CHECK_SAVECONFIG = check-saveconfig check-pslsaveconfig
@NTP_CROSSCOMPILE_TRUE@@SAVECONFIG_ENABLED_TRUE@CHECK_SAVECONFIG =
@SAVECONFIG_ENABLED_FALSE@CHECK_SAVECONFIG =
@VPATH_HACK_FALSE@VPHACK =
@@ -667,8 +667,11 @@ DISTCLEANFILES = \
$(man_MANS) \
$(NULL)
CLEANFILES = check-saveconfig compsave.conf k-g-u-submake \
$(EXTRA_PROGRAMS) $(NULL) check-libopts check-libntp .deps-ver
CLEANFILES = check-psl0 check-psl1 check-psl2 check-pslsaveconfig \
check-saveconfig compsave.conf compsave.conf+ k-g-u-submake \
psl0save.conf psl0save.conf+ psl1save.conf psl1save.conf+ \
psl2save.conf psl2save.conf+ $(EXTRA_PROGRAMS) $(NULL) \
check-libopts check-libntp .deps-ver
EXTRA_DIST = \
complete.conf.in \
invoke-ntp.conf.menu \
@@ -700,6 +703,9 @@ EXTRA_DIST = \
ntpd.html \
ntpd.texi \
ntpdbase-opts.def \
psl0.conf \
psl1.conf \
psl2.conf \
refclock_msfees.c \
$(B_S_DIST) \
$(NULL)
@@ -1743,13 +1749,13 @@ $(srcdir)/invoke-ntp.keys.menu: $(srcdir)/invoke-ntp.keys.texi
$(srcdir)/invoke-ntp.keys.texi: $(srcdir)/ntp.keys.def $(std_def_list)
$(run_ag) -Tagtexi-file.tpl -DLEVEL=section ntp.keys.def
$(srcdir)/ntp.conf.html: $(srcdir)/ntp.conf.texi $(top_srcdir)/sntp/include/version.texi
$(srcdir)/ntp.conf.html: $(srcdir)/ntp.conf.texi $(srcdir)/invoke-ntp.conf.texi $(top_srcdir)/sntp/include/version.texi
cd $(srcdir) && ( makeinfo --force --html --no-split -o ntp.conf.html ntp.conf.texi || true )
$(srcdir)/ntp.keys.html: $(srcdir)/ntp.keys.texi $(top_srcdir)/sntp/include/version.texi
$(srcdir)/ntp.keys.html: $(srcdir)/ntp.keys.texi $(srcdir)/invoke-ntp.keys.texi $(top_srcdir)/sntp/include/version.texi
cd $(srcdir) && ( makeinfo --force --html --no-split -o ntp.keys.html ntp.keys.texi || true )
$(srcdir)/ntpd.html: $(srcdir)/ntpd.texi $(top_srcdir)/sntp/include/version.texi
$(srcdir)/ntpd.html: $(srcdir)/ntpd.texi $(srcdir)/invoke-ntpd.texi $(top_srcdir)/sntp/include/version.texi
cd $(srcdir) && ( makeinfo --force --html --no-split -o ntpd.html ntpd.texi || true )
###
@@ -1811,13 +1817,41 @@ $(srcdir)/invoke-ntpd.texi: $(srcdir)/ntpd-opts.def $(srcdir)/ntpdbase-opts.def
$(PROGRAMS): $(LDADD)
compsave.conf: ntpd complete.conf
./ntpd --configfile complete.conf --saveconfigquit $@
check-saveconfig: complete.conf compsave.conf
-diff -u complete.conf compsave.conf
cmp complete.conf compsave.conf && echo stamp > $@
compsave.conf: ntpd complete.conf
./ntpd --configfile complete.conf --saveconfigquit $@+
grep -v '^#' $@+ > $@
check-pslsaveconfig: check-psl0 check-psl1 check-psl2
echo stamp > $@
check-psl0: psl0.conf psl0save.conf
-diff -u $< psl0save.conf
cmp $< psl0save.conf && echo stamp > $@
psl0save.conf: psl0.conf ntpd
./ntpd --configfile $< --saveconfigquit $@+
grep -v '^#' $@+ > $@
check-psl1: psl1.conf psl1save.conf
-diff -u $< psl1save.conf
cmp $< psl1save.conf && echo stamp > $@
psl1save.conf: psl1.conf ntpd
./ntpd --configfile $< --saveconfigquit $@+
grep -v '^#' $@+ > $@
check-psl2: psl2.conf psl2save.conf
-diff -u $< psl2save.conf
cmp $< psl2save.conf && echo stamp > $@
psl2save.conf: psl2.conf ntpd
./ntpd --configfile $< --saveconfigquit $@+
grep -v '^#' $@+ > $@
../libntp/libntpsim.a:
cd ../libntp && $(MAKE) $(AM_MAKEFLAGS) libntpsim.a
+3 -3
View File
@@ -71,7 +71,7 @@ getCmdOpts(
}
if (HAVE_OPT( DRIFTFILE ))
stats_config(STATS_FREQ_FILE, OPT_ARG( DRIFTFILE ));
stats_config(STATS_FREQ_FILE, OPT_ARG( DRIFTFILE ), 0);
if (HAVE_OPT( PANICGATE ))
allow_panic = TRUE;
@@ -90,7 +90,7 @@ getCmdOpts(
getauthkeys(OPT_ARG( KEYFILE ));
if (HAVE_OPT( PIDFILE ))
stats_config(STATS_PID_FILE, OPT_ARG( PIDFILE ));
stats_config(STATS_PID_FILE, OPT_ARG( PIDFILE ), 0);
if (HAVE_OPT( QUIT ))
mode_ntpdate = TRUE;
@@ -110,7 +110,7 @@ getCmdOpts(
} while (0);
if (HAVE_OPT( STATSDIR ))
stats_config(STATS_STATSDIR, OPT_ARG( STATSDIR ));
stats_config(STATS_STATSDIR, OPT_ARG( STATSDIR ), 0);
if (HAVE_OPT( TRUSTEDKEY )) {
int ct = STACKCT_OPT( TRUSTEDKEY );
+7 -4
View File
@@ -1,7 +1,8 @@
saveconfigdir "/etc/ntp/conf"
driftfile "/etc/ntp.drift" 1e-7
driftfile "/etc/ntp.drift"
logfile "/var/log/ntp.log"
leapfile "/etc/ntp.leapseconds"
leapfile "/etc/ntp.leapseconds" ignorehash
leapfile "/etc/ntp.leapseconds" checkhash
@HAVE_LEAPSMEARINTERVAL@
nonvolatile 1e-7
ident "udent"
@@ -31,14 +32,14 @@ rlimit@HAVE_RLIMIT_MEMLOCK@@HAVE_RLIMIT_STACK@
tinker allan 1500 dispersion 15 freq 0 huffpuff 7200 panic 1000 step 0.128 stepout 900 tick 0.01
broadcastclient
server 127.127.1.0 mode 4294967295 prefer true
fudge 127.127.1.0 time1 0 time2 1.1 stratum 7 refid Abcd
fudge 127.127.1.0 time1 0 time2 1.1 stratum 7 refid Abcd minjitter 0.2
pool 0.north-america.pool.ntp.org. iburst preempt
server 1.north-america.pool.ntp.org. iburst
server -4 2.north-america.pool.ntp.org. minpoll 6 maxpoll 10 iburst
server -6 ntp.davehart.net. minpoll 6 maxpoll 10 version 5 burst iburst
peer -6 davehart.broker.freenet6.net. ident "autokey-group" xleave autokey
peer -4 192.168.192.168 key 1 noselect
server [fe80::123%1]
server [fe80::123%1] xmtnonce
broadcast 192.168.192.255
manycastclient 224.0.1.1
manycastclient ff05::101
@@ -46,6 +47,7 @@ manycastserver 224.0.1.1 ff05::101
multicastclient 224.0.1.1 ff05::101
mru maxage 64 mindepth 600 initalloc 600 initmem 16 incalloc 99 incmem 4 maxdepth 1024 maxmem 4096
discard minimum 1 average 3 monitor 3000
pollskewlist 3 1|2 4 3|4 default 6|7
restrict default ippeerlimit -1
restrict default ippeerlimit 0 nomodify limited kod noserve nomrulist
restrict source ippeerlimit 1
@@ -53,6 +55,7 @@ restrict source ippeerlimit 2 nomodify limited kod
restrict trusted.host.name.example.com. ippeerlimit -1 nomodify
restrict [fe80::1] mask [ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff] ippeerlimit -1
restrict 127.0.0.1 mask 255.255.255.255 ippeerlimit -1
restrict 127.0.0.2 ippeerlimit -1 serverresponse fuzz
restrict ::1 ippeerlimit -1
interface drop ipv6
interface ignore ipv4
+31 -7
View File
@@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-ntp.conf.texi)
#
# It has been AutoGen-ed February 20, 2019 at 09:56:39 AM by AutoGen 5.18.5
# It has been AutoGen-ed March 3, 2020 at 05:40:57 PM by AutoGen 5.18.5
# From the definitions ntp.conf.def
# and the template file agtexi-file.tpl
@end ignore
@@ -134,8 +134,8 @@ qualifier forces DNS resolution to the IPv6 namespace.
See IPv6 references for the
equivalent classes for that address family.
@table @asis
@item @code{pool} @kbd{address} @code{[@code{burst}]} @code{[@code{iburst}]} @code{[@code{version} @kbd{version}]} @code{[@code{prefer}]} @code{[@code{minpoll} @kbd{minpoll}]} @code{[@code{maxpoll} @kbd{maxpoll}]}
@item @code{server} @kbd{address} @code{[@code{key} @kbd{key} @kbd{|} @code{autokey}]} @code{[@code{burst}]} @code{[@code{iburst}]} @code{[@code{version} @kbd{version}]} @code{[@code{prefer}]} @code{[@code{minpoll} @kbd{minpoll}]} @code{[@code{maxpoll} @kbd{maxpoll}]} @code{[@code{true}]}
@item @code{pool} @kbd{address} @code{[@code{burst}]} @code{[@code{iburst}]} @code{[@code{version} @kbd{version}]} @code{[@code{prefer}]} @code{[@code{minpoll} @kbd{minpoll}]} @code{[@code{maxpoll} @kbd{maxpoll}]} @code{[@code{xmtnonce}]}
@item @code{server} @kbd{address} @code{[@code{key} @kbd{key} @kbd{|} @code{autokey}]} @code{[@code{burst}]} @code{[@code{iburst}]} @code{[@code{version} @kbd{version}]} @code{[@code{prefer}]} @code{[@code{minpoll} @kbd{minpoll}]} @code{[@code{maxpoll} @kbd{maxpoll}]} @code{[@code{true}]} @code{[@code{xmtnonce}]}
@item @code{peer} @kbd{address} @code{[@code{key} @kbd{key} @kbd{|} @code{autokey}]} @code{[@code{version} @kbd{version}]} @code{[@code{prefer}]} @code{[@code{minpoll} @kbd{minpoll}]} @code{[@code{maxpoll} @kbd{maxpoll}]} @code{[@code{true}]} @code{[@code{xleave}]}
@item @code{broadcast} @kbd{address} @code{[@code{key} @kbd{key} @kbd{|} @code{autokey}]} @code{[@code{version} @kbd{version}]} @code{[@code{prefer}]} @code{[@code{minpoll} @kbd{minpoll}]} @code{[@code{ttl} @kbd{ttl}]} @code{[@code{xleave}]}
@item @code{manycastclient} @kbd{address} @code{[@code{key} @kbd{key} @kbd{|} @code{autokey}]} @code{[@code{version} @kbd{version}]} @code{[@code{prefer}]} @code{[@code{minpoll} @kbd{minpoll}]} @code{[@code{maxpoll} @kbd{maxpoll}]} @code{[@code{ttl} @kbd{ttl}]}
@@ -305,9 +305,6 @@ Marks the server as unused, except for display purposes.
The server is discarded by the selection algroithm.
@item @code{preempt}
Says the association can be preempted.
@item @code{true}
Marks the server as a truechimer.
Use this option only for testing.
@item @code{prefer}
Marks the server as preferred.
All other things being equal,
@@ -321,7 +318,8 @@ provided in
@file{/usr/share/doc/ntp})
for further information.
@item @code{true}
Forces the association to always survive the selection and clustering algorithms.
Marks the server as a truechimer,
forcing the association to always survive the selection and clustering algorithms.
This option should almost certainly
@emph{only}
be used while testing an association.
@@ -349,6 +347,13 @@ Valid in
and
@code{broadcast}
modes only, this flag enables interleave mode.
@item @code{xmtnonce}
Valid only for
@code{server}
and
@code{pool}
modes, this flag puts a random number in the packet's transmit timestamp.
@end table
@subsubsection Auxiliary Commands
@table @asis
@@ -1622,6 +1627,10 @@ The
@code{ntpport}
is considered more specific and
is sorted later in the list.
@item @code{serverresponse fuzz}
When reponding to server requests,
fuzz the low order bits of the
@code{reftime}.
@item @code{version}
Deny packets that do not match the current NTP version.
@end table
@@ -2766,6 +2775,21 @@ For the JJY driver (type 40 mode 100 - 180), the argument is
one telephone number used to dial the telephone JJY service.
The Hayes command ATDT is normally prepended to the number.
The number can contain other modem control codes as well.
@item @code{pollskewlist} @code{[@kbd{poll} @kbd{value} | @kbd{value}]} @kbd{...} @code{[@code{default} @kbd{value} | @kbd{value}]}
Enable skewing of our poll requests to our servers.
@kbd{poll}
is a number between 3 and 17 inclusive, identifying a specific poll interval.
A poll interval is 2^n seconds in duration,
so a poll value of 3 corresponds to 8 seconds
and
a poll interval of 17 corresponds to
131,072 seconds, or about a day and a half.
The next two numbers must be between 0 and one-half of the poll interval,
inclusive.
The first number specifies how early the poll may start,
while
the second number specifies how late the poll may be delayed.
With no arguments, internally specified default values are chosen.
@item @code{reset} @code{[@code{allpeers}]} @code{[@code{auth}]} @code{[@code{ctl}]} @code{[@code{io}]} @code{[@code{mem}]} @code{[@code{sys}]} @code{[@code{timer}]}
Reset one or more groups of counters maintained by
@code{ntpd}
+1 -1
View File
@@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-ntp.keys.texi)
#
# It has been AutoGen-ed February 20, 2019 at 09:56:41 AM by AutoGen 5.18.5
# It has been AutoGen-ed March 3, 2020 at 05:40:59 PM by AutoGen 5.18.5
# From the definitions ntp.keys.def
# and the template file agtexi-file.tpl
@end ignore
+2 -2
View File
@@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-ntpd.texi)
#
# It has been AutoGen-ed February 20, 2019 at 09:56:42 AM by AutoGen 5.18.5
# It has been AutoGen-ed March 3, 2020 at 05:41:00 PM by AutoGen 5.18.5
# From the definitions ntpd-opts.def
# and the template file agtexi-cmd.tpl
@end ignore
@@ -142,7 +142,7 @@ with a status code of 0.
@exampleindent 0
@example
ntpd - NTP daemon program - Ver. 4.2.8p13
ntpd - NTP daemon program - Ver. 4.2.8p14
Usage: ntpd [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... \
[ <server1> ... <serverN> ]
Flg Arg Option-Name Description
+1 -1
View File
@@ -1 +1 @@
* Generated 2018-01-14 03:53:33 UTC diff_ignore_line
* Generated 2020-02-13 08:56:28 UTC diff_ignore_line
+8
View File
@@ -43,6 +43,7 @@ struct key_tok ntp_keywords[] = {
{ "broadcast", T_Broadcast, FOLLBY_STRING },
{ "broadcastclient", T_Broadcastclient, FOLLBY_TOKEN },
{ "broadcastdelay", T_Broadcastdelay, FOLLBY_TOKEN },
{ "checkhash", T_Checkhash, FOLLBY_TOKEN },
{ "ctl", T_Ctl, FOLLBY_TOKEN },
{ "disable", T_Disable, FOLLBY_TOKEN },
{ "driftfile", T_Driftfile, FOLLBY_STRING },
@@ -51,6 +52,7 @@ struct key_tok ntp_keywords[] = {
{ "end", T_End, FOLLBY_TOKEN },
{ "filegen", T_Filegen, FOLLBY_TOKEN },
{ "fudge", T_Fudge, FOLLBY_STRING },
{ "ignorehash", T_Ignorehash, FOLLBY_TOKEN },
{ "io", T_Io, FOLLBY_TOKEN },
{ "includefile", T_Includefile, FOLLBY_STRING },
{ "leapfile", T_Leapfile, FOLLBY_STRING },
@@ -64,12 +66,16 @@ struct key_tok ntp_keywords[] = {
{ "peer", T_Peer, FOLLBY_STRING },
{ "phone", T_Phone, FOLLBY_STRINGS_TO_EOC },
{ "pidfile", T_Pidfile, FOLLBY_STRING },
{ "pollskewlist", T_PollSkewList, FOLLBY_TOKEN },
{ "pool", T_Pool, FOLLBY_STRING },
{ "discard", T_Discard, FOLLBY_TOKEN },
{ "reset", T_Reset, FOLLBY_TOKEN },
{ "restrict", T_Restrict, FOLLBY_TOKEN },
{ "rlimit", T_Rlimit, FOLLBY_TOKEN },
{ "server", T_Server, FOLLBY_STRING },
{ "serverresponse", T_Serverresponse, FOLLBY_TOKEN },
{ "fuzz", T_Fuzz, FOLLBY_TOKEN },
{ "poll", T_Poll, FOLLBY_TOKEN },
{ "setvar", T_Setvar, FOLLBY_STRING },
{ "statistics", T_Statistics, FOLLBY_TOKEN },
{ "statsdir", T_Statsdir, FOLLBY_STRING },
@@ -81,6 +87,7 @@ struct key_tok ntp_keywords[] = {
{ "trap", T_Trap, FOLLBY_STRING },
{ "unconfig", T_Unconfig, FOLLBY_STRING },
{ "unpeer", T_Unpeer, FOLLBY_STRING },
{ "xmtnonce", T_Xmtnonce, FOLLBY_TOKEN },
/* authentication_command */
{ "controlkey", T_ControlKey, FOLLBY_TOKEN },
{ "crypto", T_Crypto, FOLLBY_TOKEN },
@@ -199,6 +206,7 @@ struct key_tok ntp_keywords[] = {
{ "stratum", T_Stratum, FOLLBY_TOKEN },
{ "time1", T_Time1, FOLLBY_TOKEN },
{ "time2", T_Time2, FOLLBY_TOKEN },
{ "minjitter", T_Minjitter, FOLLBY_TOKEN },
/* system_option */
{ "auth", T_Auth, FOLLBY_TOKEN },
{ "bclient", T_Bclient, FOLLBY_TOKEN },
+35 -10
View File
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
.TH ntp.conf 5man "20 Feb 2019" "4.2.8p13" "File Formats"
.TH ntp.conf 5man "03 Mar 2020" "4.2.8p14" "File Formats"
.\"
.\" EDIT THIS FILE WITH CAUTION (in-mem file)
.\"
.\" It has been AutoGen-ed February 20, 2019 at 09:56:43 AM by AutoGen 5.18.5
.\" It has been AutoGen-ed March 3, 2020 at 05:41:02 PM by AutoGen 5.18.5
.\" From the definitions ntp.conf.def
.\" and the template file agman-cmd.tpl
.SH NAME
@@ -161,9 +161,9 @@ qualifier forces DNS resolution to the IPv6 namespace.
See IPv6 references for the
equivalent classes for that address family.
.TP 7
.NOP \f\*[B-Font]pool\f[] \f\*[I-Font]address\f[] [\f\*[B-Font]burst\f[]] [\f\*[B-Font]iburst\f[]] [\f\*[B-Font]version\f[] \f\*[I-Font]version\f[]] [\f\*[B-Font]prefer\f[]] [\f\*[B-Font]minpoll\f[] \f\*[I-Font]minpoll\f[]] [\f\*[B-Font]maxpoll\f[] \f\*[I-Font]maxpoll\f[]]
.NOP \f\*[B-Font]pool\f[] \f\*[I-Font]address\f[] [\f\*[B-Font]burst\f[]] [\f\*[B-Font]iburst\f[]] [\f\*[B-Font]version\f[] \f\*[I-Font]version\f[]] [\f\*[B-Font]prefer\f[]] [\f\*[B-Font]minpoll\f[] \f\*[I-Font]minpoll\f[]] [\f\*[B-Font]maxpoll\f[] \f\*[I-Font]maxpoll\f[]] [\f\*[B-Font]xmtnonce\f[]]
.TP 7
.NOP \f\*[B-Font]server\f[] \f\*[I-Font]address\f[] [\f\*[B-Font]key\f[] \f\*[I-Font]key\f[] \f\*[I-Font]\&|\f[] \f\*[B-Font]autokey\f[]] [\f\*[B-Font]burst\f[]] [\f\*[B-Font]iburst\f[]] [\f\*[B-Font]version\f[] \f\*[I-Font]version\f[]] [\f\*[B-Font]prefer\f[]] [\f\*[B-Font]minpoll\f[] \f\*[I-Font]minpoll\f[]] [\f\*[B-Font]maxpoll\f[] \f\*[I-Font]maxpoll\f[]] [\f\*[B-Font]true\f[]]
.NOP \f\*[B-Font]server\f[] \f\*[I-Font]address\f[] [\f\*[B-Font]key\f[] \f\*[I-Font]key\f[] \f\*[I-Font]\&|\f[] \f\*[B-Font]autokey\f[]] [\f\*[B-Font]burst\f[]] [\f\*[B-Font]iburst\f[]] [\f\*[B-Font]version\f[] \f\*[I-Font]version\f[]] [\f\*[B-Font]prefer\f[]] [\f\*[B-Font]minpoll\f[] \f\*[I-Font]minpoll\f[]] [\f\*[B-Font]maxpoll\f[] \f\*[I-Font]maxpoll\f[]] [\f\*[B-Font]true\f[]] [\f\*[B-Font]xmtnonce\f[]]
.TP 7
.NOP \f\*[B-Font]peer\f[] \f\*[I-Font]address\f[] [\f\*[B-Font]key\f[] \f\*[I-Font]key\f[] \f\*[I-Font]\&|\f[] \f\*[B-Font]autokey\f[]] [\f\*[B-Font]version\f[] \f\*[I-Font]version\f[]] [\f\*[B-Font]prefer\f[]] [\f\*[B-Font]minpoll\f[] \f\*[I-Font]minpoll\f[]] [\f\*[B-Font]maxpoll\f[] \f\*[I-Font]maxpoll\f[]] [\f\*[B-Font]true\f[]] [\f\*[B-Font]xleave\f[]]
.TP 7
@@ -352,10 +352,6 @@ The server is discarded by the selection algroithm.
.NOP \f\*[B-Font]preempt\f[]
Says the association can be preempted.
.TP 7
.NOP \f\*[B-Font]true\f[]
Marks the server as a truechimer.
Use this option only for testing.
.TP 7
.NOP \f\*[B-Font]prefer\f[]
Marks the server as preferred.
All other things being equal,
@@ -370,7 +366,8 @@ provided in
for further information.
.TP 7
.NOP \f\*[B-Font]true\f[]
Forces the association to always survive the selection and clustering algorithms.
Marks the server as a truechimer,
forcing the association to always survive the selection and clustering algorithms.
This option should almost certainly
\fIonly\f[]
be used while testing an association.
@@ -401,6 +398,13 @@ Valid in
and
\f\*[B-Font]broadcast\f[]
modes only, this flag enables interleave mode.
.TP 7
.NOP \f\*[B-Font]xmtnonce\f[]
Valid only for
\f\*[B-Font]server\f[]
and
\f\*[B-Font]pool\f[]
modes, this flag puts a random number in the packet's transmit timestamp.
.PP
.SS Auxiliary Commands
.TP 7
@@ -1838,6 +1842,11 @@ The
is considered more specific and
is sorted later in the list.
.TP 7
.NOP \f\*[B-Font]serverresponse fuzz\f[]
When reponding to server requests,
fuzz the low order bits of the
\f\*[B-Font]reftime\f[].
.TP 7
.NOP \f\*[B-Font]version\f[]
Deny packets that do not match the current NTP version.
.RE
@@ -3092,6 +3101,22 @@ one telephone number used to dial the telephone JJY service.
The Hayes command ATDT is normally prepended to the number.
The number can contain other modem control codes as well.
.TP 7
.NOP \f\*[B-Font]pollskewlist\f[] [\f\*[I-Font]poll\f[] \f\*[I-Font]value\f[] | \f\*[I-Font]value\f[]] \f\*[I-Font]...\f[] [\f\*[B-Font]default\f[] \f\*[I-Font]value\f[] | \f\*[I-Font]value\f[]]
Enable skewing of our poll requests to our servers.
\f\*[I-Font]poll\f[]
is a number between 3 and 17 inclusive, identifying a specific poll interval.
A poll interval is 2^n seconds in duration,
so a poll value of 3 corresponds to 8 seconds
and
a poll interval of 17 corresponds to
131,072 seconds, or about a day and a half.
The next two numbers must be between 0 and one-half of the poll interval,
inclusive.
The first number specifies how early the poll may start,
while
the second number specifies how late the poll may be delayed.
With no arguments, internally specified default values are chosen.
.TP 7
.NOP \f\*[B-Font]reset\f[] [\f\*[B-Font]allpeers\f[]] [\f\*[B-Font]auth\f[]] [\f\*[B-Font]ctl\f[]] [\f\*[B-Font]io\f[]] [\f\*[B-Font]mem\f[]] [\f\*[B-Font]sys\f[]] [\f\*[B-Font]timer\f[]]
Reset one or more groups of counters maintained by
\f\*[B-Font]ntpd\f[]
@@ -3424,7 +3449,7 @@ RFC5905
.SH "AUTHORS"
The University of Delaware and Network Time Foundation
.SH "COPYRIGHT"
Copyright (C) 1992-2017 The University of Delaware and Network Time Foundation all rights reserved.
Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation all rights reserved.
This program is released under the terms of the NTP license, <http://ntp.org/license>.
.SH BUGS
The syntax checking is not picky; some combinations of
+42 -7
View File
@@ -1,9 +1,9 @@
.Dd February 20 2019
.Dd March 3 2020
.Dt NTP_CONF 5mdoc File Formats
.Os
.\" EDIT THIS FILE WITH CAUTION (ntp.mdoc)
.\"
.\" It has been AutoGen-ed February 20, 2019 at 09:56:34 AM by AutoGen 5.18.5
.\" It has been AutoGen-ed March 3, 2020 at 05:40:53 PM by AutoGen 5.18.5
.\" From the definitions ntp.conf.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
@@ -144,6 +144,7 @@ equivalent classes for that address family.
.Op Cm prefer
.Op Cm minpoll Ar minpoll
.Op Cm maxpoll Ar maxpoll
.Op Cm xmtnonce
.Xc
.It Xo Ic server Ar address
.Op Cm key Ar key \&| Cm autokey
@@ -154,6 +155,7 @@ equivalent classes for that address family.
.Op Cm minpoll Ar minpoll
.Op Cm maxpoll Ar maxpoll
.Op Cm true
.Op Cm xmtnonce
.Xc
.It Xo Ic peer Ar address
.Op Cm key Ar key \&| Cm autokey
@@ -346,9 +348,6 @@ Marks the server as unused, except for display purposes.
The server is discarded by the selection algroithm.
.It Cm preempt
Says the association can be preempted.
.It Cm true
Marks the server as a truechimer.
Use this option only for testing.
.It Cm prefer
Marks the server as preferred.
All other things being equal,
@@ -362,7 +361,8 @@ provided in
.Pa /usr/share/doc/ntp )
for further information.
.It Cm true
Forces the association to always survive the selection and clustering algorithms.
Marks the server as a truechimer,
forcing the association to always survive the selection and clustering algorithms.
This option should almost certainly
.Em only
be used while testing an association.
@@ -390,6 +390,12 @@ Valid in
and
.Cm broadcast
modes only, this flag enables interleave mode.
.It Cm xmtnonce
Valid only for
.Cm server
and
.Cm pool
modes, this flag puts a random number in the packet's transmit timestamp.
.El
.Ss Auxiliary Commands
.Bl -tag -width indent
@@ -1694,6 +1700,10 @@ The
.Cm ntpport
is considered more specific and
is sorted later in the list.
.It Ic "serverresponse fuzz"
When reponding to server requests,
fuzz the low order bits of the
.Cm reftime .
.It Cm version
Deny packets that do not match the current NTP version.
.El
@@ -2919,6 +2929,31 @@ For the JJY driver (type 40 mode 100 \- 180), the argument is
one telephone number used to dial the telephone JJY service.
The Hayes command ATDT is normally prepended to the number.
The number can contain other modem control codes as well.
.It Xo Cm pollskewlist
.Oo
.Ar poll
.Ar value | value
.Oc
.Ar ...
.Oo
.Cm default
.Ar value | value
.Oc
.Xc
Enable skewing of our poll requests to our servers.
.Ar poll
is a number between 3 and 17 inclusive, identifying a specific poll interval.
A poll interval is 2^n seconds in duration,
so a poll value of 3 corresponds to 8 seconds
and
a poll interval of 17 corresponds to
131,072 seconds, or about a day and a half.
The next two numbers must be between 0 and one\-half of the poll interval,
inclusive.
The first number specifies how early the poll may start,
while
the second number specifies how late the poll may be delayed.
With no arguments, internally specified default values are chosen.
.It Xo Ic reset
.Oo
.Ic allpeers
@@ -3255,7 +3290,7 @@ A snapshot of this documentation is available in HTML format in
.Sh "AUTHORS"
The University of Delaware and Network Time Foundation
.Sh "COPYRIGHT"
Copyright (C) 1992\-2017 The University of Delaware and Network Time Foundation all rights reserved.
Copyright (C) 1992\-2020 The University of Delaware and Network Time Foundation all rights reserved.
This program is released under the terms of the NTP license, <http://ntp.org/license>.
.Sh BUGS
The syntax checking is not picky; some combinations of
+40 -4
View File
@@ -146,6 +146,7 @@ equivalent classes for that address family.
.Op Cm prefer
.Op Cm minpoll Ar minpoll
.Op Cm maxpoll Ar maxpoll
.Op Cm xmtnonce
.Xc
.It Xo Ic server Ar address
.Op Cm key Ar key \&| Cm autokey
@@ -156,6 +157,7 @@ equivalent classes for that address family.
.Op Cm minpoll Ar minpoll
.Op Cm maxpoll Ar maxpoll
.Op Cm true
.Op Cm xmtnonce
.Xc
.It Xo Ic peer Ar address
.Op Cm key Ar key \&| Cm autokey
@@ -348,9 +350,6 @@ Marks the server as unused, except for display purposes.
The server is discarded by the selection algroithm.
.It Cm preempt
Says the association can be preempted.
.It Cm true
Marks the server as a truechimer.
Use this option only for testing.
.It Cm prefer
Marks the server as preferred.
All other things being equal,
@@ -364,7 +363,8 @@ provided in
.Pa /usr/share/doc/ntp )
for further information.
.It Cm true
Forces the association to always survive the selection and clustering algorithms.
Marks the server as a truechimer,
forcing the association to always survive the selection and clustering algorithms.
This option should almost certainly
.Em only
be used while testing an association.
@@ -392,6 +392,13 @@ Valid in
and
.Cm broadcast
modes only, this flag enables interleave mode.
.It Cm xmtnonce
Valid only for
.Cm server
and
.Cm pool
modes, this flag puts a random number in the packet's transmit timestamp.
.El
.Ss Auxiliary Commands
.Bl -tag -width indent
@@ -1696,6 +1703,10 @@ The
.Cm ntpport
is considered more specific and
is sorted later in the list.
.It Ic "serverresponse fuzz"
When reponding to server requests,
fuzz the low order bits of the
.Cm reftime .
.It Cm version
Deny packets that do not match the current NTP version.
.El
@@ -2921,6 +2932,31 @@ For the JJY driver (type 40 mode 100 - 180), the argument is
one telephone number used to dial the telephone JJY service.
The Hayes command ATDT is normally prepended to the number.
The number can contain other modem control codes as well.
.It Xo Cm pollskewlist
.Oo
.Ar poll
.Ar value | value
.Oc
.Ar ...
.Oo
.Cm default
.Ar value | value
.Oc
.Xc
Enable skewing of our poll requests to our servers.
.Ar poll
is a number between 3 and 17 inclusive, identifying a specific poll interval.
A poll interval is 2^n seconds in duration,
so a poll value of 3 corresponds to 8 seconds
and
a poll interval of 17 corresponds to
131,072 seconds, or about a day and a half.
The next two numbers must be between 0 and one-half of the poll interval,
inclusive.
The first number specifies how early the poll may start,
while
the second number specifies how late the poll may be delayed.
With no arguments, internally specified default values are chosen.
.It Xo Ic reset
.Oo
.Ic allpeers
+34 -8
View File
@@ -61,7 +61,7 @@ Next: <a href="#ntp_002econf-Description" accesskey="n" rel="next">ntp.conf Desc
<p>This document describes the configuration file for the NTP Project&rsquo;s
<code>ntpd</code> program.
</p>
<p>This document applies to version 4.2.8p13 of <code>ntp.conf</code>.
<p>This document applies to version 4.2.8p14 of <code>ntp.conf</code>.
</p>
<a name="SEC_Overview"></a>
<h2 class="shortcontents-heading">Short Table of Contents</h2>
@@ -257,8 +257,8 @@ qualifier forces DNS resolution to the IPv6 namespace.
See IPv6 references for the
equivalent classes for that address family.
</p><dl compact="compact">
<dt><code>pool</code> <kbd>address</kbd> <code>[<code>burst</code>]</code> <code>[<code>iburst</code>]</code> <code>[<code>version</code> <kbd>version</kbd>]</code> <code>[<code>prefer</code>]</code> <code>[<code>minpoll</code> <kbd>minpoll</kbd>]</code> <code>[<code>maxpoll</code> <kbd>maxpoll</kbd>]</code></dt>
<dt><code>server</code> <kbd>address</kbd> <code>[<code>key</code> <kbd>key</kbd> <kbd>|</kbd> <code>autokey</code>]</code> <code>[<code>burst</code>]</code> <code>[<code>iburst</code>]</code> <code>[<code>version</code> <kbd>version</kbd>]</code> <code>[<code>prefer</code>]</code> <code>[<code>minpoll</code> <kbd>minpoll</kbd>]</code> <code>[<code>maxpoll</code> <kbd>maxpoll</kbd>]</code> <code>[<code>true</code>]</code></dt>
<dt><code>pool</code> <kbd>address</kbd> <code>[<code>burst</code>]</code> <code>[<code>iburst</code>]</code> <code>[<code>version</code> <kbd>version</kbd>]</code> <code>[<code>prefer</code>]</code> <code>[<code>minpoll</code> <kbd>minpoll</kbd>]</code> <code>[<code>maxpoll</code> <kbd>maxpoll</kbd>]</code> <code>[<code>xmtnonce</code>]</code></dt>
<dt><code>server</code> <kbd>address</kbd> <code>[<code>key</code> <kbd>key</kbd> <kbd>|</kbd> <code>autokey</code>]</code> <code>[<code>burst</code>]</code> <code>[<code>iburst</code>]</code> <code>[<code>version</code> <kbd>version</kbd>]</code> <code>[<code>prefer</code>]</code> <code>[<code>minpoll</code> <kbd>minpoll</kbd>]</code> <code>[<code>maxpoll</code> <kbd>maxpoll</kbd>]</code> <code>[<code>true</code>]</code> <code>[<code>xmtnonce</code>]</code></dt>
<dt><code>peer</code> <kbd>address</kbd> <code>[<code>key</code> <kbd>key</kbd> <kbd>|</kbd> <code>autokey</code>]</code> <code>[<code>version</code> <kbd>version</kbd>]</code> <code>[<code>prefer</code>]</code> <code>[<code>minpoll</code> <kbd>minpoll</kbd>]</code> <code>[<code>maxpoll</code> <kbd>maxpoll</kbd>]</code> <code>[<code>true</code>]</code> <code>[<code>xleave</code>]</code></dt>
<dt><code>broadcast</code> <kbd>address</kbd> <code>[<code>key</code> <kbd>key</kbd> <kbd>|</kbd> <code>autokey</code>]</code> <code>[<code>version</code> <kbd>version</kbd>]</code> <code>[<code>prefer</code>]</code> <code>[<code>minpoll</code> <kbd>minpoll</kbd>]</code> <code>[<code>ttl</code> <kbd>ttl</kbd>]</code> <code>[<code>xleave</code>]</code></dt>
<dt><code>manycastclient</code> <kbd>address</kbd> <code>[<code>key</code> <kbd>key</kbd> <kbd>|</kbd> <code>autokey</code>]</code> <code>[<code>version</code> <kbd>version</kbd>]</code> <code>[<code>prefer</code>]</code> <code>[<code>minpoll</code> <kbd>minpoll</kbd>]</code> <code>[<code>maxpoll</code> <kbd>maxpoll</kbd>]</code> <code>[<code>ttl</code> <kbd>ttl</kbd>]</code></dt>
@@ -440,10 +440,6 @@ The server is discarded by the selection algroithm.
<dt><code>preempt</code></dt>
<dd><p>Says the association can be preempted.
</p></dd>
<dt><code>true</code></dt>
<dd><p>Marks the server as a truechimer.
Use this option only for testing.
</p></dd>
<dt><code>prefer</code></dt>
<dd><p>Marks the server as preferred.
All other things being equal,
@@ -458,7 +454,8 @@ provided in
for further information.
</p></dd>
<dt><code>true</code></dt>
<dd><p>Forces the association to always survive the selection and clustering algorithms.
<dd><p>Marks the server as a truechimer,
forcing the association to always survive the selection and clustering algorithms.
This option should almost certainly
<em>only</em>
be used while testing an association.
@@ -490,6 +487,14 @@ and
<code>broadcast</code>
modes only, this flag enables interleave mode.
</p></dd>
<dt><code>xmtnonce</code></dt>
<dd><p>Valid only for
<code>server</code>
and
<code>pool</code>
modes, this flag puts a random number in the packet&rsquo;s transmit timestamp.
</p>
</dd>
</dl>
<a name="Auxiliary-Commands"></a>
<h4 class="subsubsection">1.1.1.2 Auxiliary Commands</h4>
@@ -1862,6 +1867,11 @@ The
is considered more specific and
is sorted later in the list.
</p></dd>
<dt><code>serverresponse fuzz</code></dt>
<dd><p>When reponding to server requests,
fuzz the low order bits of the
<code>reftime</code>.
</p></dd>
<dt><code>version</code></dt>
<dd><p>Deny packets that do not match the current NTP version.
</p></dd>
@@ -3077,6 +3087,22 @@ one telephone number used to dial the telephone JJY service.
The Hayes command ATDT is normally prepended to the number.
The number can contain other modem control codes as well.
</p></dd>
<dt><code>pollskewlist</code> <code>[<kbd>poll</kbd> <kbd>value</kbd> | <kbd>value</kbd>]</code> <kbd>...</kbd> <code>[<code>default</code> <kbd>value</kbd> | <kbd>value</kbd>]</code></dt>
<dd><p>Enable skewing of our poll requests to our servers.
<kbd>poll</kbd>
is a number between 3 and 17 inclusive, identifying a specific poll interval.
A poll interval is 2^n seconds in duration,
so a poll value of 3 corresponds to 8 seconds
and
a poll interval of 17 corresponds to
131,072 seconds, or about a day and a half.
The next two numbers must be between 0 and one-half of the poll interval,
inclusive.
The first number specifies how early the poll may start,
while
the second number specifies how late the poll may be delayed.
With no arguments, internally specified default values are chosen.
</p></dd>
<dt><code>reset</code> <code>[<code>allpeers</code>]</code> <code>[<code>auth</code>]</code> <code>[<code>ctl</code>]</code> <code>[<code>io</code>]</code> <code>[<code>mem</code>]</code> <code>[<code>sys</code>]</code> <code>[<code>timer</code>]</code></dt>
<dd><p>Reset one or more groups of counters maintained by
<code>ntpd</code>
+35 -10
View File
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
.TH ntp.conf 5 "20 Feb 2019" "4.2.8p13" "File Formats"
.TH ntp.conf 5 "03 Mar 2020" "4.2.8p14" "File Formats"
.\"
.\" EDIT THIS FILE WITH CAUTION (in-mem file)
.\"
.\" It has been AutoGen-ed February 20, 2019 at 09:56:43 AM by AutoGen 5.18.5
.\" It has been AutoGen-ed March 3, 2020 at 05:41:02 PM by AutoGen 5.18.5
.\" From the definitions ntp.conf.def
.\" and the template file agman-cmd.tpl
.SH NAME
@@ -161,9 +161,9 @@ qualifier forces DNS resolution to the IPv6 namespace.
See IPv6 references for the
equivalent classes for that address family.
.TP 7
.NOP \f\*[B-Font]pool\f[] \f\*[I-Font]address\f[] [\f\*[B-Font]burst\f[]] [\f\*[B-Font]iburst\f[]] [\f\*[B-Font]version\f[] \f\*[I-Font]version\f[]] [\f\*[B-Font]prefer\f[]] [\f\*[B-Font]minpoll\f[] \f\*[I-Font]minpoll\f[]] [\f\*[B-Font]maxpoll\f[] \f\*[I-Font]maxpoll\f[]]
.NOP \f\*[B-Font]pool\f[] \f\*[I-Font]address\f[] [\f\*[B-Font]burst\f[]] [\f\*[B-Font]iburst\f[]] [\f\*[B-Font]version\f[] \f\*[I-Font]version\f[]] [\f\*[B-Font]prefer\f[]] [\f\*[B-Font]minpoll\f[] \f\*[I-Font]minpoll\f[]] [\f\*[B-Font]maxpoll\f[] \f\*[I-Font]maxpoll\f[]] [\f\*[B-Font]xmtnonce\f[]]
.TP 7
.NOP \f\*[B-Font]server\f[] \f\*[I-Font]address\f[] [\f\*[B-Font]key\f[] \f\*[I-Font]key\f[] \f\*[I-Font]\&|\f[] \f\*[B-Font]autokey\f[]] [\f\*[B-Font]burst\f[]] [\f\*[B-Font]iburst\f[]] [\f\*[B-Font]version\f[] \f\*[I-Font]version\f[]] [\f\*[B-Font]prefer\f[]] [\f\*[B-Font]minpoll\f[] \f\*[I-Font]minpoll\f[]] [\f\*[B-Font]maxpoll\f[] \f\*[I-Font]maxpoll\f[]] [\f\*[B-Font]true\f[]]
.NOP \f\*[B-Font]server\f[] \f\*[I-Font]address\f[] [\f\*[B-Font]key\f[] \f\*[I-Font]key\f[] \f\*[I-Font]\&|\f[] \f\*[B-Font]autokey\f[]] [\f\*[B-Font]burst\f[]] [\f\*[B-Font]iburst\f[]] [\f\*[B-Font]version\f[] \f\*[I-Font]version\f[]] [\f\*[B-Font]prefer\f[]] [\f\*[B-Font]minpoll\f[] \f\*[I-Font]minpoll\f[]] [\f\*[B-Font]maxpoll\f[] \f\*[I-Font]maxpoll\f[]] [\f\*[B-Font]true\f[]] [\f\*[B-Font]xmtnonce\f[]]
.TP 7
.NOP \f\*[B-Font]peer\f[] \f\*[I-Font]address\f[] [\f\*[B-Font]key\f[] \f\*[I-Font]key\f[] \f\*[I-Font]\&|\f[] \f\*[B-Font]autokey\f[]] [\f\*[B-Font]version\f[] \f\*[I-Font]version\f[]] [\f\*[B-Font]prefer\f[]] [\f\*[B-Font]minpoll\f[] \f\*[I-Font]minpoll\f[]] [\f\*[B-Font]maxpoll\f[] \f\*[I-Font]maxpoll\f[]] [\f\*[B-Font]true\f[]] [\f\*[B-Font]xleave\f[]]
.TP 7
@@ -352,10 +352,6 @@ The server is discarded by the selection algroithm.
.NOP \f\*[B-Font]preempt\f[]
Says the association can be preempted.
.TP 7
.NOP \f\*[B-Font]true\f[]
Marks the server as a truechimer.
Use this option only for testing.
.TP 7
.NOP \f\*[B-Font]prefer\f[]
Marks the server as preferred.
All other things being equal,
@@ -370,7 +366,8 @@ provided in
for further information.
.TP 7
.NOP \f\*[B-Font]true\f[]
Forces the association to always survive the selection and clustering algorithms.
Marks the server as a truechimer,
forcing the association to always survive the selection and clustering algorithms.
This option should almost certainly
\fIonly\f[]
be used while testing an association.
@@ -401,6 +398,13 @@ Valid in
and
\f\*[B-Font]broadcast\f[]
modes only, this flag enables interleave mode.
.TP 7
.NOP \f\*[B-Font]xmtnonce\f[]
Valid only for
\f\*[B-Font]server\f[]
and
\f\*[B-Font]pool\f[]
modes, this flag puts a random number in the packet's transmit timestamp.
.PP
.SS Auxiliary Commands
.TP 7
@@ -1838,6 +1842,11 @@ The
is considered more specific and
is sorted later in the list.
.TP 7
.NOP \f\*[B-Font]serverresponse fuzz\f[]
When reponding to server requests,
fuzz the low order bits of the
\f\*[B-Font]reftime\f[].
.TP 7
.NOP \f\*[B-Font]version\f[]
Deny packets that do not match the current NTP version.
.RE
@@ -3092,6 +3101,22 @@ one telephone number used to dial the telephone JJY service.
The Hayes command ATDT is normally prepended to the number.
The number can contain other modem control codes as well.
.TP 7
.NOP \f\*[B-Font]pollskewlist\f[] [\f\*[I-Font]poll\f[] \f\*[I-Font]value\f[] | \f\*[I-Font]value\f[]] \f\*[I-Font]...\f[] [\f\*[B-Font]default\f[] \f\*[I-Font]value\f[] | \f\*[I-Font]value\f[]]
Enable skewing of our poll requests to our servers.
\f\*[I-Font]poll\f[]
is a number between 3 and 17 inclusive, identifying a specific poll interval.
A poll interval is 2^n seconds in duration,
so a poll value of 3 corresponds to 8 seconds
and
a poll interval of 17 corresponds to
131,072 seconds, or about a day and a half.
The next two numbers must be between 0 and one-half of the poll interval,
inclusive.
The first number specifies how early the poll may start,
while
the second number specifies how late the poll may be delayed.
With no arguments, internally specified default values are chosen.
.TP 7
.NOP \f\*[B-Font]reset\f[] [\f\*[B-Font]allpeers\f[]] [\f\*[B-Font]auth\f[]] [\f\*[B-Font]ctl\f[]] [\f\*[B-Font]io\f[]] [\f\*[B-Font]mem\f[]] [\f\*[B-Font]sys\f[]] [\f\*[B-Font]timer\f[]]
Reset one or more groups of counters maintained by
\f\*[B-Font]ntpd\f[]
@@ -3424,7 +3449,7 @@ RFC5905
.SH "AUTHORS"
The University of Delaware and Network Time Foundation
.SH "COPYRIGHT"
Copyright (C) 1992-2017 The University of Delaware and Network Time Foundation all rights reserved.
Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation all rights reserved.
This program is released under the terms of the NTP license, <http://ntp.org/license>.
.SH BUGS
The syntax checking is not picky; some combinations of
+42 -7
View File
@@ -1,9 +1,9 @@
.Dd February 20 2019
.Dd March 3 2020
.Dt NTP_CONF 5 File Formats
.Os
.\" EDIT THIS FILE WITH CAUTION (ntp.mdoc)
.\"
.\" It has been AutoGen-ed February 20, 2019 at 09:56:34 AM by AutoGen 5.18.5
.\" It has been AutoGen-ed March 3, 2020 at 05:40:53 PM by AutoGen 5.18.5
.\" From the definitions ntp.conf.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
@@ -144,6 +144,7 @@ equivalent classes for that address family.
.Op Cm prefer
.Op Cm minpoll Ar minpoll
.Op Cm maxpoll Ar maxpoll
.Op Cm xmtnonce
.Xc
.It Xo Ic server Ar address
.Op Cm key Ar key \&| Cm autokey
@@ -154,6 +155,7 @@ equivalent classes for that address family.
.Op Cm minpoll Ar minpoll
.Op Cm maxpoll Ar maxpoll
.Op Cm true
.Op Cm xmtnonce
.Xc
.It Xo Ic peer Ar address
.Op Cm key Ar key \&| Cm autokey
@@ -346,9 +348,6 @@ Marks the server as unused, except for display purposes.
The server is discarded by the selection algroithm.
.It Cm preempt
Says the association can be preempted.
.It Cm true
Marks the server as a truechimer.
Use this option only for testing.
.It Cm prefer
Marks the server as preferred.
All other things being equal,
@@ -362,7 +361,8 @@ provided in
.Pa /usr/share/doc/ntp )
for further information.
.It Cm true
Forces the association to always survive the selection and clustering algorithms.
Marks the server as a truechimer,
forcing the association to always survive the selection and clustering algorithms.
This option should almost certainly
.Em only
be used while testing an association.
@@ -390,6 +390,12 @@ Valid in
and
.Cm broadcast
modes only, this flag enables interleave mode.
.It Cm xmtnonce
Valid only for
.Cm server
and
.Cm pool
modes, this flag puts a random number in the packet's transmit timestamp.
.El
.Ss Auxiliary Commands
.Bl -tag -width indent
@@ -1694,6 +1700,10 @@ The
.Cm ntpport
is considered more specific and
is sorted later in the list.
.It Ic "serverresponse fuzz"
When reponding to server requests,
fuzz the low order bits of the
.Cm reftime .
.It Cm version
Deny packets that do not match the current NTP version.
.El
@@ -2919,6 +2929,31 @@ For the JJY driver (type 40 mode 100 \- 180), the argument is
one telephone number used to dial the telephone JJY service.
The Hayes command ATDT is normally prepended to the number.
The number can contain other modem control codes as well.
.It Xo Cm pollskewlist
.Oo
.Ar poll
.Ar value | value
.Oc
.Ar ...
.Oo
.Cm default
.Ar value | value
.Oc
.Xc
Enable skewing of our poll requests to our servers.
.Ar poll
is a number between 3 and 17 inclusive, identifying a specific poll interval.
A poll interval is 2^n seconds in duration,
so a poll value of 3 corresponds to 8 seconds
and
a poll interval of 17 corresponds to
131,072 seconds, or about a day and a half.
The next two numbers must be between 0 and one\-half of the poll interval,
inclusive.
The first number specifies how early the poll may start,
while
the second number specifies how late the poll may be delayed.
With no arguments, internally specified default values are chosen.
.It Xo Ic reset
.Oo
.Ic allpeers
@@ -3255,7 +3290,7 @@ A snapshot of this documentation is available in HTML format in
.Sh "AUTHORS"
The University of Delaware and Network Time Foundation
.Sh "COPYRIGHT"
Copyright (C) 1992\-2017 The University of Delaware and Network Time Foundation all rights reserved.
Copyright (C) 1992\-2020 The University of Delaware and Network Time Foundation all rights reserved.
This program is released under the terms of the NTP license, <http://ntp.org/license>.
.Sh BUGS
The syntax checking is not picky; some combinations of
+3 -3
View File
@@ -1,8 +1,8 @@
.TH ntp.keys 5man "20 Feb 2019" "4.2.8p13" "File Formats"
.TH ntp.keys 5man "03 Mar 2020" "4.2.8p14" "File Formats"
.\"
.\" EDIT THIS FILE WITH CAUTION (ntp.man)
.\"
.\" It has been AutoGen-ed February 20, 2019 at 09:56:44 AM by AutoGen 5.18.5
.\" It has been AutoGen-ed March 3, 2020 at 05:41:04 PM by AutoGen 5.18.5
.\" From the definitions ntp.keys.def
.\" and the template file agman-file.tpl
.Sh NAME
@@ -176,7 +176,7 @@ the default name of the configuration file
.SH "AUTHORS"
The University of Delaware and Network Time Foundation
.SH "COPYRIGHT"
Copyright (C) 1992-2017 The University of Delaware and Network Time Foundation all rights reserved.
Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation all rights reserved.
This program is released under the terms of the NTP license, <http://ntp.org/license>.
.SH "BUGS"
Please send bug reports to: http://bugs.ntp.org, [email protected]
+3 -3
View File
@@ -1,9 +1,9 @@
.Dd February 20 2019
.Dd March 3 2020
.Dt NTP_KEYS 5mdoc File Formats
.Os FreeBSD 11.2-RELEASE_SI
.\" EDIT THIS FILE WITH CAUTION (ntp.mdoc)
.\"
.\" It has been AutoGen-ed February 20, 2019 at 09:56:35 AM by AutoGen 5.18.5
.\" It has been AutoGen-ed March 3, 2020 at 05:40:54 PM by AutoGen 5.18.5
.\" From the definitions ntp.keys.def
.\" and the template file agmdoc-file.tpl
.Sh NAME
@@ -163,7 +163,7 @@ it to autogen\[email protected]. Thank you.
.Sh "AUTHORS"
The University of Delaware and Network Time Foundation
.Sh "COPYRIGHT"
Copyright (C) 1992\-2017 The University of Delaware and Network Time Foundation all rights reserved.
Copyright (C) 1992\-2020 The University of Delaware and Network Time Foundation all rights reserved.
This program is released under the terms of the NTP license, <http://ntp.org/license>.
.Sh "BUGS"
Please send bug reports to: http://bugs.ntp.org, [email protected]
+1 -1
View File
@@ -61,7 +61,7 @@ Next: <a href="#ntp_002ekeys-Description" accesskey="n" rel="next">ntp.keys Desc
<p>This document describes the symmetric key file for the NTP Project&rsquo;s
<code>ntpd</code> program.
</p>
<p>This document applies to version 4.2.8p13 of <code>ntp.keys</code>.
<p>This document applies to version 4.2.8p14 of <code>ntp.keys</code>.
</p>
<a name="SEC_Overview"></a>
<h2 class="shortcontents-heading">Short Table of Contents</h2>
+3 -3
View File
@@ -1,8 +1,8 @@
.TH ntp.keys 5 "20 Feb 2019" "4.2.8p13" "File Formats"
.TH ntp.keys 5 "03 Mar 2020" "4.2.8p14" "File Formats"
.\"
.\" EDIT THIS FILE WITH CAUTION (ntp.man)
.\"
.\" It has been AutoGen-ed February 20, 2019 at 09:56:44 AM by AutoGen 5.18.5
.\" It has been AutoGen-ed March 3, 2020 at 05:41:04 PM by AutoGen 5.18.5
.\" From the definitions ntp.keys.def
.\" and the template file agman-file.tpl
.Sh NAME
@@ -176,7 +176,7 @@ the default name of the configuration file
.SH "AUTHORS"
The University of Delaware and Network Time Foundation
.SH "COPYRIGHT"
Copyright (C) 1992-2017 The University of Delaware and Network Time Foundation all rights reserved.
Copyright (C) 1992-2020 The University of Delaware and Network Time Foundation all rights reserved.
This program is released under the terms of the NTP license, <http://ntp.org/license>.
.SH "BUGS"
Please send bug reports to: http://bugs.ntp.org, [email protected]
+3 -3
View File
@@ -1,9 +1,9 @@
.Dd February 20 2019
.Dd March 3 2020
.Dt NTP_KEYS 5 File Formats
.Os FreeBSD 11.2-RELEASE_SI
.\" EDIT THIS FILE WITH CAUTION (ntp.mdoc)
.\"
.\" It has been AutoGen-ed February 20, 2019 at 09:56:35 AM by AutoGen 5.18.5
.\" It has been AutoGen-ed March 3, 2020 at 05:40:54 PM by AutoGen 5.18.5
.\" From the definitions ntp.keys.def
.\" and the template file agmdoc-file.tpl
.Sh NAME
@@ -163,7 +163,7 @@ it to autogen\[email protected]. Thank you.
.Sh "AUTHORS"
The University of Delaware and Network Time Foundation
.Sh "COPYRIGHT"
Copyright (C) 1992\-2017 The University of Delaware and Network Time Foundation all rights reserved.
Copyright (C) 1992\-2020 The University of Delaware and Network Time Foundation all rights reserved.
This program is released under the terms of the NTP license, <http://ntp.org/license>.
.Sh "BUGS"
Please send bug reports to: http://bugs.ntp.org, [email protected]
+290 -42
View File
@@ -29,6 +29,7 @@
#ifdef HAVE_SYS_WAIT_H
# include <sys/wait.h>
#endif
#include <time.h>
#include <isc/net.h>
#include <isc/result.h>
@@ -148,7 +149,7 @@ typedef struct peer_resolved_ctx_tag {
*/
extern int yydebug; /* ntp_parser.c (.y) */
config_tree cfgt; /* Parser output stored here */
struct config_tree_tag *cfg_tree_history; /* History of configs */
config_tree *cfg_tree_history; /* History of configs */
char * sys_phone[MAXPHONE] = {NULL}; /* ACTS phone numbers */
char default_keysdir[] = NTP_KEYSDIR;
char * keysdir = default_keysdir; /* crypto keys directory */
@@ -324,6 +325,7 @@ static void config_ntpdsim(config_tree *);
static void config_ntpd(config_tree *, int/*BOOL*/ input_from_file);
static void config_other_modes(config_tree *);
static void config_auth(config_tree *);
static void attrtopsl(int poll, attr_val *avp);
static void config_access(config_tree *);
static void config_mdnstries(config_tree *);
static void config_phone(config_tree *);
@@ -500,6 +502,13 @@ dump_all_config_trees(
{
config_tree * cfg_ptr;
int return_value;
time_t now = time(NULL);
struct tm tm = *localtime(&now);
fprintf(df, "#NTF:D %04d%02d%02d@%02d:%02d:%02d\n",
tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday,
tm.tm_hour, tm.tm_min, tm.tm_sec);
fprintf(df, "#NTF:V %s\n", Version);
return_value = 0;
for (cfg_ptr = cfg_tree_history;
@@ -531,7 +540,6 @@ dump_config_tree(
setvar_node *setv_node;
nic_rule_node *rule_node;
int_node *i_n;
int_node *flag_tok_fifo;
int_node *counter_set;
string_node *str_node;
@@ -591,6 +599,11 @@ dump_config_tree(
atrv = atrv->link;
fprintf(df, " %s\n",
normal_dtoa(atrv->value.d));
} else if (T_Leapfile == atrv->attr) {
fputs((atrv->flag
? " checkhash\n"
: " ignorehash\n"),
df);
} else {
fprintf(df, "\n");
}
@@ -925,6 +938,21 @@ dump_config_tree(
fprintf(df, "\n");
}
atrv = HEAD_PFIFO(ptree->pollskewlist);
if (atrv != NULL) {
fprintf(df, "pollskewlist");
for ( ; atrv != NULL; atrv = atrv->link) {
if (-1 == atrv->attr) {
fprintf(df, " default");
} else {
fprintf(df, " %d", atrv->attr);
}
fprintf(df, " %d|%d",
atrv->value.r.first, atrv->value.r.last);
}
fprintf(df, "\n");
}
for (rest_node = HEAD_PFIFO(ptree->restrict_opts);
rest_node != NULL;
rest_node = rest_node->link) {
@@ -933,9 +961,10 @@ dump_config_tree(
if (NULL == rest_node->addr) {
s = "default";
/* Don't need to set is_default=1 here */
flag_tok_fifo = HEAD_PFIFO(rest_node->flag_tok_fifo);
for ( ; flag_tok_fifo != NULL; flag_tok_fifo = flag_tok_fifo->link) {
if (T_Source == flag_tok_fifo->i) {
atrv = HEAD_PFIFO(rest_node->flag_tok_fifo);
for ( ; atrv != NULL; atrv = atrv->link) {
if ( T_Integer == atrv->type
&& T_Source == atrv->attr) {
s = "source";
break;
}
@@ -967,11 +996,34 @@ dump_config_tree(
fprintf(df, " mask %s",
rest_node->mask->address);
fprintf(df, " ippeerlimit %d", rest_node->ippeerlimit);
flag_tok_fifo = HEAD_PFIFO(rest_node->flag_tok_fifo);
for ( ; flag_tok_fifo != NULL; flag_tok_fifo = flag_tok_fifo->link)
if (T_Source != flag_tok_fifo->i)
fprintf(df, " %s", keyword(flag_tok_fifo->i));
fprintf(df, "\n");
atrv = HEAD_PFIFO(rest_node->flag_tok_fifo);
for ( ; atrv != NULL; atrv = atrv->link) {
if ( T_Integer == atrv->type
&& T_Source != atrv->attr) {
fprintf(df, " %s", keyword(atrv->attr));
}
}
fprintf(df, "\n");
/**/
#if 0
msyslog(LOG_INFO, "Dumping flag_tok_fifo:");
atrv = HEAD_PFIFO(rest_node->flag_tok_fifo);
for ( ; atrv != NULL; atrv = atrv->link) {
msyslog(LOG_INFO, "- flag_tok_fifo: flags: %08x", atrv->flag);
switch(atrv->type) {
case T_Integer:
msyslog(LOG_INFO, "- T_Integer: attr <%s>/%d, value %d",
keyword(atrv->attr), atrv->attr, atrv->value.i);
break;
default:
msyslog(LOG_INFO, "- Other: attr <%s>/%d, value ???",
keyword(atrv->attr), atrv->attr);
break;
}
}
#endif
/**/
}
rule_node = HEAD_PFIFO(ptree->nic_rules);
@@ -1053,7 +1105,6 @@ dump_config_tree(
#endif /* SAVECONFIG */
/* generic fifo routines for structs linked by 1st member */
void *
append_gen_fifo(
@@ -1191,7 +1242,7 @@ create_attr_uval(
attr_val *
create_attr_rangeval(
create_attr_rval(
int attr,
int first,
int last
@@ -1480,8 +1531,8 @@ create_restrict_node(
address_node * addr,
address_node * mask,
short ippeerlimit,
int_fifo * flag_tok_fifo,
int line_no
attr_val_fifo * flag_tok_fifo,
int nline
)
{
restrict_node *my_node;
@@ -1491,7 +1542,7 @@ create_restrict_node(
my_node->mask = mask;
my_node->ippeerlimit = ippeerlimit;
my_node->flag_tok_fifo = flag_tok_fifo;
my_node->line_no = line_no;
my_node->line_no = nline;
return my_node;
}
@@ -1507,7 +1558,7 @@ destroy_restrict_node(
*/
destroy_address_node(my_node->addr);
destroy_address_node(my_node->mask);
destroy_int_fifo(my_node->flag_tok_fifo);
destroy_attr_val_fifo(my_node->flag_tok_fifo);
free(my_node);
}
@@ -2307,7 +2358,7 @@ config_monitor(
/* Set the statistics directory */
if (ptree->stats_dir)
stats_config(STATS_STATSDIR, ptree->stats_dir);
stats_config(STATS_STATSDIR, ptree->stats_dir, 0);
/* NOTE:
* Calling filegen_get is brain dead. Doing a string
@@ -2472,7 +2523,6 @@ config_access(
static int warned_signd;
attr_val * my_opt;
restrict_node * my_node;
int_node * curr_tok_fifo;
sockaddr_u addr;
sockaddr_u mask;
struct addrinfo hints;
@@ -2484,6 +2534,9 @@ config_access(
u_short mflags;
short ippeerlimit;
int range_err;
psl_item my_psl_item;
attr_val * atrv;
attr_val * dflt_psl_atr;
const char * signd_warning =
#ifdef HAVE_NTP_SIGND
"MS-SNTP signd operations currently block ntpd degrading service to all clients.";
@@ -2599,25 +2652,24 @@ config_access(
}
}
/* Configure the restrict options */
/* Configure each line of restrict options */
my_node = HEAD_PFIFO(ptree->restrict_opts);
for (; my_node != NULL; my_node = my_node->link) {
/* Grab the ippeerlmit */
ippeerlimit = my_node->ippeerlimit;
DPRINTF(1, ("config_access: top-level node %p: ippeerlimit %d\n", my_node, ippeerlimit));
/* Parse the flags */
rflags = 0;
mflags = 0;
curr_tok_fifo = HEAD_PFIFO(my_node->flag_tok_fifo);
for (; curr_tok_fifo != NULL; curr_tok_fifo = curr_tok_fifo->link) {
switch (curr_tok_fifo->i) {
my_opt = HEAD_PFIFO(my_node->flag_tok_fifo);
for (; my_opt != NULL; my_opt = my_opt->link) {
switch (my_opt->attr) {
default:
fatal_error("config_access: flag-type-token=%d", curr_tok_fifo->i);
fatal_error("config_access: Unknown flag-type-token=%s/%d", keyword(my_opt->attr), my_opt->attr);
case T_Ntpport:
mflags |= RESM_NTPONLY;
@@ -2639,10 +2691,6 @@ DPRINTF(1, ("config_access: top-level node %p: ippeerlimit %d\n", my_node, ippee
rflags |= RES_KOD;
break;
case T_Mssntp:
rflags |= RES_MSSNTP;
break;
case T_Limited:
rflags |= RES_LIMITED;
break;
@@ -2651,6 +2699,10 @@ DPRINTF(1, ("config_access: top-level node %p: ippeerlimit %d\n", my_node, ippee
rflags |= RES_LPTRAP;
break;
case T_Mssntp:
rflags |= RES_MSSNTP;
break;
case T_Nomodify:
rflags |= RES_NOMODIFY;
break;
@@ -2683,6 +2735,10 @@ DPRINTF(1, ("config_access: top-level node %p: ippeerlimit %d\n", my_node, ippee
rflags |= RES_DONTTRUST;
break;
case T_ServerresponseFuzz:
rflags |= RES_SRVRSPFUZ;
break;
case T_Version:
rflags |= RES_VERSION;
break;
@@ -2822,10 +2878,171 @@ DPRINTF(1, ("config_access: top-level node %p: ippeerlimit %d\n", my_node, ippee
if (ai_list != NULL)
freeaddrinfo(ai_list);
}
/* Deal with the Poll Skew List */
ZERO(psl);
ZERO(my_psl_item);
/*
* First, find the last default pollskewlist item.
* There should only be one of these with the current grammar,
* but better safe than sorry.
*/
dflt_psl_atr = NULL;
atrv = HEAD_PFIFO(ptree->pollskewlist);
for ( ; atrv != NULL; atrv = atrv->link) {
switch (atrv->attr) {
case -1: /* default */
dflt_psl_atr = atrv;
break;
case 3: /* Fall through */
case 4: /* Fall through */
case 5: /* Fall through */
case 6: /* Fall through */
case 7: /* Fall through */
case 8: /* Fall through */
case 9: /* Fall through */
case 10: /* Fall through */
case 11: /* Fall through */
case 12: /* Fall through */
case 13: /* Fall through */
case 14: /* Fall through */
case 15: /* Fall through */
case 16: /* Fall through */
case 17:
/* ignore */
break;
default:
msyslog(LOG_ERR,
"config_access: default PSL scan: ignoring unexpected poll value %d",
atrv->attr);
break;
}
}
/* If we have a nonzero default, initialize the PSL */
if ( dflt_psl_atr
&& ( 0 != dflt_psl_atr->value.r.first
|| 0 != dflt_psl_atr->value.r.last)) {
int i;
for (i = 3; i <= 17; ++i) {
attrtopsl(i, dflt_psl_atr);
}
}
/* Finally, update the PSL with any explicit entries */
atrv = HEAD_PFIFO(ptree->pollskewlist);
for ( ; atrv != NULL; atrv = atrv->link) {
switch (atrv->attr) {
case -1: /* default */
/* Ignore */
break;
case 3: /* Fall through */
case 4: /* Fall through */
case 5: /* Fall through */
case 6: /* Fall through */
case 7: /* Fall through */
case 8: /* Fall through */
case 9: /* Fall through */
case 10: /* Fall through */
case 11: /* Fall through */
case 12: /* Fall through */
case 13: /* Fall through */
case 14: /* Fall through */
case 15: /* Fall through */
case 16: /* Fall through */
case 17:
attrtopsl(atrv->attr, atrv);
break;
default:
break; /* Ignore - we reported this above */
}
}
#if 0
int p;
msyslog(LOG_INFO, "Dumping PSL:");
for (p = 3; p <= 17; ++p) {
psl_item psi;
if (0 == get_pollskew(p, &psi)) {
msyslog(LOG_INFO, "poll %d: sub %d, qty %d, msk %d",
p, psi.sub, psi.qty, psi.msk);
} else {
msyslog(LOG_ERR, "Dumping PSL: get_pollskew(%d) failed!", p);
}
}
#endif
}
void
attrtopsl(int poll, attr_val *avp)
{
DEBUG_INSIST((poll - 3) < sizeof psl);
if (poll < 3 || poll > 17) {
msyslog(LOG_ERR, "attrtopsl(%d, ...): Poll value is out of range - ignoring", poll);
} else {
int pao = poll - 3; /* poll array offset */
int lower = avp->value.r.first; /* a positive number */
int upper = avp->value.r.last;
int psmax = 1 << (poll - 1);
int qmsk;
if (lower > psmax) {
msyslog(LOG_WARNING, "attrtopsl: default: poll %d lower bound reduced from %d to %d",
poll, lower, psmax);
lower = psmax;
}
if (upper > psmax) {
msyslog(LOG_WARNING, "attrtopsl: default: poll %d upper bound reduced from %d to %d",
poll, upper, psmax);
upper = psmax;
}
psl[pao].sub = lower;
psl[pao].qty = lower + upper;
qmsk = 1;
while (qmsk < (lower + upper)) {
qmsk <<= 1;
qmsk |= 1;
};
psl[pao].msk = qmsk;
}
return;
}
#endif /* !SIM */
int
get_pollskew(
int p,
psl_item *rv
)
{
DEBUG_INSIST(3 <= p && 17 >= p);
if (3 <= p && 17 >= p) {
*rv = psl[p - 3];
return 0;
} else {
msyslog(LOG_ERR, "get_pollskew(%d): poll is not between 3 and 17!", p);
return -1;
}
/* NOTREACHED */
}
#ifdef FREE_CFG_T
static void
free_config_access(
@@ -3644,6 +3861,13 @@ config_fudge(
/* Parse all the options to the fudge command */
ZERO(clock_stat);
/* some things are not necessarily cleared by ZERO...*/
clock_stat.fudgeminjitter = 0.0;
clock_stat.fudgetime1 = 0.0;
clock_stat.fudgetime2 = 0.0;
clock_stat.p_lastcode = NULL;
clock_stat.clockdesc = NULL;
clock_stat.kv_list = NULL;
curr_opt = HEAD_PFIFO(curr_fudge->options);
for (; curr_opt != NULL; curr_opt = curr_opt->link) {
switch (curr_opt->attr) {
@@ -3665,10 +3889,9 @@ config_fudge(
case T_Refid:
clock_stat.haveflags |= CLK_HAVEVAL2;
clock_stat.fudgeval2 = 0;
memcpy(&clock_stat.fudgeval2,
curr_opt->value.s,
min(strlen(curr_opt->value.s), 4));
/* strncpy() does exactly what we want here: */
strncpy((char*)&clock_stat.fudgeval2,
curr_opt->value.s, 4);
break;
case T_Flag1:
@@ -3703,6 +3926,11 @@ config_fudge(
clock_stat.flags &= ~CLK_FLAG4;
break;
case T_Minjitter:
clock_stat.haveflags |= CLK_HAVEMINJIT;
clock_stat.fudgeminjitter = curr_opt->value.d;
break;
default:
msyslog(LOG_ERR,
"Unexpected fudge flag %s (%d) for %s",
@@ -3757,7 +3985,7 @@ config_vars(
stats_drift_file = 0;
msyslog(LOG_INFO, "config: driftfile disabled");
} else
stats_config(STATS_FREQ_FILE, curr_var->value.s);
stats_config(STATS_FREQ_FILE, curr_var->value.s, 0);
break;
case T_Dscp:
@@ -3775,7 +4003,7 @@ config_vars(
break;
case T_Leapfile:
stats_config(STATS_LEAP_FILE, curr_var->value.s);
stats_config(STATS_LEAP_FILE, curr_var->value.s, curr_var->flag);
break;
#ifdef LEAP_SMEAR
@@ -3786,7 +4014,7 @@ config_vars(
#endif
case T_Pidfile:
stats_config(STATS_PID_FILE, curr_var->value.s);
stats_config(STATS_PID_FILE, curr_var->value.s, 0);
break;
case T_Logfile:
@@ -3866,9 +4094,9 @@ is_sane_resolved_address(
return 0;
}
/*
* Shouldn't be able to specify multicast
* address for server/peer!
* and unicast address for manycastclient!
* Shouldn't be able to specify:
* - multicast address for server/peer!
* - unicast address for manycastclient!
*/
if ((T_Server == hmode || T_Peer == hmode || T_Pool == hmode)
&& IS_MCAST(peeraddr)) {
@@ -3928,9 +4156,12 @@ peerflag_bits(
{
int peerflags;
attr_val *option;
int hmode;
DEBUG_INSIST(pn);
/* translate peerflags options to bits */
peerflags = 0;
hmode = pn->host_mode;
option = HEAD_PFIFO(pn->peerflags);
for (; option != NULL; option = option->link) {
switch (option->value.i) {
@@ -3969,6 +4200,12 @@ peerflag_bits(
case T_Xleave:
peerflags |= FLAG_XLEAVE;
break;
case T_Xmtnonce:
if ( MODE_CLIENT == hmode ) {
peerflags |= FLAG_LOOPNONCE;
}
break;
}
}
@@ -5278,7 +5515,9 @@ ntp_rlimit(
char *
build_iflags(u_int32 iflags)
build_iflags(
u_int32 iflags
)
{
static char ifs[1024];
@@ -5351,7 +5590,9 @@ build_iflags(u_int32 iflags)
char *
build_mflags(u_short mflags)
build_mflags(
u_short mflags
)
{
static char mfs[1024];
@@ -5379,7 +5620,9 @@ build_mflags(u_short mflags)
char *
build_rflags(u_short rflags)
build_rflags(
u_short rflags
)
{
static char rfs[1024];
@@ -5455,6 +5698,11 @@ build_rflags(u_short rflags)
appendstr(rfs, sizeof rfs, "notrust");
}
if (rflags & RES_SRVRSPFUZ) {
rflags &= ~RES_SRVRSPFUZ;
appendstr(rfs, sizeof rfs, "srvrspfuz");
}
if (rflags & RES_VERSION) {
rflags &= ~RES_VERSION;
appendstr(rfs, sizeof rfs, "version");
+40 -30
View File
@@ -28,6 +28,8 @@
#include "ntp_leapsec.h"
#include "ntp_md5.h" /* provides OpenSSL digest API */
#include "lib_strbuf.h"
#include "timexsup.h"
#include <rc_cmdlength.h>
#ifdef KERNEL_PLL
# include "ntp_syscall.h"
@@ -327,7 +329,8 @@ static const struct ctl_proc control_codes[] = {
#define CC_FLAGS 11
#define CC_DEVICE 12
#define CC_VARLIST 13
#define CC_MAXCODE CC_VARLIST
#define CC_FUDGEMINJIT 14
#define CC_MAXCODE CC_FUDGEMINJIT
/*
* System variable values. The array can be indexed by the variable
@@ -625,7 +628,8 @@ static const struct ctl_var clock_var[] = {
{ CC_FLAGS, RO, "flags" }, /* 11 */
{ CC_DEVICE, RO, "device" }, /* 12 */
{ CC_VARLIST, RO, "clock_var_list" }, /* 13 */
{ 0, EOV, "" } /* 14 */
{ CC_FUDGEMINJIT, RO, "minjitter" }, /* 14 */
{ 0, EOV, "" } /* 15 */
};
@@ -640,6 +644,7 @@ static const u_char def_clock_var[] = {
CC_NOREPLY,
CC_BADFORMAT,
CC_BADDATA,
CC_FUDGEMINJIT,
CC_FUDGETIME1,
CC_FUDGETIME2,
CC_FUDGEVAL1,
@@ -1187,15 +1192,21 @@ process_control(
pkt = (struct ntp_control *)&rbufp->recv_pkt;
/*
* If the length is less than required for the header, or
* it is a response or a fragment, ignore this.
* If the length is less than required for the header,
* ignore it.
*/
if (rbufp->recv_length < (int)CTL_HEADER_LEN
|| (CTL_RESPONSE | CTL_MORE | CTL_ERROR) & pkt->r_m_e_op
if (rbufp->recv_length < (int)CTL_HEADER_LEN) {
DPRINTF(1, ("Short control packet\n"));
numctltooshort++;
return;
}
/*
* If this packet is a response or a fragment, ignore it.
*/
if ( (CTL_RESPONSE | CTL_MORE | CTL_ERROR) & pkt->r_m_e_op
|| pkt->offset != 0) {
DPRINTF(1, ("invalid format in control packet\n"));
if (rbufp->recv_length < (int)CTL_HEADER_LEN)
numctltooshort++;
if (CTL_RESPONSE & pkt->r_m_e_op)
numctlinputresp++;
if (CTL_MORE & pkt->r_m_e_op)
@@ -1206,6 +1217,7 @@ process_control(
numctlbadoffset++;
return;
}
res_version = PKT_VERSION(pkt->li_vn_mode);
if (res_version > NTP_VERSION || res_version < NTP_OLDVERSION) {
DPRINTF(1, ("unknown version %d in control packet\n",
@@ -1910,15 +1922,6 @@ ctl_putsys(
static struct timex ntx;
static u_long ntp_adjtime_time;
static const double to_ms_usec =
1.0e-3; /* usec to msec */
static const double to_ms_nusec =
# ifdef STA_NANO
1.0e-6; /* nsec to msec */
# else
to_ms_usec;
# endif
/*
* CS_K_* variables depend on up-to-date output of ntp_adjtime()
*/
@@ -2321,7 +2324,8 @@ ctl_putsys(
case CS_K_OFFSET:
CTL_IF_KERNLOOP(
ctl_putdblf,
(sys_var[varid].text, 0, -1, to_ms_nusec * ntx.offset)
(sys_var[varid].text, 0, -1,
1000 * dbl_from_var_long(ntx.offset, ntx.status))
);
break;
@@ -2336,7 +2340,7 @@ ctl_putsys(
CTL_IF_KERNLOOP(
ctl_putdblf,
(sys_var[varid].text, 0, 6,
to_ms_usec * ntx.maxerror)
1000 * dbl_from_usec_long(ntx.maxerror))
);
break;
@@ -2344,7 +2348,7 @@ ctl_putsys(
CTL_IF_KERNLOOP(
ctl_putdblf,
(sys_var[varid].text, 0, 6,
to_ms_usec * ntx.esterror)
1000 * dbl_from_usec_long(ntx.esterror))
);
break;
@@ -2368,7 +2372,7 @@ ctl_putsys(
CTL_IF_KERNLOOP(
ctl_putdblf,
(sys_var[varid].text, 0, 6,
to_ms_usec * ntx.precision)
1000 * dbl_from_var_long(ntx.precision, ntx.status))
);
break;
@@ -2396,7 +2400,8 @@ ctl_putsys(
case CS_K_PPS_JITTER:
CTL_IF_KERNPPS(
ctl_putdbl,
(sys_var[varid].text, to_ms_nusec * ntx.jitter)
(sys_var[varid].text,
1000 * dbl_from_var_long(ntx.jitter, ntx.status))
);
break;
@@ -2965,14 +2970,9 @@ ctl_putclock(
break;
case CC_FUDGEVAL2:
if (mustput || (pcs->haveflags & CLK_HAVEVAL2)) {
if (pcs->fudgeval1 > 1)
ctl_putadr(clock_var[id].text,
pcs->fudgeval2, NULL);
else
ctl_putrefid(clock_var[id].text,
pcs->fudgeval2);
}
/* RefID of clocks are always text even if stratum is fudged */
if (mustput || (pcs->haveflags & CLK_HAVEVAL2))
ctl_putrefid(clock_var[id].text, pcs->fudgeval2);
break;
case CC_FLAGS:
@@ -3045,6 +3045,16 @@ ctl_putclock(
*s = '\0';
ctl_putdata(buf, (unsigned)(s - buf), 0);
break;
case CC_FUDGEMINJIT:
if (mustput || (pcs->haveflags & CLK_HAVEMINJIT))
ctl_putdbl(clock_var[id].text,
pcs->fudgeminjitter * 1e3);
break;
default:
break;
}
}
#endif
+46 -32
View File
@@ -177,7 +177,7 @@ endpt * any_interface; /* wildcard ipv4 interface */
endpt * any6_interface; /* wildcard ipv6 interface */
endpt * loopback_interface; /* loopback ipv4 interface */
isc_boolean_t broadcast_client_enabled; /* is broadcast client enabled */
static isc_boolean_t broadcast_client_enabled; /* is broadcast client enabled */
u_int sys_ifnum; /* next .ifnum to assign */
int ninterfaces; /* Total number of interfaces */
@@ -2011,10 +2011,7 @@ update_interfaces(
*/
refresh_all_peerinterfaces();
if (broadcast_client_enabled)
io_setbclient();
if (sys_bclient)
if (broadcast_client_enabled || sys_bclient)
io_setbclient();
#ifdef MCAST
@@ -2343,11 +2340,12 @@ socket_broadcast_disable(
/*
* return the broadcast client flag value
*/
isc_boolean_t
/*isc_boolean_t
get_broadcastclient_flag(void)
{
return (broadcast_client_enabled);
}
*/
/*
* Check to see if the address is a multicast address
@@ -2605,32 +2603,38 @@ void
io_setbclient(void)
{
#ifdef OPEN_BCAST_SOCKET
struct interface * interf;
unsigned int nif;
endpt * ep;
unsigned int nif, ni4, ni6;
nif = 0;
nif = ni4 = ni6 = 0;
set_reuseaddr(1);
for (interf = ep_list;
interf != NULL;
interf = interf->elink) {
if (interf->flags & (INT_WILDCARD | INT_LOOPBACK))
for (ep = ep_list; ep != NULL; ep = ep->elink) {
/* count IPv6 vs IPv4 interfaces. Needed later to decide
* if we should log an error or not.
*/
switch (ep->family) {
case AF_INET : ++ni4; break;
case AF_INET6: ++ni6; break;
default : break;
}
if (ep->flags & (INT_WILDCARD | INT_LOOPBACK))
continue;
/* use only allowed addresses */
if (interf->ignore_packets)
if (ep->ignore_packets)
continue;
/* Need a broadcast-capable interface */
if (!(interf->flags & INT_BROADCAST))
if (!(ep->flags & INT_BROADCAST))
continue;
/* Only IPv4 addresses are valid for broadcast */
REQUIRE(IS_IPV4(&interf->bcast));
REQUIRE(IS_IPV4(&ep->bcast));
/* Do we already have the broadcast address open? */
if (interf->flags & INT_BCASTOPEN) {
if (ep->flags & INT_BCASTOPEN) {
/*
* account for already open interfaces to avoid
* misleading warning below
@@ -2642,19 +2646,19 @@ io_setbclient(void)
/*
* Try to open the broadcast address
*/
interf->family = AF_INET;
interf->bfd = open_socket(&interf->bcast, 1, 0, interf);
ep->family = AF_INET;
ep->bfd = open_socket(&ep->bcast, 1, 0, ep);
/*
* If we succeeded then we use it otherwise enable
* broadcast on the interface address
*/
if (interf->bfd != INVALID_SOCKET) {
if (ep->bfd != INVALID_SOCKET) {
nif++;
interf->flags |= INT_BCASTOPEN;
ep->flags |= INT_BCASTOPEN;
msyslog(LOG_INFO,
"Listen for broadcasts to %s on interface #%d %s",
stoa(&interf->bcast), interf->ifnum, interf->name);
stoa(&ep->bcast), ep->ifnum, ep->name);
} else switch (errno) {
/* Silently ignore EADDRINUSE as we probably
* opened the socket already for an address in
@@ -2668,8 +2672,8 @@ io_setbclient(void)
* regular socket, it's quite useless to try this
* again.
*/
if (interf->fd != INVALID_SOCKET) {
interf->flags |= INT_BCASTOPEN;
if (ep->fd != INVALID_SOCKET) {
ep->flags |= INT_BCASTOPEN;
nif++;
}
# endif
@@ -2678,7 +2682,7 @@ io_setbclient(void)
default:
msyslog(LOG_INFO,
"failed to listen for broadcasts to %s on interface #%d %s",
stoa(&interf->bcast), interf->ifnum, interf->name);
stoa(&ep->bcast), ep->ifnum, ep->name);
break;
}
}
@@ -2688,8 +2692,14 @@ io_setbclient(void)
DPRINTF(1, ("io_setbclient: listening to %d broadcast addresses\n", nif));
} else {
broadcast_client_enabled = ISC_FALSE;
msyslog(LOG_ERR,
"Unable to listen for broadcasts, no broadcast interfaces available");
/* This is expected when having only IPv6 interfaces
* and no IPv4 interfaces at all. We suppress the error
* log in that case... everything else should work!
*/
if (ni4 && !ni6) {
msyslog(LOG_ERR,
"Unable to listen for broadcasts, no broadcast interfaces available");
}
}
#else
msyslog(LOG_ERR,
@@ -3134,7 +3144,8 @@ sendpkt(
int rc;
u_char cttl;
l_fp fp_zero = { { 0 }, 0 };
l_fp org, rec, xmt;
ismcast = IS_MCAST(dest);
if (!ismcast)
src = ep;
@@ -3219,11 +3230,14 @@ sendpkt(
} while (ismcast && src != NULL);
/* HMS: pkt->rootdisp is usually random here */
NTOHL_FP(&pkt->org, &org);
NTOHL_FP(&pkt->rec, &rec);
NTOHL_FP(&pkt->xmt, &xmt);
record_raw_stats(src ? &src->sin : NULL, dest,
&pkt->org, &pkt->rec, &pkt->xmt, &fp_zero,
PKT_MODE(pkt->li_vn_mode),
PKT_VERSION(pkt->li_vn_mode),
&org, &rec, &xmt, &fp_zero,
PKT_LEAP(pkt->li_vn_mode),
PKT_VERSION(pkt->li_vn_mode),
PKT_MODE(pkt->li_vn_mode),
pkt->stratum,
pkt->ppoll, pkt->precision,
pkt->rootdelay, pkt->rootdisp, pkt->refid,
File diff suppressed because it is too large. Load diff
+36 -33
View File
@@ -422,7 +422,8 @@ int/*BOOL*/
leapsec_load_stream(
FILE * ifp ,
const char * fname,
int/*BOOL*/ logall)
int/*BOOL*/ logall,
int/*BOOL*/ vhash)
{
leap_table_t *pt;
int rcheck;
@@ -430,36 +431,37 @@ leapsec_load_stream(
if (NULL == fname)
fname = "<unknown>";
rcheck = leapsec_validate((leapsec_reader)getc, ifp);
if (logall)
switch (rcheck)
{
case LSVALID_GOODHASH:
msyslog(LOG_NOTICE, "%s ('%s'): good hash signature",
logPrefix, fname);
break;
case LSVALID_NOHASH:
msyslog(LOG_ERR, "%s ('%s'): no hash signature",
logPrefix, fname);
break;
case LSVALID_BADHASH:
msyslog(LOG_ERR, "%s ('%s'): signature mismatch",
logPrefix, fname);
break;
case LSVALID_BADFORMAT:
msyslog(LOG_ERR, "%s ('%s'): malformed hash signature",
logPrefix, fname);
break;
default:
msyslog(LOG_ERR, "%s ('%s'): unknown error code %d",
logPrefix, fname, rcheck);
break;
}
if (rcheck < 0)
return FALSE;
rewind(ifp);
if (vhash) {
rcheck = leapsec_validate((leapsec_reader)getc, ifp);
if (logall)
switch (rcheck)
{
case LSVALID_GOODHASH:
msyslog(LOG_NOTICE, "%s ('%s'): good hash signature",
logPrefix, fname);
break;
case LSVALID_NOHASH:
msyslog(LOG_ERR, "%s ('%s'): no hash signature",
logPrefix, fname);
break;
case LSVALID_BADHASH:
msyslog(LOG_ERR, "%s ('%s'): signature mismatch",
logPrefix, fname);
break;
case LSVALID_BADFORMAT:
msyslog(LOG_ERR, "%s ('%s'): malformed hash signature",
logPrefix, fname);
break;
default:
msyslog(LOG_ERR, "%s ('%s'): unknown error code %d",
logPrefix, fname, rcheck);
break;
}
if (rcheck < 0)
return FALSE;
rewind(ifp);
}
pt = leapsec_get_table(TRUE);
if (!leapsec_load(pt, (leapsec_reader)getc, ifp, TRUE)) {
switch (errno) {
@@ -498,7 +500,8 @@ leapsec_load_file(
const char * fname,
struct stat * sb_old,
int/*BOOL*/ force,
int/*BOOL*/ logall)
int/*BOOL*/ logall,
int/*BOOL*/ vhash)
{
FILE * fp;
struct stat sb_new;
@@ -551,7 +554,7 @@ leapsec_load_file(
return FALSE;
}
rc = leapsec_load_stream(fp, fname, logall);
rc = leapsec_load_stream(fp, fname, logall, vhash);
fclose(fp);
return rc;
}
+3 -2
View File
@@ -174,7 +174,7 @@ extern void leapsec_dump(const leap_table_t*, leapsec_dumper func, void *farg);
* around the generic load function, 'leapsec_load()'.
*/
extern int/*BOOL*/ leapsec_load_stream(FILE * fp, const char * fname,
int/*BOOL*/logall);
int/*BOOL*/logall, int/*BOOL*/vhash);
/* Read a leap second file from file. It checks that the file exists and
* (if 'force' is not applied) the ctime/mtime has changed since the
@@ -184,7 +184,8 @@ extern int/*BOOL*/ leapsec_load_stream(FILE * fp, const char * fname,
* otherwise. Uses 'leapsec_load_stream()' internally.
*/
extern int/*BOOL*/ leapsec_load_file(const char * fname, struct stat * sb,
int/*BOOL*/force, int/*BOOL*/logall);
int/*BOOL*/force, int/*BOOL*/logall,
int/*BOOL*/vhash);
/* Get the current leap data signature. This consists of the last
* ransition, the table expiration, and the total TAI difference at the
+41 -35
View File
@@ -15,6 +15,7 @@
#include "ntp_io.h"
#include "ntp_unixtime.h"
#include "ntp_stdlib.h"
#include "timexsup.h"
#include <limits.h>
#include <stdio.h>
@@ -167,6 +168,9 @@ u_char sys_poll; /* time constant/poll (log2 s) */
int tc_counter; /* jiggle counter */
double last_offset; /* last offset (s) */
u_int tc_twinlo; /* TC step down not before this time */
u_int tc_twinhi; /* TC step up not before this time */
/*
* Huff-n'-puff filter variables
*/
@@ -761,30 +765,21 @@ local_clock(
if (ext_enable) {
ntv.modes = MOD_STATUS;
} else {
#ifdef STA_NANO
ntv.modes = MOD_BITS | MOD_NANO;
#else /* STA_NANO */
ntv.modes = MOD_BITS;
#endif /* STA_NANO */
if (clock_offset < 0)
dtemp = -.5;
else
dtemp = .5;
ntv.offset = var_long_from_dbl(
clock_offset, &ntv.modes);
#ifdef STA_NANO
ntv.offset = (int32)(clock_offset * 1e9 +
dtemp);
ntv.constant = sys_poll;
#else /* STA_NANO */
ntv.offset = (int32)(clock_offset * 1e6 +
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);
ntv.esterror = usec_long_from_dbl(
clock_jitter);
ntv.maxerror = usec_long_from_dbl(
sys_rootdelay / 2 + sys_rootdisp);
ntv.status = STA_PLL;
/*
@@ -823,22 +818,15 @@ local_clock(
ntp_adjtime_error_handler(__func__, &ntv, ntp_adj_ret, errno, hardpps_enable, 0, __LINE__ - 1);
}
pll_status = ntv.status;
#ifdef STA_NANO
clock_offset = ntv.offset / 1e9;
#else /* STA_NANO */
clock_offset = ntv.offset / 1e6;
#endif /* STA_NANO */
clock_offset = dbl_from_var_long(ntv.offset, ntv.status);
clock_frequency = FREQTOD(ntv.freq);
/*
* If the kernel PPS is lit, monitor its performance.
*/
if (ntv.status & STA_PPSTIME) {
#ifdef STA_NANO
clock_jitter = ntv.jitter / 1e9;
#else /* STA_NANO */
clock_jitter = ntv.jitter / 1e6;
#endif /* STA_NANO */
clock_jitter = dbl_from_var_long(
ntv.jitter, ntv.status);
}
#if defined(STA_NANO) && NTP_API == 4
@@ -888,34 +876,52 @@ local_clock(
* increased, otherwise it is decreased. A bit of hysteresis
* helps calm the dance. Works best using burst mode. Don't
* fiddle with the poll during the startup clamp period.
* [Bug 3615] also observe time gates to avoid eager stepping
*/
if (freq_cnt > 0) {
tc_counter = 0;
tc_twinlo = current_time;
tc_twinhi = current_time;
} else if (fabs(clock_offset) < CLOCK_PGATE * clock_jitter) {
tc_counter += sys_poll;
if (tc_counter > CLOCK_LIMIT) {
tc_counter = CLOCK_LIMIT;
if (sys_poll < peer->maxpoll) {
tc_counter = 0;
sys_poll++;
}
if (sys_poll < peer->maxpoll)
sys_poll += (current_time >= tc_twinhi);
}
} else {
tc_counter -= sys_poll << 1;
if (tc_counter < -CLOCK_LIMIT) {
tc_counter = -CLOCK_LIMIT;
if (sys_poll > peer->minpoll) {
tc_counter = 0;
sys_poll--;
}
if (sys_poll > peer->minpoll)
sys_poll -= (current_time >= tc_twinlo);
}
}
/*
* If the time constant has changed, update the poll variables.
*
* [bug 3615] also set new time gates
* The time limit for stepping down will be half the TC interval
* or 60 secs from now, whatever is bigger, and the step up time
* limit will be half the TC interval after the step down limit.
*
* The 'sys_poll' value affects the servo loop gain, and
* overshooting sys_poll slows it down unnecessarily. Stepping
* down too fast also has bad effects.
*
* The 'tc_counter' dance itself is something that *should*
* happen *once* every (1 << sys_poll) seconds, I think, but
* that's not how it works right now, and adding time guards
* seems the least intrusive way to handle this.
*/
if (osys_poll != sys_poll)
poll_update(peer, sys_poll);
if (osys_poll != sys_poll) {
u_int deadband = 1u << (sys_poll - 1);
tc_counter = 0;
tc_twinlo = current_time + max(deadband, 60);
tc_twinhi = tc_twinlo + deadband;
poll_update(peer, sys_poll, 0);
}
/*
* Yibbidy, yibbbidy, yibbidy; that'h all folks.
+1498 -1346
View File
File diff suppressed because it is too large. Load diff
+385 -367
View File
@@ -30,8 +30,8 @@
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
#ifndef YY_YY_NTP_PARSER_H_INCLUDED
# define YY_YY_NTP_PARSER_H_INCLUDED
#ifndef YY_YY__NTPD_NTP_PARSER_H_INCLUDED
# define YY_YY__NTPD_NTP_PARSER_H_INCLUDED
/* Debug traces. */
#ifndef YYDEBUG
# define YYDEBUG 1
@@ -64,187 +64,196 @@ extern int yydebug;
T_Burst = 274,
T_Calibrate = 275,
T_Ceiling = 276,
T_Clockstats = 277,
T_Cohort = 278,
T_ControlKey = 279,
T_Crypto = 280,
T_Cryptostats = 281,
T_Ctl = 282,
T_Day = 283,
T_Default = 284,
T_Digest = 285,
T_Disable = 286,
T_Discard = 287,
T_Dispersion = 288,
T_Double = 289,
T_Driftfile = 290,
T_Drop = 291,
T_Dscp = 292,
T_Ellipsis = 293,
T_Enable = 294,
T_End = 295,
T_Epeer = 296,
T_False = 297,
T_File = 298,
T_Filegen = 299,
T_Filenum = 300,
T_Flag1 = 301,
T_Flag2 = 302,
T_Flag3 = 303,
T_Flag4 = 304,
T_Flake = 305,
T_Floor = 306,
T_Freq = 307,
T_Fudge = 308,
T_Host = 309,
T_Huffpuff = 310,
T_Iburst = 311,
T_Ident = 312,
T_Ignore = 313,
T_Incalloc = 314,
T_Incmem = 315,
T_Initalloc = 316,
T_Initmem = 317,
T_Includefile = 318,
T_Integer = 319,
T_Interface = 320,
T_Intrange = 321,
T_Io = 322,
T_Ippeerlimit = 323,
T_Ipv4 = 324,
T_Ipv4_flag = 325,
T_Ipv6 = 326,
T_Ipv6_flag = 327,
T_Kernel = 328,
T_Key = 329,
T_Keys = 330,
T_Keysdir = 331,
T_Kod = 332,
T_Mssntp = 333,
T_Leapfile = 334,
T_Leapsmearinterval = 335,
T_Limited = 336,
T_Link = 337,
T_Listen = 338,
T_Logconfig = 339,
T_Logfile = 340,
T_Loopstats = 341,
T_Lowpriotrap = 342,
T_Manycastclient = 343,
T_Manycastserver = 344,
T_Mask = 345,
T_Maxage = 346,
T_Maxclock = 347,
T_Maxdepth = 348,
T_Maxdist = 349,
T_Maxmem = 350,
T_Maxpoll = 351,
T_Mdnstries = 352,
T_Mem = 353,
T_Memlock = 354,
T_Minclock = 355,
T_Mindepth = 356,
T_Mindist = 357,
T_Minimum = 358,
T_Minpoll = 359,
T_Minsane = 360,
T_Mode = 361,
T_Mode7 = 362,
T_Monitor = 363,
T_Month = 364,
T_Mru = 365,
T_Multicastclient = 366,
T_Nic = 367,
T_Nolink = 368,
T_Nomodify = 369,
T_Nomrulist = 370,
T_None = 371,
T_Nonvolatile = 372,
T_Noepeer = 373,
T_Nopeer = 374,
T_Noquery = 375,
T_Noselect = 376,
T_Noserve = 377,
T_Notrap = 378,
T_Notrust = 379,
T_Ntp = 380,
T_Ntpport = 381,
T_NtpSignDsocket = 382,
T_Orphan = 383,
T_Orphanwait = 384,
T_PCEdigest = 385,
T_Panic = 386,
T_Peer = 387,
T_Peerstats = 388,
T_Phone = 389,
T_Pid = 390,
T_Pidfile = 391,
T_Pool = 392,
T_Port = 393,
T_Preempt = 394,
T_Prefer = 395,
T_Protostats = 396,
T_Pw = 397,
T_Randfile = 398,
T_Rawstats = 399,
T_Refid = 400,
T_Requestkey = 401,
T_Reset = 402,
T_Restrict = 403,
T_Revoke = 404,
T_Rlimit = 405,
T_Saveconfigdir = 406,
T_Server = 407,
T_Setvar = 408,
T_Source = 409,
T_Stacksize = 410,
T_Statistics = 411,
T_Stats = 412,
T_Statsdir = 413,
T_Step = 414,
T_Stepback = 415,
T_Stepfwd = 416,
T_Stepout = 417,
T_Stratum = 418,
T_String = 419,
T_Sys = 420,
T_Sysstats = 421,
T_Tick = 422,
T_Time1 = 423,
T_Time2 = 424,
T_Timer = 425,
T_Timingstats = 426,
T_Tinker = 427,
T_Tos = 428,
T_Trap = 429,
T_True = 430,
T_Trustedkey = 431,
T_Ttl = 432,
T_Type = 433,
T_U_int = 434,
T_UEcrypto = 435,
T_UEcryptonak = 436,
T_UEdigest = 437,
T_Unconfig = 438,
T_Unpeer = 439,
T_Version = 440,
T_WanderThreshold = 441,
T_Week = 442,
T_Wildcard = 443,
T_Xleave = 444,
T_Year = 445,
T_Flag = 446,
T_EOC = 447,
T_Simulate = 448,
T_Beep_Delay = 449,
T_Sim_Duration = 450,
T_Server_Offset = 451,
T_Duration = 452,
T_Freq_Offset = 453,
T_Wander = 454,
T_Jitter = 455,
T_Prop_Delay = 456,
T_Proc_Delay = 457
T_Checkhash = 277,
T_Clockstats = 278,
T_Cohort = 279,
T_ControlKey = 280,
T_Crypto = 281,
T_Cryptostats = 282,
T_Ctl = 283,
T_Day = 284,
T_Default = 285,
T_Digest = 286,
T_Disable = 287,
T_Discard = 288,
T_Dispersion = 289,
T_Double = 290,
T_Driftfile = 291,
T_Drop = 292,
T_Dscp = 293,
T_Ellipsis = 294,
T_Enable = 295,
T_End = 296,
T_Epeer = 297,
T_False = 298,
T_File = 299,
T_Filegen = 300,
T_Filenum = 301,
T_Flag1 = 302,
T_Flag2 = 303,
T_Flag3 = 304,
T_Flag4 = 305,
T_Flake = 306,
T_Floor = 307,
T_Freq = 308,
T_Fudge = 309,
T_Fuzz = 310,
T_Host = 311,
T_Huffpuff = 312,
T_Iburst = 313,
T_Ident = 314,
T_Ignore = 315,
T_Ignorehash = 316,
T_Incalloc = 317,
T_Incmem = 318,
T_Initalloc = 319,
T_Initmem = 320,
T_Includefile = 321,
T_Integer = 322,
T_Interface = 323,
T_Intrange = 324,
T_Io = 325,
T_Ippeerlimit = 326,
T_Ipv4 = 327,
T_Ipv4_flag = 328,
T_Ipv6 = 329,
T_Ipv6_flag = 330,
T_Kernel = 331,
T_Key = 332,
T_Keys = 333,
T_Keysdir = 334,
T_Kod = 335,
T_Leapfile = 336,
T_Leapsmearinterval = 337,
T_Limited = 338,
T_Link = 339,
T_Listen = 340,
T_Logconfig = 341,
T_Logfile = 342,
T_Loopstats = 343,
T_Lowpriotrap = 344,
T_Manycastclient = 345,
T_Manycastserver = 346,
T_Mask = 347,
T_Maxage = 348,
T_Maxclock = 349,
T_Maxdepth = 350,
T_Maxdist = 351,
T_Maxmem = 352,
T_Maxpoll = 353,
T_Mdnstries = 354,
T_Mem = 355,
T_Memlock = 356,
T_Minclock = 357,
T_Mindepth = 358,
T_Mindist = 359,
T_Minimum = 360,
T_Minjitter = 361,
T_Minpoll = 362,
T_Minsane = 363,
T_Mode = 364,
T_Mode7 = 365,
T_Monitor = 366,
T_Month = 367,
T_Mru = 368,
T_Mssntp = 369,
T_Multicastclient = 370,
T_Nic = 371,
T_Nolink = 372,
T_Nomodify = 373,
T_Nomrulist = 374,
T_None = 375,
T_Nonvolatile = 376,
T_Noepeer = 377,
T_Nopeer = 378,
T_Noquery = 379,
T_Noselect = 380,
T_Noserve = 381,
T_Notrap = 382,
T_Notrust = 383,
T_Ntp = 384,
T_Ntpport = 385,
T_NtpSignDsocket = 386,
T_Orphan = 387,
T_Orphanwait = 388,
T_PCEdigest = 389,
T_Panic = 390,
T_Peer = 391,
T_Peerstats = 392,
T_Phone = 393,
T_Pid = 394,
T_Pidfile = 395,
T_Poll = 396,
T_PollSkewList = 397,
T_Pool = 398,
T_Port = 399,
T_Preempt = 400,
T_Prefer = 401,
T_Protostats = 402,
T_Pw = 403,
T_Randfile = 404,
T_Rawstats = 405,
T_Refid = 406,
T_Requestkey = 407,
T_Reset = 408,
T_Restrict = 409,
T_Revoke = 410,
T_Rlimit = 411,
T_Saveconfigdir = 412,
T_Server = 413,
T_Serverresponse = 414,
T_ServerresponseFuzz = 415,
T_Setvar = 416,
T_Source = 417,
T_Stacksize = 418,
T_Statistics = 419,
T_Stats = 420,
T_Statsdir = 421,
T_Step = 422,
T_Stepback = 423,
T_Stepfwd = 424,
T_Stepout = 425,
T_Stratum = 426,
T_String = 427,
T_Sys = 428,
T_Sysstats = 429,
T_Tick = 430,
T_Time1 = 431,
T_Time2 = 432,
T_Timer = 433,
T_Timingstats = 434,
T_Tinker = 435,
T_Tos = 436,
T_Trap = 437,
T_True = 438,
T_Trustedkey = 439,
T_Ttl = 440,
T_Type = 441,
T_U_int = 442,
T_UEcrypto = 443,
T_UEcryptonak = 444,
T_UEdigest = 445,
T_Unconfig = 446,
T_Unpeer = 447,
T_Version = 448,
T_WanderThreshold = 449,
T_Week = 450,
T_Wildcard = 451,
T_Xleave = 452,
T_Xmtnonce = 453,
T_Year = 454,
T_Flag = 455,
T_EOC = 456,
T_Simulate = 457,
T_Beep_Delay = 458,
T_Sim_Duration = 459,
T_Server_Offset = 460,
T_Duration = 461,
T_Freq_Offset = 462,
T_Wander = 463,
T_Jitter = 464,
T_Prop_Delay = 465,
T_Proc_Delay = 466
};
#endif
/* Tokens. */
@@ -267,194 +276,203 @@ extern int yydebug;
#define T_Burst 274
#define T_Calibrate 275
#define T_Ceiling 276
#define T_Clockstats 277
#define T_Cohort 278
#define T_ControlKey 279
#define T_Crypto 280
#define T_Cryptostats 281
#define T_Ctl 282
#define T_Day 283
#define T_Default 284
#define T_Digest 285
#define T_Disable 286
#define T_Discard 287
#define T_Dispersion 288
#define T_Double 289
#define T_Driftfile 290
#define T_Drop 291
#define T_Dscp 292
#define T_Ellipsis 293
#define T_Enable 294
#define T_End 295
#define T_Epeer 296
#define T_False 297
#define T_File 298
#define T_Filegen 299
#define T_Filenum 300
#define T_Flag1 301
#define T_Flag2 302
#define T_Flag3 303
#define T_Flag4 304
#define T_Flake 305
#define T_Floor 306
#define T_Freq 307
#define T_Fudge 308
#define T_Host 309
#define T_Huffpuff 310
#define T_Iburst 311
#define T_Ident 312
#define T_Ignore 313
#define T_Incalloc 314
#define T_Incmem 315
#define T_Initalloc 316
#define T_Initmem 317
#define T_Includefile 318
#define T_Integer 319
#define T_Interface 320
#define T_Intrange 321
#define T_Io 322
#define T_Ippeerlimit 323
#define T_Ipv4 324
#define T_Ipv4_flag 325
#define T_Ipv6 326
#define T_Ipv6_flag 327
#define T_Kernel 328
#define T_Key 329
#define T_Keys 330
#define T_Keysdir 331
#define T_Kod 332
#define T_Mssntp 333
#define T_Leapfile 334
#define T_Leapsmearinterval 335
#define T_Limited 336
#define T_Link 337
#define T_Listen 338
#define T_Logconfig 339
#define T_Logfile 340
#define T_Loopstats 341
#define T_Lowpriotrap 342
#define T_Manycastclient 343
#define T_Manycastserver 344
#define T_Mask 345
#define T_Maxage 346
#define T_Maxclock 347
#define T_Maxdepth 348
#define T_Maxdist 349
#define T_Maxmem 350
#define T_Maxpoll 351
#define T_Mdnstries 352
#define T_Mem 353
#define T_Memlock 354
#define T_Minclock 355
#define T_Mindepth 356
#define T_Mindist 357
#define T_Minimum 358
#define T_Minpoll 359
#define T_Minsane 360
#define T_Mode 361
#define T_Mode7 362
#define T_Monitor 363
#define T_Month 364
#define T_Mru 365
#define T_Multicastclient 366
#define T_Nic 367
#define T_Nolink 368
#define T_Nomodify 369
#define T_Nomrulist 370
#define T_None 371
#define T_Nonvolatile 372
#define T_Noepeer 373
#define T_Nopeer 374
#define T_Noquery 375
#define T_Noselect 376
#define T_Noserve 377
#define T_Notrap 378
#define T_Notrust 379
#define T_Ntp 380
#define T_Ntpport 381
#define T_NtpSignDsocket 382
#define T_Orphan 383
#define T_Orphanwait 384
#define T_PCEdigest 385
#define T_Panic 386
#define T_Peer 387
#define T_Peerstats 388
#define T_Phone 389
#define T_Pid 390
#define T_Pidfile 391
#define T_Pool 392
#define T_Port 393
#define T_Preempt 394
#define T_Prefer 395
#define T_Protostats 396
#define T_Pw 397
#define T_Randfile 398
#define T_Rawstats 399
#define T_Refid 400
#define T_Requestkey 401
#define T_Reset 402
#define T_Restrict 403
#define T_Revoke 404
#define T_Rlimit 405
#define T_Saveconfigdir 406
#define T_Server 407
#define T_Setvar 408
#define T_Source 409
#define T_Stacksize 410
#define T_Statistics 411
#define T_Stats 412
#define T_Statsdir 413
#define T_Step 414
#define T_Stepback 415
#define T_Stepfwd 416
#define T_Stepout 417
#define T_Stratum 418
#define T_String 419
#define T_Sys 420
#define T_Sysstats 421
#define T_Tick 422
#define T_Time1 423
#define T_Time2 424
#define T_Timer 425
#define T_Timingstats 426
#define T_Tinker 427
#define T_Tos 428
#define T_Trap 429
#define T_True 430
#define T_Trustedkey 431
#define T_Ttl 432
#define T_Type 433
#define T_U_int 434
#define T_UEcrypto 435
#define T_UEcryptonak 436
#define T_UEdigest 437
#define T_Unconfig 438
#define T_Unpeer 439
#define T_Version 440
#define T_WanderThreshold 441
#define T_Week 442
#define T_Wildcard 443
#define T_Xleave 444
#define T_Year 445
#define T_Flag 446
#define T_EOC 447
#define T_Simulate 448
#define T_Beep_Delay 449
#define T_Sim_Duration 450
#define T_Server_Offset 451
#define T_Duration 452
#define T_Freq_Offset 453
#define T_Wander 454
#define T_Jitter 455
#define T_Prop_Delay 456
#define T_Proc_Delay 457
#define T_Checkhash 277
#define T_Clockstats 278
#define T_Cohort 279
#define T_ControlKey 280
#define T_Crypto 281
#define T_Cryptostats 282
#define T_Ctl 283
#define T_Day 284
#define T_Default 285
#define T_Digest 286
#define T_Disable 287
#define T_Discard 288
#define T_Dispersion 289
#define T_Double 290
#define T_Driftfile 291
#define T_Drop 292
#define T_Dscp 293
#define T_Ellipsis 294
#define T_Enable 295
#define T_End 296
#define T_Epeer 297
#define T_False 298
#define T_File 299
#define T_Filegen 300
#define T_Filenum 301
#define T_Flag1 302
#define T_Flag2 303
#define T_Flag3 304
#define T_Flag4 305
#define T_Flake 306
#define T_Floor 307
#define T_Freq 308
#define T_Fudge 309
#define T_Fuzz 310
#define T_Host 311
#define T_Huffpuff 312
#define T_Iburst 313
#define T_Ident 314
#define T_Ignore 315
#define T_Ignorehash 316
#define T_Incalloc 317
#define T_Incmem 318
#define T_Initalloc 319
#define T_Initmem 320
#define T_Includefile 321
#define T_Integer 322
#define T_Interface 323
#define T_Intrange 324
#define T_Io 325
#define T_Ippeerlimit 326
#define T_Ipv4 327
#define T_Ipv4_flag 328
#define T_Ipv6 329
#define T_Ipv6_flag 330
#define T_Kernel 331
#define T_Key 332
#define T_Keys 333
#define T_Keysdir 334
#define T_Kod 335
#define T_Leapfile 336
#define T_Leapsmearinterval 337
#define T_Limited 338
#define T_Link 339
#define T_Listen 340
#define T_Logconfig 341
#define T_Logfile 342
#define T_Loopstats 343
#define T_Lowpriotrap 344
#define T_Manycastclient 345
#define T_Manycastserver 346
#define T_Mask 347
#define T_Maxage 348
#define T_Maxclock 349
#define T_Maxdepth 350
#define T_Maxdist 351
#define T_Maxmem 352
#define T_Maxpoll 353
#define T_Mdnstries 354
#define T_Mem 355
#define T_Memlock 356
#define T_Minclock 357
#define T_Mindepth 358
#define T_Mindist 359
#define T_Minimum 360
#define T_Minjitter 361
#define T_Minpoll 362
#define T_Minsane 363
#define T_Mode 364
#define T_Mode7 365
#define T_Monitor 366
#define T_Month 367
#define T_Mru 368
#define T_Mssntp 369
#define T_Multicastclient 370
#define T_Nic 371
#define T_Nolink 372
#define T_Nomodify 373
#define T_Nomrulist 374
#define T_None 375
#define T_Nonvolatile 376
#define T_Noepeer 377
#define T_Nopeer 378
#define T_Noquery 379
#define T_Noselect 380
#define T_Noserve 381
#define T_Notrap 382
#define T_Notrust 383
#define T_Ntp 384
#define T_Ntpport 385
#define T_NtpSignDsocket 386
#define T_Orphan 387
#define T_Orphanwait 388
#define T_PCEdigest 389
#define T_Panic 390
#define T_Peer 391
#define T_Peerstats 392
#define T_Phone 393
#define T_Pid 394
#define T_Pidfile 395
#define T_Poll 396
#define T_PollSkewList 397
#define T_Pool 398
#define T_Port 399
#define T_Preempt 400
#define T_Prefer 401
#define T_Protostats 402
#define T_Pw 403
#define T_Randfile 404
#define T_Rawstats 405
#define T_Refid 406
#define T_Requestkey 407
#define T_Reset 408
#define T_Restrict 409
#define T_Revoke 410
#define T_Rlimit 411
#define T_Saveconfigdir 412
#define T_Server 413
#define T_Serverresponse 414
#define T_ServerresponseFuzz 415
#define T_Setvar 416
#define T_Source 417
#define T_Stacksize 418
#define T_Statistics 419
#define T_Stats 420
#define T_Statsdir 421
#define T_Step 422
#define T_Stepback 423
#define T_Stepfwd 424
#define T_Stepout 425
#define T_Stratum 426
#define T_String 427
#define T_Sys 428
#define T_Sysstats 429
#define T_Tick 430
#define T_Time1 431
#define T_Time2 432
#define T_Timer 433
#define T_Timingstats 434
#define T_Tinker 435
#define T_Tos 436
#define T_Trap 437
#define T_True 438
#define T_Trustedkey 439
#define T_Ttl 440
#define T_Type 441
#define T_U_int 442
#define T_UEcrypto 443
#define T_UEcryptonak 444
#define T_UEdigest 445
#define T_Unconfig 446
#define T_Unpeer 447
#define T_Version 448
#define T_WanderThreshold 449
#define T_Week 450
#define T_Wildcard 451
#define T_Xleave 452
#define T_Xmtnonce 453
#define T_Year 454
#define T_Flag 455
#define T_EOC 456
#define T_Simulate 457
#define T_Beep_Delay 458
#define T_Sim_Duration 459
#define T_Server_Offset 460
#define T_Duration 461
#define T_Freq_Offset 462
#define T_Wander 463
#define T_Jitter 464
#define T_Prop_Delay 465
#define T_Proc_Delay 466
/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
union YYSTYPE
{
#line 52 "ntp_parser.y" /* yacc.c:1909 */
#line 52 "../../ntpd/ntp_parser.y" /* yacc.c:1909 */
char * String;
double Double;
@@ -473,7 +491,7 @@ union YYSTYPE
script_info * Sim_script;
script_info_fifo * Sim_script_fifo;
#line 477 "ntp_parser.h" /* yacc.c:1909 */
#line 495 "../../ntpd/ntp_parser.h" /* yacc.c:1909 */
};
typedef union YYSTYPE YYSTYPE;
@@ -486,4 +504,4 @@ extern YYSTYPE yylval;
int yyparse (void);
#endif /* !YY_YY_NTP_PARSER_H_INCLUDED */
#endif /* !YY_YY__NTPD_NTP_PARSER_H_INCLUDED */
Loaded 100 of 717 files, more files were not shown because too many files have changed in this diff. Show more