freebsd-skq/contrib/ntp
bz 385c8843b3 In case ntp cannot resolve a hostname on startup it will queue the entry
for resolving by a child process that, upon success, will add the entry
to the config of the running running parent process.

Unfortunately there are a couple of bugs with this, fixed in various
later versions of upstream in potentially different ways due to other
code changes:

1) Upon server [-46] <FQDN> the [-46] are used as FQDN for later resolving
   which does not work.  Make sure we always pass the name (or IP there).

2) The intermediate file to carry the information to the child process
   does not know about -4/-6 restrictions, so that a dual-stacked host
   could resolve to an IPv6 address but that might be unreachable (see
   r223626) leading to no working synchronization ignoring a IPv4 record.
   Thus alter the intermediate format to also pass the address family
   (AF_UNSPEC (default), AF_INET or AF_INET6) to the child process
   depending on -4 or -6.

3) Make the child process to parse the new intermediate file format and
   save the address family for getaddrinfo() hints flags.

4) Change child to always reload resolv.conf calling res_init() before
   trying to resolve names.  This will pick up resolv.conf changes or
   new resolv.confs should they have not existed or been empty or
   unusable on ntp startup.  This fix is more conditional in upstream
   versions but given FreeBSD has res_init there is no need for the
   configure logic as well.

