dtucker
f5ecdec08b
Ensure previous adjust has completed before clearing alarm flag; ok henning@
19 years ago
henning
e7bcb5fe62
ifa->ifa_addr can be NULL in some cases, pt out by Kurt Roeckx
<kurt@roeckx.be> / bugs.debian.org/310586
19 years ago
henning
8f835e4902
no need for endpwent(0 here either
19 years ago
henning
708d2e7376
don't touch *hn in failure case. no real change due to the way we use it
but more correct.
from Michael Knudsen <e@molioner.dk>
19 years ago
djm
5a26462171
setres[ug]id; ok deraadt@
19 years ago
henning
50e41e169b
unify shared code a bit again to make future syncs easier
From: Alexander von Gernler <grunk@pestilenz.org>
19 years ago
henning
f2765f2a2f
move the "reply from ... " log msg in -d mdoe uop a bit so it actually
comes before the "adjusting local clock by..." one, joerg
19 years ago
henning
3ce098c434
extra paranoia, from a discussion with joerg
19 years ago
henning
90903372f9
correctness: only account for offset after settime in next and deadline
when those timers are actually running. due to the way ntpd's logic works
this does not really make a difference, but correctness is good.
spotted by me, joerg agrees
19 years ago
henning
d2787fa263
after setting the clock hard correct the "next" and "deadline" timestamps
by the offset
From: Joerg Sonnenberger <joerg@britannica.bec.de>
19 years ago
henning
7082200ffe
prevent replies with negative delay from being used, could happen with -s
From: Joerg Sonnenberger <joerg@britannica.bec.de> of dragonfly
19 years ago
henning
4395949868
zap includes, grunk
19 years ago
henning
b7d0279fa2
zap includes, Alexander von Gernler <grunk@pestilenz.org>
19 years ago
henning
de27be63ae
one more fatal/fatalx, alexander
19 years ago
henning
79255b7f6b
fatal vs fatalx, Alexander von Gernler
19 years ago
henning
a71057c067
remove now osolete comment, from a mail exchange with
Alexander von Gernler <grunk@pestilenz.org>
19 years ago
henning
e0f325591a
wpos in struct buf_read and datalen in imsg_get should be size_t and not
ssize_t
From: Alexander von Gernler <grunk@pestilenz.org>
19 years ago
dtucker
0a9920c236
Fixes in ntpd_settime (ie ntpd -s):
- Handle errors from syscalls better
- Prevent curtime.tv_usec from being negative for negative offsets.
- Don't claim to have done settimeofday if it fails.
ok henning@
19 years ago
henning
62c3d341a1
nasty: host_dns used to run before forking and chrooting etc, so it was
guaranteed that its res_init() call was done once before fork etc...
that is no longer the case. call res_init() in main() early.
20 years ago
henning
d40f766737
when, after processing all complete imsgs we found in the buffer,
there are some bytes left (less than an imsg header, or less than the
imsg header len field says) we copy it to the very beginning of the buffer.
use memmove instead of memcpy since it is not guaranteed that there's no
overlap. while memcpy on OpenBSD is safe, it might not elsewhere, and
we want our code to be correct anyways.
funny enough theo and I talked at length about that last week in dublin,
and I said I believe I had no memcpys with the chance of overlap in ntpd/bgpd -
well, here is one, and Alexander von Gernler <grunk@pestilenz.org> pointed
me to it.
20 years ago
henning
de3d9906a7
when trying short-circuit the wait for the first reply for -s, only
do so when
-we tried to send at least one query (that is the change)
-we could not send ou a single one without failure (this was already in
place but catched too much)
problem independently noticed by nick and danh, ok mickey danh, testing by
many
20 years ago
deraadt
0539953c14
knf
20 years ago
henning
9721a5431f
from the "shut the fuck up, ntpd" department:
don't whine about temporary dns errors
20 years ago
deraadt
459c93ccc2
missing break spotted by lint
20 years ago
henning
ab6444e263
from the "shut the fuck up, ntpd" department:
move log_debug call to tell about skipping the settime due to lack of
answers down slightly below the 2nd (and final) log_init call so it becomes
a -d only thing. tested by dlg and me
20 years ago
henning
6801136c41
let client_query return 0 if it requested dns resolution
20 years ago
henning
1b0777efc4
fix error message, Benedikt Steinbusch <bsteinb@hamazone.de>
20 years ago
henning
6d9ab8b66e
when sending a query already returns a failure, we're not going to see
a reply to that query.
if we get errors for all queries and the initial settime() is still due
and thus the parent process still waits (not yet daemonized!), send an
IMSG_SETTIME with offset 0.
shortens the delay dramatically when you boot without network
idea from a discussion with theo
20 years ago
henning
356208894f
fix an error message
20 years ago
dtucker
c1809222fb
Implement simple duplicate suppression of peer errors; ok henning@
20 years ago
henning
8f4f234d9b
KNF
20 years ago
henning
5ab4c063ff
buffer structs and API ssize_t -> size_t; from bgpd
20 years ago
henning
9f4b13fc3a
usage() is __dead
pt out by Alexander v Gernler
20 years ago
dtucker
21a049e79f
Simplify interval scaling and randomize query intervals; ok henning@
20 years ago
henning
81a717e58a
fatal() if daemon() fails, Alexander von Gernler <grunk@pestilenz.org>
20 years ago
dtucker
e0c54820e7
Make network unreachable errors non-fatal; ok henning@
20 years ago
dtucker
270c434643
Scale query interval by the overall offset not per-peer offset, so we
don't query outliers more often than any other server. ok henning@
20 years ago
dtucker
5d09ee1c02
Delay before retrying a query on timeout; ok henning@
20 years ago
henning
2c91c74b88
KNF
20 years ago
henning
d1e706f6f9
d can be negative, take that into account when comparing to the logging
threshold. spotted by Constantine Murenin <mureninc@gmail.com>, mickey ok
20 years ago
dtucker
621223eef3
Save original value returned by getifaddrs to free later; ok henning@
20 years ago
henning
cd15a535c6
if our first getpwnam(), testing for NTPD_USER, succeeded, but the second
returns NULL, we don't need loooong explanations, but at least some indicator
what went wrong, From: Michael Knudsen <e@molioner.dk>
20 years ago
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