moritz
d2089d6098
some typos in log messages.
ok henning@
20 years ago
dtucker
a5982aae18
Limit the number of addresses used by the 'servers' directive to 8; ok henning@
20 years ago
dtucker
890af70b55
Poll unsynchronized servers at the maximum interval and log a message about
them when in debug mode; ok henning@
20 years ago
dtucker
f8fddf9886
Factor out interval scaling code; ok henning@
20 years ago
dtucker
ec912cc477
If polling a server results in an error, drop that server to the maximum
poll interval; ok henning@
20 years ago
dtucker
1cc3aedb19
sendto() takes socklen_t as an argument; ok henning@
20 years ago
dtucker
262fb1973f
Sanity check owner and permissions of privsep directory, like sshd does;
ok henning@
20 years ago
dtucker
9cb603051f
Check for error status from poll() too; ok henning@
20 years ago
dtucker
1bfbeb3ca8
Discard replies with alarm flag set or invalid stratum; ok henning@
20 years ago
jaredy
878f6487d6
typos, then -> than, from Michael Knudsen
20 years ago
mickey
a077b10ff0
define TRUSTLEVEL_MAX for the trustedlevel value of 10; henning@ ok
20 years ago
mickey
668e680350
use two tiny macros for copying fields out to simplify reading; henning@ ok
20 years ago
mickey
b521cde7ce
uniquely name members of s_fixedpt and l_fixedpt; henning@ ok
20 years ago
jmc
640288c410
tweaks;
20 years ago
mickey
7d3cbb5271
do not log tiny local clock drifts; w/ help from Joerg Sonnenberger <joerg@britannica.bec.de>; henning@ ok
20 years ago
mickey
f2f9840c04
ensure the most excellent alignment in the structs; henning@ ok
20 years ago
henning
6da6b1a6a2
fix "listen on hostname"
fallout from the deferred dns lookups
noticed by dhartmei@
20 years ago
henning
b89628e731
some missing includes, from Joerg Sonnenberger <joerg@britannica.bec.de>
20 years ago
henning
b84ae4cbbe
ntp_adjtime() -> priv_adjtime()
ntp_settime() -> priv_settime()
ntp_host_dns() -> priv_host_dns()
20 years ago
henning
389962a6b2
const'ify conffile
From: Joerg Sonnenberger <joerg@britannica.bec.de>
20 years ago
otto
3b81ab1b24
Advice user to use multiple servers. Prodded by Daniel Polak, help and ok jmc@
ok henning@
20 years ago
jmc
5bfffdca2a
document that keywords can be specified multiple times;
from otto and myself; prodded by henning;
20 years ago
dtucker
ceecbd1877
Use SA_LEN() instead of ss.ss_len. Evaluates to the same result but it's
easier on portable. ok henning@
20 years ago
henning
c31555e853
memleaks in error pathes, patrick latifi, Thanks!
20 years ago
henning
e409afcfa7
use SIG_DFL instead of SIG_IGN when we are not interested in SIG_CHILD
anymore, same thing for us and it makes darren's life easier for the
portable
20 years ago
henning
df2265ded1
superfluous comma, From: James Herbert <lists@artyzan.net>
20 years ago
dtucker
348fc30c4d
Calculate Hz and round up; ok henning@
20 years ago
henning
cda611d670
use clock_getres(3) and calculate precision from that, and fill the
precision field when we reply in server mode accordingly. from phessler
20 years ago
henning
5b5fccf2aa
oups
20 years ago
henning
d94b864a67
in server mode reply with stratum from the peer that we currently prefer
plus one
20 years ago
dtucker
3b0155d86c
Only set IPTOS_LOWDELAY on IPv4 interfaces; pointed out by phessler, ok henning
20 years ago
dtucker
dcc316e5a2
Have ntpd use IPTOS_LOWDELAY; ok henning@
20 years ago
henning
a4e395e47f
set rootdelay in replies.
inherit rootdelay from the delay from the last client update from the peer
that we picked last time to adjust the local clock.
in some cases we use the average offset between two peers' client updates,
then use the average delay between the two as well.
20 years ago
henning
0fe5ca5a17
in struct ntp_msg, rename "distance" to "rootdelay" to closer match RFCs
and such
20 years ago
henning
0d2f286428
thinko, htonl() -> ntohl(). as we don't use the value in question effect zero
20 years ago
henning
d71785f980
fall cleaning
20 years ago
henning
7096d1be44
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.
20 years ago
henning
e310ae01b8
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
20 years ago
henning
0cd13f252a
whitespace both in comment; from bernd
20 years ago
henning
abc9700cfb
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
20 years ago
henning
addeddaa0e
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
20 years ago
henning
c25a5d5725
now that we connect() the client sockets we need to handle ECONNREFUSED as
non-fatal too, from camield@
20 years ago
henning
944ef50b12
connect() the client-side sockets. idea & test & ok camield@
20 years ago
henning
75dafda684
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>
20 years ago
henning
2a5d85f042
greatly improved by jmc with some tweaks by yours truly
20 years ago
henning
b676d8a001
jmc says S before s and not s before S, sssssssso we do.
20 years ago
henning
8cf519f664
implement -S to override earlier -s, requested by theo
20 years ago
henning
d756895955
say when we run settimeofday() with -s and when not, help from bob
20 years ago
henning
2f6447073a
don't call settimeofday() when the offset is smaller than 180 seconds,
adjtime() will fix that fast enough, from discussion in theo's living room
ok mcbride beck
20 years ago
henning
80548b0292
add a new -s option, that tells ntpd to set the time using settimeofday()
once at startup. ntpd delays daemonizing until it has done the intial
time setting (or ran into the timeout) in this mode to make sure stuff started
later in rc is not subject to time jumps.
this eleminates the need to run rdate -n beforehands.
with some input from & ok ryan and bob, march music from mickey
20 years ago