Approved by:	roberto
Sponsored by:	Sandvine Incorporated
MFC after:	9 days
2011-06-29 13:01:10 +00:00
..
adjtimed Merge 4.2.4p8 into contrib (r200452 & r200454). 2009-12-15 14:58:10 +00:00
arlib Merge 4.2.4p8 into contrib (r200452 & r200454). 2009-12-15 14:58:10 +00:00
clockstuff Merge 4.2.4p8 into contrib (r200452 & r200454). 2009-12-15 14:58:10 +00:00
conf Flatten the dist and various 4.n.n trees in preparation of future ntp imports. 2008-08-17 17:37:33 +00:00
html Merge 4.2.4p8 into contrib (r200452 & r200454). 2009-12-15 14:58:10 +00:00
include Merge 4.2.4p8 into contrib (r200452 & r200454). 2009-12-15 14:58:10 +00:00
kernel Merge 4.2.4p8 into contrib (r200452 & r200454). 2009-12-15 14:58:10 +00:00
libisc Merge ntpd & friends 4.2.4p5 from vendor/ntp/dist into head. Next commit 2008-08-22 15:58:00 +00:00
libntp Merge 4.2.4p8 into contrib (r200452 & r200454). 2009-12-15 14:58:10 +00:00
libopts Merge 4.2.4p8 into contrib (r200452 & r200454). 2009-12-15 14:58:10 +00:00
libparse Merge 4.2.4p8 into contrib (r200452 & r200454). 2009-12-15 14:58:10 +00:00
m4 Merge ntpd & friends 4.2.4p5 from vendor/ntp/dist into head. Next commit 2008-08-22 15:58:00 +00:00
ntpd In case ntp cannot resolve a hostname on startup it will queue the entry 2011-06-29 13:01:10 +00:00
ntpdate Merge 4.2.4p8 into contrib (r200452 & r200454). 2009-12-15 14:58:10 +00:00
ntpdc Merge 4.2.4p8 into contrib (r200452 & r200454). 2009-12-15 14:58:10 +00:00
ntpq Merge 4.2.4p8 into contrib (r200452 & r200454). 2009-12-15 14:58:10 +00:00
parseutil Merge 4.2.4p8 into contrib (r200452 & r200454). 2009-12-15 14:58:10 +00:00
scripts Merge 4.2.4p8 into contrib (r200452 & r200454). 2009-12-15 14:58:10 +00:00
sntp Merge 4.2.4p8 into contrib (r200452 & r200454). 2009-12-15 14:58:10 +00:00
util Merge 4.2.4p8 into contrib (r200452 & r200454). 2009-12-15 14:58:10 +00:00
aclocal.m4 Merge 4.2.4p8 into contrib (r200452 & r200454). 2009-12-15 14:58:10 +00:00
bincheck.mf Merge ntpd & friends 4.2.4p5 from vendor/ntp/dist into head. Next commit 2008-08-22 15:58:00 +00:00
bootstrap Merge ntpd & friends 4.2.4p5 from vendor/ntp/dist into head. Next commit 2008-08-22 15:58:00 +00:00
build Merge 4.2.4p8 into contrib (r200452 & r200454). 2009-12-15 14:58:10 +00:00
ChangeLog Merge 4.2.4p8 into contrib (r200452 & r200454). 2009-12-15 14:58:10 +00:00
CommitLog Merge 4.2.4p8 into contrib (r200452 & r200454). 2009-12-15 14:58:10 +00:00
CommitLog-4.1.0 Merge ntpd & friends 4.2.4p5 from vendor/ntp/dist into head. Next commit 2008-08-22 15:58:00 +00:00
compile Merge ntpd & friends 4.2.4p5 from vendor/ntp/dist into head. Next commit 2008-08-22 15:58:00 +00:00
config.guess Merge ntpd & friends 4.2.4p5 from vendor/ntp/dist into head. Next commit 2008-08-22 15:58:00 +00:00
config.h.in Merge 4.2.4p8 into contrib (r200452 & r200454). 2009-12-15 14:58:10 +00:00
config.sub Merge ntpd & friends 4.2.4p5 from vendor/ntp/dist into head. Next commit 2008-08-22 15:58:00 +00:00
configure Merge 4.2.4p8 into contrib (r200452 & r200454). 2009-12-15 14:58:10 +00:00
configure.ac Merge 4.2.4p8 into contrib (r200452 & r200454). 2009-12-15 14:58:10 +00:00
COPYRIGHT Merge 4.2.4p8 into contrib (r200452 & r200454). 2009-12-15 14:58:10 +00:00
depcomp Merge ntpd & friends 4.2.4p5 from vendor/ntp/dist into head. Next commit 2008-08-22 15:58:00 +00:00
dot.emacs Flatten the dist and various 4.n.n trees in preparation of future ntp imports. 2008-08-17 17:37:33 +00:00
excludes Flatten the dist and various 4.n.n trees in preparation of future ntp imports. 2008-08-17 17:37:33 +00:00
flock-build Merge 4.2.4p8 into contrib (r200452 & r200454). 2009-12-15 14:58:10 +00:00
INSTALL Merge ntpd & friends 4.2.4p5 from vendor/ntp/dist into head. Next commit 2008-08-22 15:58:00 +00:00
install-sh Merge ntpd & friends 4.2.4p5 from vendor/ntp/dist into head. Next commit 2008-08-22 15:58:00 +00:00
ltmain.sh Merge ntpd & friends 4.2.4p5 from vendor/ntp/dist into head. Next commit 2008-08-22 15:58:00 +00:00
Makefile.am Merge ntpd & friends 4.2.4p5 from vendor/ntp/dist into head. Next commit 2008-08-22 15:58:00 +00:00
Makefile.in Merge 4.2.4p8 into contrib (r200452 & r200454). 2009-12-15 14:58:10 +00:00
missing Merge ntpd & friends 4.2.4p5 from vendor/ntp/dist into head. Next commit 2008-08-22 15:58:00 +00:00
NEWS Merge 4.2.4p8 into contrib (r200452 & r200454). 2009-12-15 14:58:10 +00:00
NOTES.y2kfixes Flatten the dist and various 4.n.n trees in preparation of future ntp imports. 2008-08-17 17:37:33 +00:00
packageinfo.sh Merge 4.2.4p8 into contrib (r200452 & r200454). 2009-12-15 14:58:10 +00:00
README Merge 4.2.4p8 into contrib (r200452 & r200454). 2009-12-15 14:58:10 +00:00
README.bk Merge 4.2.4p8 into contrib (r200452 & r200454). 2009-12-15 14:58:10 +00:00
README.hackers Flatten the dist and various 4.n.n trees in preparation of future ntp imports. 2008-08-17 17:37:33 +00:00
README.patches Merge 4.2.4p8 into contrib (r200452 & r200454). 2009-12-15 14:58:10 +00:00
README.refclocks Merge ntpd & friends 4.2.4p5 from vendor/ntp/dist into head. Next commit 2008-08-22 15:58:00 +00:00
README.versions Merge ntpd & friends 4.2.4p5 from vendor/ntp/dist into head. Next commit 2008-08-22 15:58:00 +00:00
readme.y2kfixes Flatten the dist and various 4.n.n trees in preparation of future ntp imports. 2008-08-17 17:37:33 +00:00
results.y2kfixes Flatten the dist and various 4.n.n trees in preparation of future ntp imports. 2008-08-17 17:37:33 +00:00
TODO Merge ntpd & friends 4.2.4p5 from vendor/ntp/dist into head. Next commit 2008-08-22 15:58:00 +00:00
version Merge 4.2.4p8 into contrib (r200452 & r200454). 2009-12-15 14:58:10 +00:00
version.m4 Merge 4.2.4p8 into contrib (r200452 & r200454). 2009-12-15 14:58:10 +00:00
WHERE-TO-START Merge 4.2.4p8 into contrib (r200452 & r200454). 2009-12-15 14:58:10 +00:00

