diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2006-06-07 06:29:04 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2006-06-07 06:29:04 +0000 |
commit | b3297db76a0d82f09e6418259693beff1b99b895 (patch) | |
tree | c65c41f365e0bb3dc1cbc84f616919f33b8b4fb9 /usr.sbin/ntpd/server.c | |
parent | c406fbe0f0bbe6acad773e991b8c334e7297f4c2 (diff) |
Compensate old offsets with the amount of adjustment done, avoiding
overcompensating. From DragonFly, uses recent adjtime(2) changes,
so you'll need a recent kernel. ok henning@
Diffstat (limited to 'usr.sbin/ntpd/server.c')
-rw-r--r-- | usr.sbin/ntpd/server.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/ntpd/server.c b/usr.sbin/ntpd/server.c index e2529e5d4bf..8b6352b4485 100644 --- a/usr.sbin/ntpd/server.c +++ b/usr.sbin/ntpd/server.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server.c,v 1.28 2006/01/19 11:20:23 dtucker Exp $ */ +/* $OpenBSD: server.c,v 1.29 2006/06/07 06:29:03 otto Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -137,7 +137,7 @@ server_dispatch(int fd, struct ntpd_conf *conf) fatal("recvfrom"); } - rectime = gettime(); + rectime = gettime_corrected(); if (ntp_getmsg((struct sockaddr *)&fsa, buf, size, &query) == -1) return (0); @@ -160,7 +160,7 @@ server_dispatch(int fd, struct ntpd_conf *conf) reply.precision = conf->status.precision; reply.rectime = d_to_lfp(rectime); reply.reftime = d_to_lfp(conf->status.reftime); - reply.xmttime = d_to_lfp(gettime()); + reply.xmttime = d_to_lfp(gettime_corrected()); reply.orgtime = query.xmttime; reply.rootdelay = d_to_sfp(conf->status.rootdelay); |