summaryrefslogtreecommitdiff
path: root/usr.sbin/ntpd
AgeCommit message (Collapse)Author
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
2004-07-28prevent unresolvable hostnames in "listen on" statementsHenning Brauer
2004-07-28when a dns lookup fails at parse time, do not abort but try againHenning Brauer
to resolve the hostname every 60 seconds fixes ntpd invocations before e. g. a dialup link is established and such. as we want ntpd to be a "fire and forget" background daemon it should cope with such situations. tested by many
2004-07-25remove unused functionHenning Brauer
2004-07-21no multiple free(); "John L. Scarfone" <j0@cox.net>Henning Brauer
2004-07-20wrap the heads for the linked list of addresses into a new ntp_addr_wrapHenning Brauer
which, besides the head pointer for the list of course, stores the original address as specified (i. e. as hostname instead of resolved IPs) and flags and such.
2004-07-18there are a few recvfrom(2) errors we do not want to panic onHenning Brauer
2004-07-18query interval scaling, episode IIHenning Brauer
1) base the interval calculation on the offset from the last reply, not from the last peer update. Allows us to send more queries again faster when the local clock diverges too much 2) every time we form a peer update (for which we need 8 replies) check wether we have a ready peer update for all peers that are currently trusted, and if so, calculate the total offset and call adjtime(). that means that adjtime is no longer called in fixed intervals but whenever we have enough data to reliably calculate the local clock offset. In practice, that means we call adjtime() less often, but with probably better data. 3) invalidate peer updates after beeing used. no point in re-using them - this resulted in calling adjtime() multiple times with the same offset, which doesn't make sense tested by many
2004-07-14do not do the stratum guessing dance.Henning Brauer
stratum is pretty much pointless anyway these days, and we certainly do not want to send out illegal packets (stratum=0) until synced...
2004-07-13tweaks; ok henning@Jason McIntyre
2004-07-13Respond to client queries with better server statistics. We now outputAlexander Guy
a close-to-reality stratum, a real reference time, and a leap indicator that will indicate if the local clock isn't synchronized. This also means that until the server feels it's synchronized, it will tell the clients it isn't. This is normal, and correct. ok henning@
2004-07-13ignore obviously malformed queries; ok henning@Alexander Guy
2004-07-13liek bgpd, use a socketpair(2) instead of a pipe(2)Henning Brauer
2004-07-12Add missing newlinesDarren Tucker
2004-07-12Replace errx with equivalent fprintf+exit to make porting easier; ok henning@Darren Tucker
2004-07-11Use SA_LEN(sa) instead of sa->sa_len; ok henning@Darren Tucker
2004-07-11Start collecting the remote server state along with the calculatedAlexander Guy
offsets, in preparation for having correct server statistics in responses to client queries. ok henning@
2004-07-10KNF; ok henning@Alexander Guy
2004-07-10short fixed point <-> double conversion routines; ok henning@Alexander Guy
2004-07-10correct leap indicator mask; ok henning@Alexander Guy
2004-07-10missing {}Henning Brauer
2004-07-10check wether we have enough data to form a peer update on receiptionHenning Brauer
of each packet, not only after each 8th (where we have enough for sure)
2004-07-10oupsHenning Brauer
2004-07-10scale query interval based on local clock offset. tested by manyHenning Brauer
not as efficient as I want it to be yet, but more is coming
2004-07-09make lint a wee bit happierTheo de Raadt
2004-07-09make date(1), rdate(8), ntpd(8), and timed(8) .Xr themselves;Jason McIntyre
mostly from Andreas Kahari (PR #3846);
2004-07-09Do not forget to initialize head. ok henning@Otto Moerbeek
2004-07-09too chatty; ok henningTheo de Raadt
2004-07-09don't panic when sendto() fails; for the client part just re-scheduleHenning Brauer
noticed & fix tested by fries@
2004-07-09don't try to update the clock when we have no dataHenning Brauer
2004-07-09various cleanup:Jared Yanovich
- mention '#' comments - fix macros for directives - typos - change list display - ntp -> NTP - slight rewording help and ok jmc ok henning otto
2004-07-09the child process needs to ignore SIGHUP for now, ottoHenning Brauer
2004-07-09remove leftover pieces of on-the-fly reconfig shitz that made ntpd exit onHenning Brauer
SIGHUP, noticed by otto
2004-07-09soem tweaks from the Frankfurt->Hamburg flightHenning Brauer
2004-07-09document the "servers" keywordHenning Brauer
2004-07-09rework dns handling with all its cosequences...Henning Brauer
we know have both a "server" and "servers" keyword. they differ when the hostname resolves to more than one IP, server picks one and servers expands to all. that means no longer stuffing a sockaddr_storage into ntp_peer but a pointer to a linked list of ntp_addr structs. in the "servers" case the list of n addresses returned by host() is expanded into n ntp_peer structs and thus n individual peers. in the "server" case the whole list is attached to ntp_peer, and whenever we do not receive a reply in time we traverse the list one further, so that hosts with both AAAA and A records are first tried with the AAAA one but we gracefully fall back to the A one. semantics with theo; hacked up on the Montreal->Frankfurt flight. again Air Canada surprised me, that older 767 hat pretty decent seats.
2004-07-09when calculating the timeout for poll() we need to take the deadlines forHenning Brauer
the outstanding queries into account just-before-meal from the Montreal->Frankfurt flight
2004-07-08kill traces of on-the-fly reconfigure (from bgpd), not needed in ntpdHenning Brauer
2004-07-08remove a bogus always-true test before adjtime()Henning Brauer
2004-07-08remove all handling of netmasks/prefix lengths - we don't need that in ntpd.Henning Brauer
fixes the dns resolves to v4 and v6 addresses bug found by phessler hacked on the Calgary->Montreal flight that proved that Air Canada _does_ have some modern aircrafts with good seats
2004-07-08log_debug() when a peer doesn't answer in timeHenning Brauer
2004-07-08lof replies with log_debug so one gets increased verbosity when inHenning Brauer
foreground/debug mode
2004-07-08make log_debug() only log anything at all when we are in debug modeHenning Brauer
before, it would log with LOG_DEBUG to syslog when !debug
2004-07-07tweaks; ok henning@Jason McIntyre
2004-07-07add rdate(8) to SEE ALSO;Jason McIntyre
2004-07-07RFC 2030 is incorrect with regards to the computation of the delay valueAlexander Guy
for NTP queries/replies. RFC 1305 and some of Mills' other papers have the correct formula. ok henning@