summaryrefslogtreecommitdiff
path: root/usr.sbin/ntpd/server.c
AgeCommit message (Collapse)Author
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@
2006-07-01remove some unneeded includes; one found by vetinariOtto 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-01-19Do not attempt to listen on interfaces with a wildcard address; ok henning@Darren Tucker
2006-01-19Check SA_LEN(sa) after sa is checked for NULL. Pointed out by solar atDarren Tucker
openwall.com, ok henning@
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-22Skip invalid interfaces during 'listen on *'; ok henning@Darren Tucker
2005-07-05Save transmit time for each peer for later use as refid for SNTPv4Darren Tucker
replies. ok henning@
2005-05-24ifa->ifa_addr can be NULL in some cases, pt out by Kurt RoeckxHenning Brauer
<kurt@roeckx.be> / bugs.debian.org/310586
2005-01-28Make network unreachable errors non-fatal; ok henning@Darren Tucker
2004-12-22Save original value returned by getifaddrs to free later; ok henning@Darren Tucker
2004-12-08uniquely name members of s_fixedpt and l_fixedpt; henning@ okMichael Shalayeff
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-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-09-07ignore ntp_sendmsg()s return value in server_dispatch. could result inHenning Brauer
ntpd exiting on sendmsg() failures, which is not desired.
2004-07-18there are a few recvfrom(2) errors we do not want to panic onHenning Brauer
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-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-11Use SA_LEN(sa) instead of sa->sa_len; ok henning@Darren Tucker
2004-07-07* Convert to use the new double-based time handling functions.Alexander Guy
* 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@
2004-07-07ease code and tweak loggingHenning Brauer
2004-07-07do not listen anywhere by default.Henning Brauer
listen on * listens, well, everywhere.
2004-07-04KNFHenning Brauer
2004-06-29When no listener is specified, create a listener on every IP. ProblemAlexander Guy
reported by Peter Hessler. ok henning@
2004-06-18size struct pollfd and idx2peer dynamically instead of imposing an arbitaryHenning Brauer
limit on OPEN_MAX, modeled after bgpd
2004-06-02prepare for client functionalityHenning Brauer