Submit patches, bug reports, and enhancement requests via

			http://bugs.ntp.org

		  The ntp Distribution Base Directory

This directory and its subdirectories contain the Network Time Protocol
Version 4 (NTP) distribution for Unix and Windows/NT systems.  This release
may still work on VxWorks, too.

The contents of the base directory are given in this file. The contents of
subdirectories are given in the README files in each subdirectory.

A complete explanation of the configure, compile and install process, as
well as setting up an NTP subnet, is in the HTML pages in the ./html/
directory. For more information on NTP and how to get a working setup,
read WHERE-TO-START.

For Windows/NT, visit html/build/hints/winnt.html .

The base directory ./ contains the autoconfiguration files, source
directories and related stuff:

COPYRIGHT	Excerpt from the HTML file ./html/copyright.html. This file
		specifies copyright conditions, together with a list of
		major authors and electric addresses.

INSTALL		Generic installation instructions for autoconf-based programs.
		Unless you really know what you are doing, you should read the
		directions in the HTML pages, starting with ./html/index.html.

NEWS		What's new in this release.

README		This file.

README.bk	Instructions for folks who use the BitKeeper-repository
		version of NTP.

README.hackers	Notes to folks who want to hack on the code.

TODO            List of items the NTP developers are working on.

WHERE-TO-START	Hints on what to read in order to get a working
		configuration.

Makefile.am	Automake file configuration file. Edit only if you have the
		GNU automake and autoconf utilities installed.

Makefile.in	Autoconf make file template for Unix.

adjtimed        Directory containing the sources for the adjtime daemon
		for HP/UX systems prior to HP-UX 10.0.

authstuff       Directory containing sources for miscellaneous programs
		to test, calibrate and certify the cryptographic
		mechanisms for DES and MD5 based authentication. These
		programs do not include the cryptographic routines
		themselves, so are free of U.S. export restrictions.

build		A script to build the distribution in A.`config.guess`
		subdirectory (more or less).

clockstuff	Directory containing sources for miscellaneous programs
		to test certain auxiliary programs used with some kernel
		configurations, together with a program to calculate
		propagation delays for use with radio clocks and
		national time dissemination services such as WWV/WWVH,
		WWVB and CHU.

conf            Directory containing a motley collection of
		configuration files for various systems. For example only.

config.guess	Script used to identify the machine architecture and
		operating system.

config.h.in	Configuration file generated automatically from
		configure.in. Do not edit.

configure	Script used to configure the distribution. See the HTML pages
		(./html/index.html) for a complete description of the options
		available.

configure.in	Master configuration template. Edit only if you have the
		GNU automake and autoconf utilities installed.

dot.emacs	C-mode indentation rules for code "Just the way Dave likes it".

flock_build	(UDel only) Build the distribution on a number of
		different platforms.

html            Directory containing a complete set of documentation on
		building and configuring a NTP server or client. The
		documentation is in the form of HTML files suitable for
		browsing and contains links to additional documentation
		at various web sites. If a browser is unavailable, an
		ordinary text editor can be used.

include		Directory containing include header files used by most
		programs in the distribution.

install-sh	Script to install a program, script or data file.

kernel		Directory containing sources for kernel programs such as
		line disciplines and STREAMS modules used with the CHU
		decoder and precision PPS signals.

libntp		Directory containing library source code used by most
		programs in the distribution.

ntpdate		Directory containing sources for a program to set the
		local machine time from one or more remote machines
		running NTP.  Operates like rdate, but much more accurate.

ntpq            Directory containing sources for a utility program to
		query local and remote NTP peers for state variables and
		related timekeeping information. This program conforms
		to Appendix A of the NTP Version 3 Specification RFC 1305.

ntptrace        Directory containing sources for a utility program that
		can be used to reveal the chain of NTP peers from a
		designated peer to the primary server at the root of the
		timekeeping subnet.

parse		Directory containing files belonging to the generic
		parse reference clock driver. For reasonably simple
		clocks it is possible to get away with about 3-4Kb of
		code. additionally the SunOS 4.x/Solaris 5.3 streams
		module for parse squats here.

patches		Directory containing patches already applied to this
		distribution. These are included for record and to help
		in possible porting problems.

scripts		Directory containing scripts to build the configuration
		files in this directory and then the makefiles used in
		various dependent directories. the subdirectories
		monitoring and support hold various perl and shell
		scripts for visualizing synchronization and daemon startup.

stamp.h.in	Configuration file generated automatically from configure.in.
		Do not edit.

util            Directory containing sources for various utility and
		testing programs.

David L. Mills (mills@udel.edu)
21 June 1998