say when we run settimeofday() with -s and when not, help from bob
implement -S to override earlier -s, requested by theo
jmc says S before s and not s before S, sssssssso we do.
greatly improved by jmc with some tweaks by yours truly
Add HISTORY; from Jose Nazario
reset chld_pid to 0 when acting upon a SIGCHLD so we don't try to send it
a kill then - tiny possible race there
pointed out by Brian Poole <raj@cerias.purdue.edu>
typo from number six;
connect() the client-side sockets. idea & test & ok camield@
wrong macros; from number six;
now that we connect() the client sockets we need to handle ECONNREFUSED as
non-fatal too, from camield@
add some missing $, ok djm@ 'That looks fine to me' millert@
do not take the average offset from all peers when calculating the total
offset to correct the local clock, but use the median.
given a reasonable sized set of servers this makes us nearly immune against
outliers or flasetickers, without the need for a horribly complicated outliers
detection which does not yield to better results anyway.
test & ok otto
in client_addr_init() and client_nextaddr(), do not set up the socket and
connect it, instead leave it at -1.
in client_query, set up and connect the socket if it is -1.
and, the real reason for this change: handle connect failures gracefully
ok otto
whitespace both in comment; from bernd
use sig_atomic_t instead of int
when we get back a IMSG_HOST_DNS message from the parent the peer ID within
might have become invalid (because the peer showed up, dns request sent to
parent, peer vanishes, and then the reply comes back), so do not fatal() in
that case but just log_warnx(). provoked by brad
correctly set refid in replies with NTP protocol versions < 4.
code path for NTP4 remains unchanged, we already set refid correctly there.
NTP3 and older uses an IPv4 address as refid.
use the IP of the server we last synced to if it was a IPv4 one.
sometimes we use the average offset between two, in that case just pick
one for the IP.
this scheme naturally fails when we query IPv6 servers and have to reply
to IPv4 NTP3 (or even older NTP versions) clients - refid stays at 0 then.
this is a protocol limitation, nothing we can do about it.
fall cleaning
thinko, htonl() -> ntohl(). as we don't use the value in question effect zero
in struct ntp_msg, rename "distance" to "rootdelay" to closer match RFCs
and such