henning
f4727d5d25
recvmsg ENOENT noncritical too
15 years ago
henning
c9840c00e0
ENOPROTOOPT is non-fatal on recvfrom, can apparently happen with ipvshit
15 years ago
henning
eac29aab5e
use the SCM_TIMESTAMP socket option to get the time we received the
reply instead of doing it in ntpd itself by getting the time we read
from the socket. based on a diff from mickey hacked in shape by me,
lots of testing and review from ckuethe and sthen, theo and claudio like it
too
15 years ago
henning
d56fbb72de
ignore replies with timestamps after 2030 to prevent time_t / tv_sec wraps
input & ok theo
15 years ago
stevesk
00ae9b8707
I should know outside data must be vis(3)'d.
Don't log kiss code for now.
15 years ago
stevesk
5181f4815e
received refid should not be converted to host byte order; ok henning@
15 years ago
stevesk
41d74ba791
log reason when not synced; ok henning@
15 years ago
naddy
c102a69a3a
For IPv6 addresses, return the first 32 bits of the MD5 hash of the
address as ref ID (RFC4330). ok henning@
16 years ago
naddy
ca3fb2ec5f
According to the latest SNTPv4 spec in RFC4330, secondary servers
return the address of the synchronization source as reference
identification. Remove the obsolete special casing specified in RFC2030.
ok henning@
16 years ago
mpf
18c1f831f0
Reconnect a client socket after three consecutive send failures.
This allows recovery after an IP address change (e.g. on dialup links).
Also move the update of "nextaction" timeout below the deadline check.
OK henning@
17 years ago
stevesk
14460a3689
some fatal() calls that should be fatalx(); ok henning@
17 years ago
otto
2dc039e348
be a bit less aggressive retrying; this keeps the message queue
empty while in the -s period, so the poll timeout actually times out
if there are no interfaces available. ok henning@
17 years ago
otto
8c79773d1d
if resolving a name fails, be more aggressive retrying, but with care:
do not have more than one dns request outstanding per peer. resolves
slow recovery when resolving fails initially, without clogging the
pipe with lots of dns requests; tested by Jason George; ok deraadt@
17 years ago
deraadt
c34c8f6d6a
aggressive spelling fix, spotted by jbg
17 years ago
henning
4f07972cbe
use clock_gettime(CLOCK_MONOTONIC, ..) to get a monotonically increasing
time, and make ntpd use that to send the next uery to an ntp peer and the
like. this has the advantage that changes to the clock do not interfere
with the intervals. for example, when we start on machines without an
RTC and the initial settime (-s) kicks in, intervals were strange.
idea from amandal@entrisphere.com, this implementation by me
tested ckuethe, phessler, mbalmer, ok mbalmer
18 years ago
henning
9e886819ac
in client_nextaddr, check fd != -1 before close, just nicer this way
From: amandal@entrisphere.com
18 years ago
henning
43bb2c0b5f
when ntp_sendmsg fails, reset trustlevel to TRUSTLEVEL_PATHETIC
From: amandal@entrisphere.com
18 years ago
henning
8031d5c7e5
EADDRNOTAVAIL after connect is one of the soft errors where we don't abort
too. from amandal@entrisphere.com
18 years ago
otto
89f43414db
Compensate old offsets with the amount of adjustment done, avoiding
overcompensating. From DragonFly, uses recent adjtime(2) changes,
so you'll need a recent kernel. ok henning@
18 years ago
otto
24fa8ea878
Only invalidate stored replies if an adjustment was really made.
ok henning@
18 years ago
ckuethe
9325c20f99
When ntpd backs off polling due to a negative delay, tell the user how long
it will wait until the next poll.
ok henning@
18 years ago
henning
309a243757
figure out the refid to send to NTP v3 clients early and store it
first bits from a way to long flight
18 years ago
dtucker
73c6d5ec9f
Log source address for 'malformed packet' errors. ok henning@
19 years ago
dtucker
f31cfdaa27
Propogate server's leap indicator flags to clients; ok henning@
19 years ago
dtucker
4eaa821e76
Print actual error when in debug mode; ok henning@
19 years ago
dtucker
b5f096de27
add another non-fatal error for recvfrom; ok henning@
19 years ago
dtucker
f9299bb123
Save transmit time for each peer for later use as refid for SNTPv4
replies. ok henning@
19 years ago
henning
ed37b625d3
use a little state engine to keep track of delayed dns lookups and such,
eases things
tested by Jason Ackley <jason@ackley.net> Matthias Kilian
<kili@outback.escape.de> Stephen Marley <stephen@marley.org.uk> sturm@
theo ok
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
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
6801136c41
let client_query return 0 if it requested dns resolution
19 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
dtucker
21a049e79f
Simplify interval scaling and randomize query intervals; ok henning@
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
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
1bfbeb3ca8
Discard replies with alarm flag set or invalid stratum; ok henning@
20 years ago
mickey
a077b10ff0
define TRUSTLEVEL_MAX for the trustedlevel value of 10; henning@ ok
20 years ago
mickey
b521cde7ce
uniquely name members of s_fixedpt and l_fixedpt; henning@ ok
20 years ago
henning
b84ae4cbbe
ntp_adjtime() -> priv_adjtime()
ntp_settime() -> priv_settime()
ntp_host_dns() -> priv_host_dns()
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
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
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