summaryrefslogtreecommitdiff
path: root/usr.sbin/ntpd
AgeCommit message (Collapse)Author
2004-10-22oupsHenning Brauer
2004-10-22in server mode reply with stratum from the peer that we currently preferHenning Brauer
plus one
2004-10-15Only set IPTOS_LOWDELAY on IPv4 interfaces; pointed out by phessler, ok henningDarren Tucker
2004-10-14Have ntpd use IPTOS_LOWDELAY; ok henning@Darren Tucker
2004-10-13set rootdelay in replies.Henning Brauer
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.
2004-10-13in struct ntp_msg, rename "distance" to "rootdelay" to closer match RFCsHenning Brauer
and such
2004-10-13thinko, htonl() -> ntohl(). as we don't use the value in question effect zeroHenning Brauer
2004-10-13fall cleaningHenning Brauer
2004-10-13correctly set refid in replies with NTP protocol versions < 4.Henning Brauer
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.
2004-10-13when we get back a IMSG_HOST_DNS message from the parent the peer ID withinHenning Brauer
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
2004-10-08whitespace both in comment; from berndHenning Brauer
2004-10-05in client_addr_init() and client_nextaddr(), do not set up the socket andHenning Brauer
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
2004-10-04do not take the average offset from all peers when calculating the totalHenning Brauer
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
2004-09-30now that we connect() the client sockets we need to handle ECONNREFUSED asHenning Brauer
non-fatal too, from camield@
2004-09-24connect() the client-side sockets. idea & test & ok camield@Henning Brauer
2004-09-23reset chld_pid to 0 when acting upon a SIGCHLD so we don't try to send itHenning Brauer
a kill then - tiny possible race there pointed out by Brian Poole <raj@cerias.purdue.edu>
2004-09-18greatly improved by jmc with some tweaks by yours trulyHenning Brauer
2004-09-18jmc says S before s and not s before S, sssssssso we do.Henning Brauer
2004-09-18implement -S to override earlier -s, requested by theoHenning Brauer
2004-09-18say when we run settimeofday() with -s and when not, help from bobHenning Brauer
2004-09-18don't call settimeofday() when the offset is smaller than 180 seconds,Henning Brauer
adjtime() will fix that fast enough, from discussion in theo's living room ok mcbride beck
2004-09-18add a new -s option, that tells ntpd to set the time using settimeofday()Henning Brauer
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
2004-09-18do not bother overallocating and shrinking the pfd and idx2peer arrays,Henning Brauer
doesn't by us anything. discussed with ryan during dinner at original joe's
2004-09-16the "type" param to imsg_compose and imsg_create is really anHenning Brauer
enum imsg_type and not an int
2004-09-16in imsg_compose:Henning Brauer
-don't buf_free() on imsg_add() errors, it already does that for us -use imsg_close() instead of buf_close(), does error handling already
2004-09-16use imsg_add instead of the lower level buf_add in imsg_create; it alreadyHenning Brauer
does the error checking for us.
2004-09-16ewps...Henning Brauer
2004-09-15need buf_free() to free buf, free() is not good enoughHenning Brauer
2004-09-15imsg framework cleanup:Henning Brauer
-kill the _pid flavors of imsg_create and imsg_compose, and just add pid as argument to those -use imsg_create in imsg_compose instead of duplicating code -check for datalen overflow
2004-09-15malloc the imsg buffers instead of having them statically, suggested byHenning Brauer
micsky some time ago, ok otto
2004-09-15kill another unused function and two debugging printfsHenning Brauer
2004-09-15remove the unused variable/macro code, ok theoHenning Brauer
2004-09-15unused variables, theoHenning Brauer
2004-09-15missing include, from theoHenning Brauer
2004-09-15remove buf_write(), not used in ntpd. found by theoHenning Brauer
2004-09-14paranoia: reset query->fd to -1 after close, from canacar some time agoHenning Brauer
2004-09-09correctly track peer count. fixes a memory corruption.Henning Brauer
with & ok otto millert claudio, ok deraadt canacar
2004-09-07ignore ntp_sendmsg()s return value in server_dispatch. could result inHenning Brauer
ntpd exiting on sendmsg() failures, which is not desired.
2004-08-30don't forget to set *hn... theo okHenning Brauer
2004-08-30skip early DNS lookups -- they are deferred to later; ok otto ho henningTheo de Raadt
2004-08-30ENOBUFS, EHOSTUNREACH, ENETDOWN and EHOSTDOWN are bad reasons to log; ok ↵Theo de Raadt
otto henning
2004-08-24don't fatal() if getaddrinfo() returns EAI_NONAMEHenning Brauer
2004-08-16Be more careful setting next and deadline, they should not both be != 0Otto Moerbeek
at the same time. ok henning@
2004-08-13Reset deadline on failed transmit. Avoids a spinning process ifOtto Moerbeek
all sends fail. ok henning@
2004-08-12do not try to getaddrinfo() in the unprivileged process, send an imsgHenning Brauer
asking the privileged one to do it. sends back an imsg with the resulting addresses in a bunch of struct sockaddr_storage in the data part. this should fix all remaining issues with dns (non-)availability at ntpd startup, be it due to named on localhost or something else. tested by marco@ and Chris Paul <chris.paul@sentinare.com>
2004-08-10order #includes, Brian Poole <raj@cerias.purdue.edu>Henning Brauer
2004-08-10wrong sizeof; Brian Poole <raj@cerias.purdue.edu>Henning Brauer
2004-08-10in the pool case ("servers somepool.somewhere"), we add new peers whileHenning Brauer
looping over the addresses returned by the dns lookup, as each address is one new peer. however, if the lookup fails with a temporary error, we will try to lookup later again. for that, we obviously need to insert one peer with the hostname in addr_head... change one for() loop into a do { } while() one
2004-08-10move memory allocation for new peers into a new function, makes ID allocationHenning Brauer
easier
2004-07-29keep an ID per server we talk toHenning Brauer