summaryrefslogtreecommitdiff
path: root/usr.sbin/ntpd/client.c
AgeCommit message (Collapse)Author
2008-06-10For IPv6 addresses, return the first 32 bits of the MD5 hash of theChristian Weisgerber
address as ref ID (RFC4330). ok henning@
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-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-11-22be a bit less aggressive retrying; this keeps the message queueOtto Moerbeek
empty while in the -s period, so the poll timeout actually times out if there are no interfaces available. ok henning@
2007-05-01if resolving a name fails, be more aggressive retrying, but with care:Otto Moerbeek
do not have more than one dns request outstanding per peer. resolves slow recovery when resolving fails initially, without clogging the pipe with lots of dns requests; tested by Jason George; ok deraadt@
2007-04-30aggressive spelling fix, spotted by jbgTheo de Raadt
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-21in client_nextaddr, check fd != -1 before close, just nicer this wayHenning Brauer
From: amandal@entrisphere.com
2006-10-21when ntp_sendmsg fails, reset trustlevel to TRUSTLEVEL_PATHETICHenning Brauer
From: amandal@entrisphere.com
2006-10-21EADDRNOTAVAIL after connect is one of the soft errors where we don't abortHenning Brauer
too. from amandal@entrisphere.com
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-05-29When ntpd backs off polling due to a negative delay, tell the user how longChris Kuethe
it will wait until the next poll. ok henning@
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
2005-09-24Log source address for 'malformed packet' errors. ok henning@Darren Tucker
2005-08-10Propogate server's leap indicator flags to clients; ok henning@Darren Tucker
2005-07-11Print actual error when in debug mode; ok henning@Darren Tucker
2005-07-06add another non-fatal error for recvfrom; ok henning@Darren Tucker
2005-07-05Save transmit time for each peer for later use as refid for SNTPv4Darren Tucker
replies. ok henning@
2005-06-19use a little state engine to keep track of delayed dns lookups and such,Henning Brauer
eases things tested by Jason Ackley <jason@ackley.net> Matthias Kilian <kili@outback.escape.de> Stephen Marley <stephen@marley.org.uk> sturm@ theo ok
2005-04-19move the "reply from ... " log msg in -d mdoe uop a bit so it actuallyHenning Brauer
comes before the "adjusting local clock by..." one, joerg
2005-04-18prevent replies with negative delay from being used, could happen with -sHenning Brauer
From: Joerg Sonnenberger <joerg@britannica.bec.de> of dragonfly
2005-03-08let client_query return 0 if it requested dns resolutionHenning Brauer
2005-02-21fix an error messageHenning Brauer
2005-02-03Implement simple duplicate suppression of peer errors; ok henning@Darren Tucker
2005-01-28Simplify interval scaling and randomize query intervals; ok henning@Darren Tucker
2005-01-28Make network unreachable errors non-fatal; ok henning@Darren Tucker
2005-01-27Scale query interval by the overall offset not per-peer offset, so weDarren Tucker
don't query outliers more often than any other server. ok henning@
2005-01-27Delay before retrying a query on timeout; ok henning@Darren Tucker
2004-12-15Poll unsynchronized servers at the maximum interval and log a message aboutDarren Tucker
them when in debug mode; ok henning@
2004-12-15Factor out interval scaling code; ok henning@Darren Tucker
2004-12-14If polling a server results in an error, drop that server to the maximumDarren Tucker
poll interval; ok henning@
2004-12-13Discard replies with alarm flag set or invalid stratum; ok henning@Darren Tucker
2004-12-09define TRUSTLEVEL_MAX for the trustedlevel value of 10; henning@ okMichael Shalayeff
2004-12-08uniquely name members of s_fixedpt and l_fixedpt; henning@ okMichael Shalayeff
2004-11-10ntp_adjtime() -> priv_adjtime()Henning Brauer
ntp_settime() -> priv_settime() ntp_host_dns() -> priv_host_dns()
2004-11-05Use SA_LEN() instead of ss.ss_len. Evaluates to the same result but it'sDarren Tucker
easier on portable. ok henning@
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-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-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-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-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-14paranoia: reset query->fd to -1 after close, from canacar some time agoHenning Brauer
2004-08-16Be more careful setting next and deadline, they should not both be != 0Otto Moerbeek
at the same time. ok henning@