use correct multiplier for us -> s conversion
delay, not error
keep last 8 offset,delay pairs - we'll need them for the clock filters later.
for now, average over those to adjust the local clock.
initialize the variables that track the offset array; ok henning@
allow hostnames and resolve them in the config file
log host packet was received from (originally using a long convoluted
function until henning showed me the light... log_sockaddr... nifty);
this diff is from henning and should be henning ok =)
when we received a apcket with incorrect cookie log from whom as well
sizeof(wrong struct) in calloc == bad. ^$&(#^$%&#*)!
Implement the clock filter as descirbed by David Mills:
form the last 8 replied received from a peer, find the one with the lowest
delay. Use that as the peer's update taken into account for calculating
the local clock's offset.
Invalidate that reply and all ones received earlier than it so that they do
not get used again.
keep a "trustlevel" per peer. loose credit for loosing a packet, loose
a lot of credit for not having supplied us with enough data within an
adjtime run interval, and get a little credit each time we get a good
reply packet. if a peer is below 20%, only send a packet occasionally to
see wether it is back. send out queries much more often between 20 and 80%
to (re-)sync quickly, and above 80% usethe regular interval.
do not use peers < 60% for calculating teh local clock offset.
designed with theo at the pho, alexander ok
servers can be given as hostnames now
swicth all the host_* functions to work on a newly invented
struct ntp_addr, which just wraps a sockaddr_storage and a next pointer,
so that host_dns can return more than one entry.
let host_dns do exactly that, return a list of all IPs for that hostname
adjust all callers in the grammar to cope with that
host_* now returns pointers, so the error return is NULL and not 0
yuck, another bad sizeof(). again in code hacked on the Frankfurt->Montreal
flight. should we draw concludions from that? I'd like to blame the
Air Canada seats...
do not listen anywhere by default.
listen on *
listens, well, everywhere.
document
listen on *
if the cookie in the received packet doesn't match discard it silently;
the logging was useful for development but is a bad idea in production
use as a remote attacker could flood your logs
knf!
don't log every single reply we receive and log local clock adjustemt nicer
ease code and tweak logging