jmc
4802b1c4fb
tweaks; ok henning@
20 years ago
jmc
e7a525d469
add rdate(8) to SEE ALSO;
20 years ago
alexander
a8cb348cd7
RFC 2030 is incorrect with regards to the computation of the delay value
for NTP queries/replies. RFC 1305 and some of Mills' other papers have
the correct formula.
ok henning@
20 years ago
henning
727098a446
help the compiler a bit with a cast, spotted by theo
20 years ago
alexander
353bc5222d
* Convert to use the new double-based time handling functions.
* Respond to the query with a reasonable received time (which
will help clients get better accuracy).
* Consolidate the server response code in preparation for a
completely 'proper' response to the client.
tips and ok from henning@
20 years ago
alexander
59dafa077b
Endian conversion mistakenly done before fraction math; ok henning@
20 years ago
henning
f429ec57f6
ease code and tweak logging
20 years ago
henning
d6f04943b0
don't log every single reply we receive and log local clock adjustemt nicer
20 years ago
deraadt
e21e9e7c5b
knf!
20 years ago
henning
fd5d60e4e2
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
20 years ago
henning
555e8ed029
document
listen on *
20 years ago
henning
e74cfb6cd2
do not listen anywhere by default.
listen on *
listens, well, everywhere.
20 years ago
henning
4a8fb608ce
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...
20 years ago
henning
21aaad0466
host_* now returns pointers, so the error return is NULL and not 0
20 years ago
henning
05a94ce779
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
20 years ago
henning
d8e805cbfb
servers can be given as hostnames now
20 years ago
henning
ccb62d3811
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
20 years ago
henning
1bd657839e
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.
20 years ago
henning
6127dae75c
sizeof(wrong struct) in calloc == bad. ^$&(#^$%&#*)!
20 years ago
henning
12fb5f8424
when we received a apcket with incorrect cookie log from whom as well
20 years ago
jason
1694ed9e27
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 =)
20 years ago
henning
a62ef89ddb
allow hostnames and resolve them in the config file
20 years ago
naddy
ca612edc92
initialize the variables that track the offset array; ok henning@
20 years ago
henning
e490cc8936
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.
20 years ago
henning
25baf3f656
delay, not error
20 years ago
otto
74f0809de0
use correct multiplier for us -> s conversion
20 years ago
henning
ff435348cf
don't limit to one remote server any more
20 years ago
henning
7cb3db11e2
calculate the median offset from all servers we sync to and call
adjtime() when necessary to keep the local clock in sync
yes, that means ntpd syncs the local clock now.
20 years ago
henning
43d3d7e70a
put interval defines in ntpd.h and name them consistently
20 years ago
henning
d6fd2597f7
simplify slightly
20 years ago
henning
bc7ac3d288
KNF
20 years ago
alexander
9b6618babd
Compute the local clock offset from the server's response.
ok henning@
20 years ago
alexander
ff4cb11db4
wrong struct calloc'ed; ok henning@
20 years ago
alexander
381c8ef653
When no listener is specified, create a listener on every IP. Problem
reported by Peter Hessler. ok henning@
20 years ago
alexander
62e55d8051
Precedence and type fix; ok henning@
20 years ago
henning
c1beef1cf2
size struct pollfd and idx2peer dynamically instead of imposing an arbitary
limit on OPEN_MAX, modeled after bgpd
20 years ago
henning
a4881967ba
ewps, add ntpd.conf.5
20 years ago
henning
2eeaf15a63
bloody attempt at a manpage
20 years ago
henning
ed86cbbedb
provide most of the client functionality.
hook the descriptors into the main poll and such.
we're not doing anything with the reply we recive yet, tho.
mostly hacked on the Frankfurt->Montreal flight, as batteries and those
horrible air canada seats permitted...
20 years ago
henning
e473e31441
provide log_sockaddr, from bgpd
20 years ago
alexander
760bec6544
Move prototype definitions. Add multi-include protection to header.
ok henning@
20 years ago
henning
44782aec16
prepare for client functionality
20 years ago
henning
e5f6bb6ae2
$OpenBSD$
20 years ago
henning
a241c3837c
first cut at config file parser
for now, one can set the addresses to listen on
20 years ago
henning
13d1c0852b
tzset(); noticed by theo
20 years ago
henning
30613069fb
allow ntpd to listen on nearly arbitary number of sockets (OPEN_MAX - 1 atm).
default to one IPv4 wildcard and one IPv6 wildcard one.
20 years ago
henning
4859c5eae7
naming consistency
20 years ago
henning
95c30e89c6
make my japanese friends happy by supporting IPv6 as well
20 years ago
henning
05bd315360
initial cut at a manpage
20 years ago
henning
ffc862704c
fix usage()
20 years ago