summaryrefslogtreecommitdiff
path: root/usr.sbin/ntpd/ntp.c
AgeCommit message (Collapse)Author
2009-06-11effectively un-do r1.111, it fucks machines with bad clocks royally.Henning Brauer
spotted the hard way by theo on armish, pinned to this changed by me. no cookie for ckuethe for not testing on machines with bad clocks.
2009-06-06If ntpd decides the clock has become unsynced, reset the number of savedChris Kuethe
time corrections. Once the clock is synced again, start computing a fresh frequency correction. ok henning
2009-06-06make ntpd imsg-in-a-lib ready as well. extensive testing done, noPierre-Yves Ritschard
behavior change. ok eric@
2009-06-04After calling adjfreq to correct the clock's rate, measure and fix the clockChris Kuethe
offset. This avoids future frequency adjustments based on measurements of a clock that was being adjusted. End result: more stable clock and better frequency convergence. Also, fix a mis-ordered structure member while I'm here. ok henning
2009-01-26use monotime instead of wallclock for the report thing as wellHenning Brauer
found on this laptops harddisk, probably from stockholm
2008-12-10Correctly skip the internal fd when checking the server sockets. Use PFD_MAXClaudio Jeker
to start the for loop and not 1 which was correct long long time ago. OK otto@ found by Anirban Sinha ASinha(at)zeugmasystems.com
2008-10-02in priv_settime(), we must not adjust the 'next' timestamps on their forHenning Brauer
the offset since we use monotime for these for some time now, and monotime is not affected by system time changes (like, duh, that was the reason for the change). PR5927
2008-09-12move dns lookups to its own (privilege revoking, not chrooting) process.Henning Brauer
reason: the parent process must never ever block, but the dns routines can. last not least this fixes ntpd -s 'hanging' for a long time. tested by a couple of people
2008-06-10According to the latest SNTPv4 spec in RFC4330, secondary serversChristian Weisgerber
return the address of the synchronization source as reference identification. Remove the obsolete special casing specified in RFC2030. ok henning@
2008-06-08Don't ignore a slightly unresponsive server for an hour, 5 minutes is enough.Chris Kuethe
comments & ok henning@
2008-04-13Use arc4random_buf() when requesting more than a single word of outputDamien Miller
Use arc4random_uniform() when the desired random number upper bound is not a power of two ok deraadt@ millert@
2008-01-28Reconnect a client socket after three consecutive send failures.Marco Pfatschbacher
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@
2007-12-27some fatal() calls that should be fatalx(); ok henning@Kevin Steves
2007-12-22just call getpwnam(NTPD_USER) once; ok henning@Kevin Steves
2007-10-15Allow ntpd to report the status of peers and sensors to syslog. ThisOtto Moerbeek
happens when a SIGINFO is received, or when the majority of peers or sensors is bad. The latter with a maximum of once per 24 hour. ok henning@ ckuethe@ mbalmer@
2007-08-04This diff makes ntpd poll for sensors more aggressively when the use ofChris Kuethe
sensors is requested, but no sensors are found. ok henning
2007-01-15Although Unix compilers accept more than one definition of a globalOtto Moerbeek
symbol, follow the guidelines from K&R: only one definition of a global symbol (and possibly more declarations). Rename some vars here and there to avoid shadowing. ok henning@
2007-01-14Esape from the Mouth of Madness by adjusting stored sensor offsetsOtto Moerbeek
when we adjust time. This prevents ntpd from going wild when using sensor time sources; ok henning@ (on an earlier version) and a LOT of testing by naddy@
2006-12-20let ntpd use sensors immediately after system boot by special casingHenning Brauer
last_sensor_scan == 0. monotime might be very close to 0 after boot. source unknown, maybe from naddy, rediscovered & ok mblamer
2006-11-30Allow sensors in a sensors-only configuration to set the time at startup.Chris Kuethe
2006-10-27use clock_gettime(CLOCK_MONOTONIC, ..) to get a monotonically increasingHenning Brauer
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
2006-10-24timedelta sensors are usually updated very often, but we used to queryHenning Brauer
them only every 30 seconds. now query them every 5,and take the median value from 7 queries as sensor value. this takes outliers out of the equation and makes the overall result much better, especially for sensors with heavy jitter (like nmea for now)
2006-10-21 Found that even if client fd (i.e to NTP source) is set toHenning Brauer
-1 because of error, it may still participate in poll() causing poll() to repeatedly wake up on error fd. so make sure w edon't add -1 fds to pollevents to avoid unnecessary wakeups From: amandal@entrisphere.com
2006-07-01remove some unneeded includes; one found by vetinariOtto Moerbeek
2006-06-30spacesTheo de Raadt
2006-06-26increase polling intervbal, but only after we are synced and have doneOtto Moerbeek
a few frequency adjustments. ok henning@
2006-06-21avoid a race by installing SIGCHLD handler before fork() is called.Otto Moerbeek
ok henning@ ckuethe@
2006-06-17Import frequency conrrection code from dragonfly, whith some changes:Otto Moerbeek
only do frequency compensation if the clock is synced, and a slightly diffent way of computing the linear regression. You'll need a recent kernel and libc to use this. Testing by naddy@ and ckuethe@ and others, thanks! ok henning@
2006-06-09set session id and init logging in -s mode. tested by david@ and matthieu@;Otto Moerbeek
ok henning@
2006-06-08simplify; ok henning@Otto Moerbeek
2006-06-07Compensate old offsets with the amount of adjustment done, avoidingOtto Moerbeek
overcompensating. From DragonFly, uses recent adjtime(2) changes, so you'll need a recent kernel. ok henning@
2006-06-04Only invalidate stored replies if an adjustment was really made.Otto Moerbeek
ok henning@
2006-06-02incredibly stupid typoHenning Brauer
2006-06-01When expanding servers, do not forget to copy weight. ok henning@Otto Moerbeek
2006-06-01urgs, other stuff snuck inHenning Brauer
2006-06-01put back regular sensors scanningHenning Brauer
2006-05-31only actually run sensor_query when it is due, not every time poll returnsHenning Brauer
2006-05-28allow for weight to be added to sensors or servers, so that one canHenning Brauer
weight timedelta sensors higher than ntp peers, for example ok deraadt mbalmer
2006-05-28let sensor_query handle removals itselfHenning Brauer
2006-05-28DV_SENSORS is no more, plug workaround for the time to the real solutionHenning Brauer
2006-05-27stop passing the config around all time, just store one copyHenning Brauer
2006-05-27make ntpd listen on the hotplug socket and decode yadda yadda, becauseHenning Brauer
new sensors showing up will be announced that way when slacking ml comes back from food
2006-05-27scan for new timedelta sensors every five minutes for now, ok deraadtHenning Brauer
2006-05-26add support for timedelta sensors, which pretty much means udcf(4) rightHenning Brauer
now. untested due to lack of hardware, and it wouldn't have worked in the plane anyways. work in progress, currently picks up and uses all sensors it finds, config file bits to be added soon. theo fine with this going in
2006-05-25more bits from transatlanic flight:Henning Brauer
make priv_adjtime() deal with offsets, not peers.
2006-05-25figure out the refid to send to NTP v3 clients early and store itHenning Brauer
first bits from a way to long flight
2006-05-14PFD_MAX betterer than harcoded 1Henning Brauer
2005-08-10Propogate server's leap indicator flags to clients; ok henning@Darren Tucker
2005-08-08with -s, do not wait if we don't have any peers at all.Henning Brauer
From: Thomas Jarosch <thomas.jarosch@intra2net.com>
2005-07-15remove recently added "using privsep user X" message, spams console in -sHenning Brauer
mode, noticed by kettenis