OpenBSD CVS

CVS log for src/usr.sbin/ntpd/ntpd.c


[BACK] Up to [local] / src / usr.sbin / ntpd

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.133 / (download) - annotate - [select for diffs], Tue May 21 05:00:48 2024 UTC (2 weeks, 4 days ago) by jsg
Branch: MAIN
CVS Tags: HEAD
Changes since 1.132: +1 -2 lines
Diff to previous 1.132 (colored)

remove prototypes with no matching function and externs with no var
partly checked by millert@

Revision 1.132 / (download) - annotate - [select for diffs], Fri Jul 16 14:36:09 2021 UTC (2 years, 10 months ago) by mestre
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0
Changes since 1.131: +2 -2 lines
Diff to previous 1.131 (colored)

main proc doesn't speak with sockets during the main loop and setpriority plus
chroot (and privdrop) in the child procs at this point are all set and done so
pledge("inet id") promises are not required anymore.

analysis and OK @kn

Revision 1.131 / (download) - annotate - [select for diffs], Fri Jul 16 14:34:37 2021 UTC (2 years, 10 months ago) by mestre
Branch: MAIN
Changes since 1.130: +2 -4 lines
Diff to previous 1.130 (colored)

/etc/ssl/cert.pem is loaded into mem with tls_load_file(3) on local function
priv_constraint_child() which is called before we reach pledge(2), therefore we
we don't need to unveil(2) that file nor having pledge("rpath") since it was
only required to read that same file.

OK kn@

Revision 1.130 / (download) - annotate - [select for diffs], Mon Jul 12 15:09:21 2021 UTC (2 years, 10 months ago) by beck
Branch: MAIN
Changes since 1.129: +3 -3 lines
Diff to previous 1.129 (colored)

Change the error reporting pattern throughout the tree when unveil
fails to report the path that the failure occured on. Suggested by
deraadt@ after some tech discussion.

Work done and verified by Ashton Fagg <ashton@fagg.id.au>

ok deraadt@ semarie@ claudio@

Revision 1.129 / (download) - annotate - [select for diffs], Wed Feb 12 19:14:56 2020 UTC (4 years, 3 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.128: +3 -2 lines
Diff to previous 1.128 (colored)

If constraints are configured but do not work for whatever reason ntpd
does not work. Make that more clear in the log and ntpdctl -s status.
report by and ok benno@

Revision 1.128 / (download) - annotate - [select for diffs], Mon Nov 11 06:32:52 2019 UTC (4 years, 6 months ago) by otto
Branch: MAIN
Changes since 1.127: +3 -3 lines
Diff to previous 1.127 (colored)

Also implement "trusted" for sensors; do not do constraint validation
for these. ok deraadt@

Revision 1.127 / (download) - annotate - [select for diffs], Mon Nov 11 01:04:55 2019 UTC (4 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.126: +10 -5 lines
Diff to previous 1.126 (colored)

Disable -s and -S functionality.  -s would force time using NTP packets without
any MITM protection checks.  We've had constraint checks for MITM protection
for some time. Recent work changed the default mode to rapidly check NTP packets against constraint validation, as the default mode.
In environments where https traffic doesn't work, ethernet-near servers can
be labelled as "trusted".  trusted sensor support is also coming.
We have reasons to immediately move people away from the -s mode.
ok otto

Revision 1.126 / (download) - annotate - [select for diffs], Sun Nov 10 19:24:47 2019 UTC (4 years, 6 months ago) by otto
Branch: MAIN
Changes since 1.125: +3 -2 lines
Diff to previous 1.125 (colored)

Introduce a "trusted" modifier, for peers that should be on a local net
used in situations where https constraints cannot be used and we still want
auto settime. Result of discussion with and ok deraadt@

Revision 1.125 / (download) - annotate - [select for diffs], Sun Nov 10 07:32:58 2019 UTC (4 years, 6 months ago) by otto
Branch: MAIN
Changes since 1.124: +8 -4 lines
Diff to previous 1.124 (colored)

- validate sensor values against constraints
- do not restart settime timeout interval if something happens in the main
  event loop
- apply a tight loop protection; it can be painfull on a single
  core machine since the process runs at maximum priority. Should only
  happen when a bug is introduced while developing, but prevents having to
  machine taken over by ntpd.

Revision 1.124 / (download) - annotate - [select for diffs], Fri Jun 28 13:32:49 2019 UTC (4 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.123: +2 -2 lines
Diff to previous 1.123 (colored)

When system calls indicate an error they return -1, not some arbitrary
value < 0.  errno is only updated in this case.  Change all (most?)
callers of syscalls to follow this better, and let's see if this strictness
helps us in the future.

Revision 1.123 / (download) - annotate - [select for diffs], Thu Jun 27 15:18:42 2019 UTC (4 years, 11 months ago) by otto
Branch: MAIN
Changes since 1.122: +15 -12 lines
Diff to previous 1.122 (colored)

Allow logging to both stderr and syslog; don't reset the log level if
the log destination changes. ok claudio@ benno@

Revision 1.122 / (download) - annotate - [select for diffs], Wed Jun 12 05:04:45 2019 UTC (4 years, 11 months ago) by otto
Branch: MAIN
Changes since 1.121: +3 -2 lines
Diff to previous 1.121 (colored)

Fix init of syslog for childs and teach dns process about synced state.
ok benno@

Revision 1.121 / (download) - annotate - [select for diffs], Sun Jun 9 08:40:54 2019 UTC (5 years ago) by otto
Branch: MAIN
Changes since 1.120: +23 -2 lines
Diff to previous 1.120 (colored)

Introducing autmatic settime mode: if some preconditions are met
(booting, constraint(s) defined) set the time but only if the clock
should be moved forward by more than a minute, based on ntp replies
that satisfied the constraints. Tested by many; ok deraadt@

Revision 1.120 / (download) - annotate - [select for diffs], Mon Jan 14 16:30:21 2019 UTC (5 years, 4 months ago) by florian
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.119: +4 -1 lines
Diff to previous 1.119 (colored)

Prevent multiple ntpds from tripping over each other.
This brings over the logic from bgpd & ospfd.
Input & OK deraadt

Revision 1.119 / (download) - annotate - [select for diffs], Thu Nov 29 14:25:07 2018 UTC (5 years, 6 months ago) by tedu
Branch: MAIN
Changes since 1.118: +2 -2 lines
Diff to previous 1.118 (colored)

update for libtls default cert changes.
bonus: this exposed a few missing const qualifiers.

Revision 1.118 / (download) - annotate - [select for diffs], Tue Nov 6 20:41:36 2018 UTC (5 years, 7 months ago) by jsing
Branch: MAIN
Changes since 1.117: +3 -2 lines
Diff to previous 1.117 (colored)

Use TLS_CA_CERT_FILE instead of a separate define.

ok beck@ bluhm@ tb@

Revision 1.117 / (download) - annotate - [select for diffs], Fri Aug 31 18:45:02 2018 UTC (5 years, 9 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.116: +4 -1 lines
Diff to previous 1.116 (colored)

the main process must chdir to /, since it cannot have daemon() do the
job at startup.  After much anguish I accept dlg's solution of chdir
for the problem ("starting ntpd on a filesystem I want to unmount"),
but we cannot change the main-process daemon() call.  Why?  Because
the ntpd privsep design predates more modern designs where the config
file is parsed once, and configuration marshalled to the fork+exec
children.  Instead each ntpd process re-parses the config, and if
we chdir before fork+exec startup, it will move the basedir causing
-f "relativepath" to fail.

discussed with florian

Revision 1.116 / (download) - annotate - [select for diffs], Wed Aug 8 22:56:42 2018 UTC (5 years, 10 months ago) by deraadt
Branch: MAIN
Changes since 1.115: +5 -1 lines
Diff to previous 1.115 (colored)

ntpd unveils the cert.pem "r" file (which is passed-over-socket to the
constraints process), and /usr/sbin/ntpd "x" to perform fork+exec operations.

Revision 1.115 / (download) - annotate - [select for diffs], Sat Aug 4 11:07:14 2018 UTC (5 years, 10 months ago) by mestre
Branch: MAIN
Changes since 1.114: +2 -3 lines
Diff to previous 1.114 (colored)

Revert back previous commit, we have decided that socket files don't cause any
harm if not deleted after the daemon is shutdown and at the same time we also
tackle another attack surface by not allowing the program to create/delete
any more files (by removing "cpath" promise from pledge(2)).

Discussion initiated by a question from deraadt@ OK florian@

Revision 1.114 / (download) - annotate - [select for diffs], Thu Aug 2 13:05:34 2018 UTC (5 years, 10 months ago) by mestre
Branch: MAIN
Changes since 1.113: +3 -2 lines
Diff to previous 1.113 (colored)

ntpd(8) has logic in place to delete its control socket on shutdown, but it
currently doesn't call the function control_cleanup to do so. The solution is
to simply call that function just before the program quits.

"sure" henning@

Revision 1.113 / (download) - annotate - [select for diffs], Mon Jan 9 14:49:22 2017 UTC (7 years, 5 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.112: +4 -4 lines
Diff to previous 1.112 (colored)

Stop accessing verbose and debug variables from log.c directly.

This replaces log_verbose() and "extern int verbose" with the two functions
log_setverbose() and log_getverbose().

Pointed out by benno@
OK krw@ eric@ gilles@ (OK gilles@ for the snmpd bits as well)

Revision 1.112 / (download) - annotate - [select for diffs], Thu Dec 1 16:24:48 2016 UTC (7 years, 6 months ago) by mestre
Branch: MAIN
Changes since 1.111: +1 -8 lines
Diff to previous 1.111 (colored)

Remove unused variable which was leaking memory, and while here remove 2 other
variables that were also never used

OK otto@

Revision 1.111 / (download) - annotate - [select for diffs], Mon Sep 26 17:17:01 2016 UTC (7 years, 8 months ago) by rzalamena
Branch: MAIN
Changes since 1.110: +9 -9 lines
Diff to previous 1.110 (colored)

Teach ntpd(8) constraint process to use exec*() instead of just forking,
with this change we get the pledge() ability back to the parent process.

some tweaks from and ok reyk@

Revision 1.110 / (download) - annotate - [select for diffs], Mon Sep 26 16:55:02 2016 UTC (7 years, 8 months ago) by rzalamena
Branch: MAIN
Changes since 1.109: +14 -40 lines
Diff to previous 1.109 (colored)

Teach ntpd(8) how to use socket status to shutdown the daemon. While at
it, remove some verbose shutdown messages that we had before with pipe
close.

ok reyk@

Revision 1.109 / (download) - annotate - [select for diffs], Wed Sep 14 13:20:16 2016 UTC (7 years, 8 months ago) by rzalamena
Branch: MAIN
Changes since 1.108: +29 -11 lines
Diff to previous 1.108 (colored)

Teach ntpd(8) how to fork+exec.

ok reyk@, bcook@

Revision 1.108 / (download) - annotate - [select for diffs], Sat Sep 3 11:52:06 2016 UTC (7 years, 9 months ago) by reyk
Branch: MAIN
Changes since 1.107: +4 -4 lines
Diff to previous 1.107 (colored)

Remove the oh so funny "LOSS OF MIND" from the diclaimer that was not
part of the original ISC license that we use in OpenBSD.  Done for
files were Henning is the original author.

OK henning@ deraadt@

Revision 1.107 / (download) - annotate - [select for diffs], Mon May 2 06:25:29 2016 UTC (8 years, 1 month ago) by semarie
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.106: +3 -1 lines
Diff to previous 1.106 (colored)

prepare userland for removing chroot(2) from allowed syscalls under pledge(2).

for ntpd(8), removing the pledge call is a first step: futher redesign will occurs later.

ok reyk@ benno@

Revision 1.106 / (download) - annotate - [select for diffs], Tue Feb 2 17:51:11 2016 UTC (8 years, 4 months ago) by sthen
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.105: +1 -2 lines
Diff to previous 1.105 (colored)

Remove setproctitle() for the parent process. Because rc.d(8) uses process
titles (including flags) to distinguish between daemons, this makes it
possible to manage multiple copies of a daemon using the normal infrastructure
by symlinking rc.d scripts to a new name. ok jung@ ajacoutot@, smtpd ok gilles@

Revision 1.105 / (download) - annotate - [select for diffs], Wed Jan 27 21:48:34 2016 UTC (8 years, 4 months ago) by reyk
Branch: MAIN
Changes since 1.104: +4 -1 lines
Diff to previous 1.104 (colored)

Don't attempt to kill() the constraint in the wrong process.  The
process management of the contraint processes has been moved from ntp
to the parent, for better privsep and pledge, but the ntp process
still attempted to kill the constraints on timeout directly.  Fix this
regression by introducing a new imsg from ntp to the parent and the
related logic to kill a constraint at the right place.

Reported & tested by bcook@
Ok bcook@

Revision 1.104 / (download) - annotate - [select for diffs], Wed Jan 27 21:36:25 2016 UTC (8 years, 4 months ago) by bcook
Branch: MAIN
Changes since 1.103: +10 -6 lines
Diff to previous 1.103 (colored)

update ntpd log initialization to work like relayd, fix debug log levels

ok reyk@

Revision 1.103 / (download) - annotate - [select for diffs], Mon Jan 11 15:30:56 2016 UTC (8 years, 4 months ago) by deraadt
Branch: MAIN
Changes since 1.102: +2 -2 lines
Diff to previous 1.102 (colored)

sneaky whitespace snuck in again

Revision 1.102 / (download) - annotate - [select for diffs], Tue Dec 29 18:23:28 2015 UTC (8 years, 5 months ago) by millert
Branch: MAIN
Changes since 1.101: +4 -4 lines
Diff to previous 1.101 (colored)

Don't assume fprintf() will set the FILE * error condition.
Instead, check the return value of fprintf() and fflush()
and call clearerr() before returning on error.  OK jca@

Revision 1.101 / (download) - annotate - [select for diffs], Sat Dec 19 17:55:29 2015 UTC (8 years, 5 months ago) by reyk
Branch: MAIN
Changes since 1.100: +7 -5 lines
Diff to previous 1.100 (colored)

Switch and sync to the log.c variant from httpd/relayd/iked/snmpd/vmd.

OK bcook@ jung@

Revision 1.100 / (download) - annotate - [select for diffs], Sat Dec 5 13:12:16 2015 UTC (8 years, 6 months ago) by claudio
Branch: MAIN
Changes since 1.99: +3 -3 lines
Diff to previous 1.99 (colored)

EAGAIN handling for imsg_read. OK henning@ benno@

Revision 1.99 / (download) - annotate - [select for diffs], Tue Nov 24 01:03:25 2015 UTC (8 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.98: +15 -6 lines
Diff to previous 1.98 (colored)

Cache values from getpwnam() done at initialization, which need to be
used by the constraint processes setup later (chroot, setuid...)
[late getpwnam discovered during a further audit]
ok millert

Revision 1.98 / (download) - annotate - [select for diffs], Fri Oct 23 16:39:13 2015 UTC (8 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.97: +28 -22 lines
Diff to previous 1.97 (colored)

Rather than re-opening the driftfile to write, keep it open; rewinding
and coping with error conditions... that lets us avoid a pledge "wpath".

Putting it all together, this lets the master ntpd pledge "stdio rpath
inet settime proc id".  It works like this: "rpath" to load the
certificates, "proc" to create constraint processes, "id" to chroot
and lock the constraint processes into a jail, then "inet" to open a
https session.  "settime" is used by the master to manage the system
time when the ntp-speaking engine instructs the master.

with help from naddy

Revision 1.97 / (download) - annotate - [select for diffs], Mon Oct 12 06:50:08 2015 UTC (8 years, 7 months ago) by reyk
Branch: MAIN
Changes since 1.96: +64 -17 lines
Diff to previous 1.96 (colored)

Move execution of the constraints from the ntp to the parent process.
This helps the ntp process to a) give a better pledge(2) and to b)
keep the promise of "saving the world again... on time" by removing
the delays that have been introduced by expensive constraint forks.
The new design offers better privsep but introduces a few more imsgs
and runs a little bit more code in the privileged parent.  The
privileged code is minimal, carefully checked, and does not attempt to
"parse" any contents; the forked constraints instantly drop all
privileges and pledge to "stdio inet".

OK beck@ deraadt@

Revision 1.96 / (download) - annotate - [select for diffs], Fri Oct 9 01:37:09 2015 UTC (8 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.95: +3 -3 lines
Diff to previous 1.95 (colored)

Change all tame callers to namechange to pledge(2).

Revision 1.95 / (download) - annotate - [select for diffs], Sat Oct 3 02:47:15 2015 UTC (8 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.94: +4 -1 lines
Diff to previous 1.94 (colored)

In the ntpctl(1) case, after it has connect()'d to ntpd we can tame "stdio"
since that is all it will do till termination.

Revision 1.94 / (download) - annotate - [select for diffs], Sat Jul 18 00:53:44 2015 UTC (8 years, 10 months ago) by bcook
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.93: +3 -3 lines
Diff to previous 1.93 (colored)

replace bzero with memset

ok phessler@ deraadt@

Revision 1.93 / (download) - annotate - [select for diffs], Wed Mar 11 19:38:48 2015 UTC (9 years, 3 months ago) by jmc
Branch: MAIN
Changes since 1.92: +2 -2 lines
Diff to previous 1.92 (colored)

-s is not optional, sadly;
while here i've reformatted the page to stop kidding that -s is 4 options;

original issue kind of spotted by adam thompson, though note i am not fixing the
issue he complained about (i'll address that mail in a minute);

Revision 1.92 / (download) - annotate - [select for diffs], Wed Feb 11 03:16:57 2015 UTC (9 years, 3 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.91: +2 -33 lines
Diff to previous 1.91 (colored)

Remove dead code (IMSG_HOST_DNS has been moved from the parent to
ntp_dns some years ago).

OK henning@

Revision 1.91 / (download) - annotate - [select for diffs], Tue Feb 10 11:46:39 2015 UTC (9 years, 3 months ago) by reyk
Branch: MAIN
Changes since 1.90: +8 -7 lines
Diff to previous 1.90 (colored)

spacing

Revision 1.90 / (download) - annotate - [select for diffs], Tue Feb 10 11:16:47 2015 UTC (9 years, 3 months ago) by reyk
Branch: MAIN
Changes since 1.89: +3 -3 lines
Diff to previous 1.89 (colored)

Don't show the subseconds when displaying the constraint offset.

OK henning@ deraadt@

Revision 1.89 / (download) - annotate - [select for diffs], Tue Feb 10 06:40:08 2015 UTC (9 years, 3 months ago) by reyk
Branch: MAIN
Changes since 1.88: +14 -1 lines
Diff to previous 1.88 (colored)

Add support for "constraints": when configured, ntpd(8) will query the
time from HTTPS servers, by parsing the Date: header, and use the
median constraint time as a boundary to verify NTP responses.  This
adds some level of authentication and protection against MITM attacks
while preserving the accuracy of the NTP protocol; without relying on
authentication options for NTP that are basically unavailable at
present.  This is an initial implementation and the semantics will be
improved once it is in the tree.

Discussed with deraadt@ and henning@
OK henning@

Revision 1.88 / (download) - annotate - [select for diffs], Wed Jan 21 03:14:10 2015 UTC (9 years, 4 months ago) by bcook
Branch: MAIN
Changes since 1.87: +3 -3 lines
Diff to previous 1.87 (colored)

Fix deferred host DNS lookups.

If the network is unreachable when ntpd starts and host_dns fails, be sure
that we still close the HOST_DNS imsg.

Thanks to Paul de Weerd <weerd at weirdnet dot nl> for reporting this.

ok beck@

Revision 1.87 / (download) - annotate - [select for diffs], Mon Jan 19 20:47:03 2015 UTC (9 years, 4 months ago) by bcook
Branch: MAIN
Changes since 1.86: +4 -5 lines
Diff to previous 1.86 (colored)

Use initial assignment of action to check for errors.

This simplifies things and make action = -1 no longer a dead store.

Also, spell FALLTHROUGH consistently.

reported by fritjof@alokat.org

Revision 1.86 / (download) - annotate - [select for diffs], Wed Jan 14 21:14:27 2015 UTC (9 years, 4 months ago) by naddy
Branch: MAIN
Changes since 1.85: +5 -4 lines
Diff to previous 1.85 (colored)

Switch drift file format to ppm for compatibility with the ntp.org
daemon.

Old drift files will be interpreted as a minuscule adjustment and
ntpd will proceed to rediscover the drift, like starting from zero
on a newly installed machine.

ok deraadt@

Revision 1.85 / (download) - annotate - [select for diffs], Tue Jan 13 14:52:47 2015 UTC (9 years, 4 months ago) by bcook
Branch: MAIN
Changes since 1.84: +2 -2 lines
Diff to previous 1.84 (colored)

bump failure to set the initial time from debug to warning

from Paul B. Henson, ok phessler@

Revision 1.84 / (download) - annotate - [select for diffs], Tue Jan 13 02:28:56 2015 UTC (9 years, 4 months ago) by bcook
Branch: MAIN
Changes since 1.83: +15 -8 lines
Diff to previous 1.83 (colored)

fix some memory leaks in dns handling.

 - Nothing seems to free the result of host_dns(), so add host_dns_free() and
   call after each query.
 - If imsg_add() fails, it frees buf. Avoid subsequently dereferencing the
   freed buf in imsg_close().

ok millert@ deraadt@

Revision 1.83 / (download) - annotate - [select for diffs], Fri Jan 9 07:35:37 2015 UTC (9 years, 5 months ago) by deraadt
Branch: MAIN
Changes since 1.82: +2 -2 lines
Diff to previous 1.82 (colored)

remove excessive/wrong use of sys/param.h
peanuts -- but all work has to start somewhere.

Revision 1.82 / (download) - annotate - [select for diffs], Thu Jan 8 00:30:08 2015 UTC (9 years, 5 months ago) by bcook
Branch: MAIN
Changes since 1.81: +3 -3 lines
Diff to previous 1.81 (colored)

sync log.c from smtpd.

Reduces the number of log.c snowflakes by a little, and gives ntpd a
variadic fatal() function to be used later.

ok deraadt@

Revision 1.81 / (download) - annotate - [select for diffs], Sun Jan 4 01:24:43 2015 UTC (9 years, 5 months ago) by bcook
Branch: MAIN
Changes since 1.80: +7 -7 lines
Diff to previous 1.80 (colored)

rename sockaddr_un variables from 'sun' to the more common 'sa'.

This avoids a namespace conflict with Solaris build environments.

discussed with deraadt@ and kettenis@

Revision 1.80 / (download) - annotate - [select for diffs], Sun Jan 4 01:11:24 2015 UTC (9 years, 5 months ago) by bcook
Branch: MAIN
Changes since 1.79: +2 -1 lines
Diff to previous 1.79 (colored)

Add a missing include for time.h to get the definitions of clock_gettime and strftime.

ok jsing@ phessler@ naddy@

Revision 1.79 / (download) - annotate - [select for diffs], Mon Feb 10 09:12:34 2014 UTC (10 years, 3 months ago) by dtucker
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.78: +5 -1 lines
Diff to previous 1.78 (colored)

Run the serving and privileged ntpd processes at high priority and the
dns process at normal priority.  Should improve latency on loaded machines.
ok henning@

Revision 1.78 / (download) - annotate - [select for diffs], Tue Jan 28 22:57:37 2014 UTC (10 years, 4 months ago) by sthen
Branch: MAIN
Changes since 1.77: +2 -2 lines
Diff to previous 1.77 (colored)

typo in errx() string

Revision 1.77 / (download) - annotate - [select for diffs], Wed Jan 22 02:55:15 2014 UTC (10 years, 4 months ago) by benno
Branch: MAIN
Changes since 1.76: +43 -15 lines
Diff to previous 1.76 (colored)

allow -s<abrev> in addition to -s <word> in ntpctl commandline, like
all the other tools do. changes option 'sensors' to 'Sensors'.
ok henning@, and grudgingly phessler@

Revision 1.76 / (download) - annotate - [select for diffs], Fri Jan 10 22:54:12 2014 UTC (10 years, 4 months ago) by deraadt
Branch: MAIN
Changes since 1.75: +2 -2 lines
Diff to previous 1.75 (colored)

improve ntpctl usage so that the manual page does not need to be read
every time
ok jmc

Revision 1.75 / (download) - annotate - [select for diffs], Wed Nov 13 20:44:39 2013 UTC (10 years, 6 months ago) by benno
Branch: MAIN
Changes since 1.74: +3 -3 lines
Diff to previous 1.74 (colored)

from sthen: handle msgbuf_write() returning EAGAIN

ok krw

Revision 1.74 / (download) - annotate - [select for diffs], Wed Oct 16 21:23:59 2013 UTC (10 years, 7 months ago) by jmc
Branch: MAIN
Changes since 1.73: +2 -2 lines
Diff to previous 1.73 (colored)

tidy up the "modifier" list a little and sync usage();

NB: this utility has only one option, and it's not optional! i haven;t
marked -s as being mandatory, since hopefully someone will make
ntpctl run without arguments do something useful;

Revision 1.73 / (download) - annotate - [select for diffs], Fri Oct 11 19:33:20 2013 UTC (10 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.72: +4 -5 lines
Diff to previous 1.72 (colored)

improve ntpctl argv parsing

Revision 1.72 / (download) - annotate - [select for diffs], Wed Oct 9 12:34:12 2013 UTC (10 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.71: +5 -5 lines
Diff to previous 1.71 (colored)

shorten output; ok henning phessler

Revision 1.71 / (download) - annotate - [select for diffs], Fri Oct 4 20:30:38 2013 UTC (10 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.70: +11 -12 lines
Diff to previous 1.70 (colored)

Tweak previous:
* For time_t values, use the printf("%lld", (long long)t) idiom.
* Don't print "Invalid program name" in usage() when main() just runs ntpd.
* Make "Show/Shows" consistent in the manual, sort .Xr and correct .Ox.
OK phessler@

Revision 1.70 / (download) - annotate - [select for diffs], Fri Oct 4 14:28:16 2013 UTC (10 years, 8 months ago) by phessler
Branch: MAIN
Changes since 1.69: +312 -4 lines
Diff to previous 1.69 (colored)

Add ntpctl(8), which allows us to query the locally running ntpd(8) process

diff from Mike Miller <mmiller mgm51 com> (many thanks!)

OK phessler@, henning@, todd@

Revision 1.69 / (download) - annotate - [select for diffs], Sat Mar 19 23:40:11 2011 UTC (13 years, 2 months ago) by okan
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.68: +2 -3 lines
Diff to previous 1.68 (colored)

use timerclear macro

ok henning@

Revision 1.68 / (download) - annotate - [select for diffs], Thu Jul 1 22:16:20 2010 UTC (13 years, 11 months ago) by eric
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.67: +1 -3 lines
Diff to previous 1.67 (colored)

don't need to setup the resolver early now that dns lookups are done
by the dns engine.

ok henning@

Revision 1.67 / (download) - annotate - [select for diffs], Wed May 26 13:56:08 2010 UTC (14 years ago) by nicm
Branch: MAIN
Changes since 1.66: +2 -2 lines
Diff to previous 1.66 (colored)

Rename some imsg bits to make namespace collisions less likely buf to
ibuf, buf_read to ibuf_read, READ_BUF_SIZE to IBUF_READ_SIZE.

ok henning gilles claudio jacekm deraadt

Revision 1.66 / (download) - annotate - [select for diffs], Sat Jun 6 18:14:25 2009 UTC (15 years ago) by pyr
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7, OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.65: +3 -2 lines
Diff to previous 1.65 (colored)

make ntpd imsg-in-a-lib ready as well. extensive testing done, no
behavior change.
ok eric@

Revision 1.65 / (download) - annotate - [select for diffs], Mon Jun 1 23:21:09 2009 UTC (15 years ago) by henning
Branch: MAIN
Changes since 1.64: +1 -3 lines
Diff to previous 1.64 (colored)

no we don't need endpwent
i remember we already had the confusion and bgpd doesn't have the endpwent

Revision 1.64 / (download) - annotate - [select for diffs], Tue Feb 10 16:52:09 2009 UTC (15 years, 4 months ago) by stevesk
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.63: +14 -5 lines
Diff to previous 1.63 (colored)

log tiny frequency adjustments at debug only.
ok henning@, 'I think I agree' otto@

Revision 1.63 / (download) - annotate - [select for diffs], Fri Feb 6 21:48:00 2009 UTC (15 years, 4 months ago) by stevesk
Branch: MAIN
Changes since 1.62: +3 -3 lines
Diff to previous 1.62 (colored)

rename a #define to be clearer; no binary change
ok henning@

Revision 1.62 / (download) - annotate - [select for diffs], Thu Jan 29 00:06:04 2009 UTC (15 years, 4 months ago) by stevesk
Branch: MAIN
Changes since 1.61: +3 -1 lines
Diff to previous 1.61 (colored)

log warning when can't read drift file; allows detection of
corrupt contents. ok henning@

Revision 1.61 / (download) - annotate - [select for diffs], Sat Jul 19 21:31:39 2008 UTC (15 years, 10 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4
Changes since 1.60: +7 -9 lines
Diff to previous 1.60 (colored)

Use errx instead of fprintf, exit combo.
Diff from Gleydson Soares gsoares (at) gmail (dot) com
OK henning@

Revision 1.60 / (download) - annotate - [select for diffs], Fri May 16 06:13:25 2008 UTC (16 years ago) by ckuethe
Branch: MAIN
Changes since 1.59: +1 -5 lines
Diff to previous 1.59 (colored)

Allow ntpd to step the time at startup, now matter how large or small the
offset. The 180s limit doesn't help very much these days.
ok otto@ mbalmer@

Revision 1.59 / (download) - annotate - [select for diffs], Wed May 14 09:32:18 2008 UTC (16 years ago) by pyr
Branch: MAIN
Changes since 1.58: +6 -1 lines
Diff to previous 1.58 (colored)

ntpd missed the argument check sweep.

Revision 1.58 / (download) - annotate - [select for diffs], Mon Dec 31 17:21:35 2007 UTC (16 years, 5 months ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_4_3_BASE, OPENBSD_4_3
Changes since 1.57: +4 -2 lines
Diff to previous 1.57 (colored)

we must reset the poll timeout to INFTIM when receiving the IMSG_SETTIME
because otherwise the poll timeout will stay at SETTIME_TIMEOUT (15s)
forever unless we time out waiting for the first reply with -s
spotted by Aaron Riekenberg <aaron.riekenberg@gmail.com>

Revision 1.57 / (download) - annotate - [select for diffs], Sun Dec 23 22:40:00 2007 UTC (16 years, 5 months ago) by stevesk
Branch: MAIN
Changes since 1.56: +24 -9 lines
Diff to previous 1.56 (colored)

log a warning one time when we can't open or write the drift file;
also add "(no drift file)" to the adjfreq log message on failure;
ok henning@

Revision 1.56 / (download) - annotate - [select for diffs], Sat Dec 22 18:26:21 2007 UTC (16 years, 5 months ago) by stevesk
Branch: MAIN
Changes since 1.55: +4 -3 lines
Diff to previous 1.55 (colored)

just call getpwnam(NTPD_USER) once; ok henning@

Revision 1.55 / (download) - annotate - [select for diffs], Tue Dec 4 14:52:54 2007 UTC (16 years, 6 months ago) by fgsch
Branch: MAIN
Changes since 1.54: +0 -2 lines
Diff to previous 1.54 (colored)

revert SIGQUIT catching; requested by deraadt

Revision 1.54 / (download) - annotate - [select for diffs], Tue Dec 4 11:06:49 2007 UTC (16 years, 6 months ago) by fgsch
Branch: MAIN
Changes since 1.53: +3 -1 lines
Diff to previous 1.53 (colored)

catch SIGQUIT too. ckuethe@ and henning@ ok.

Revision 1.53 / (download) - annotate - [select for diffs], Thu Nov 22 10:22:30 2007 UTC (16 years, 6 months ago) by otto
Branch: MAIN
Changes since 1.52: +14 -12 lines
Diff to previous 1.52 (colored)

if the drift file is missing, reset adjfreq to zero; iirc diff from Glaser
from a long time ago. ok ckuethe@

Revision 1.52 / (download) - annotate - [select for diffs], Thu Sep 13 20:34:12 2007 UTC (16 years, 8 months ago) by jmc
Branch: MAIN
Changes since 1.51: +2 -2 lines
Diff to previous 1.51 (colored)

add -n to usage();

Revision 1.51 / (download) - annotate - [select for diffs], Thu Sep 13 14:34:36 2007 UTC (16 years, 8 months ago) by pyr
Branch: MAIN
Changes since 1.50: +10 -2 lines
Diff to previous 1.50 (colored)

Provide the -n switch like in the other imsg daemons for testing
the configuration file.
"yes please, ok" henning@

Revision 1.50 / (download) - annotate - [select for diffs], Wed Aug 22 21:04:30 2007 UTC (16 years, 9 months ago) by ckuethe
Branch: MAIN
Changes since 1.49: +7 -3 lines
Diff to previous 1.49 (colored)

Allow ntpd to log sensor offsets and adjtime calls to syslog at LOG_DEBUG
priority.
ok gwk, mbalmer, weingart
"explicit non-ok from" henning

Revision 1.49 / (download) - annotate - [select for diffs], Mon Jan 15 08:19:11 2007 UTC (17 years, 4 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_4_2_BASE, OPENBSD_4_2, OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.48: +21 -21 lines
Diff to previous 1.48 (colored)

Although Unix compilers accept more than one definition of a global
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@

Revision 1.48 / (download) - annotate - [select for diffs], Fri Jun 30 16:52:13 2006 UTC (17 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.47: +4 -4 lines
Diff to previous 1.47 (colored)

spaces

Revision 1.47 / (download) - annotate - [select for diffs], Fri Jun 30 06:39:00 2006 UTC (17 years, 11 months ago) by otto
Branch: MAIN
Changes since 1.46: +8 -7 lines
Diff to previous 1.46 (colored)

don't write anything to log until we are daemonized. spotted by
david@; ok henning@

Revision 1.46 / (download) - annotate - [select for diffs], Mon Jun 26 08:10:45 2006 UTC (17 years, 11 months ago) by otto
Branch: MAIN
Changes since 1.45: +14 -1 lines
Diff to previous 1.45 (colored)

Reset adjtime() on startup; having an adjtime() active while starting
up causes overcompensation and confusing debug log entries; noticed
by dtucker@

Revision 1.45 / (download) - annotate - [select for diffs], Thu Jun 22 11:11:25 2006 UTC (17 years, 11 months ago) by otto
Branch: MAIN
Changes since 1.44: +45 -1 lines
Diff to previous 1.44 (colored)

Save the computed clock drift and use it on startup. ok deraadt@
henning@

Revision 1.44 / (download) - annotate - [select for diffs], Wed Jun 21 07:42:00 2006 UTC (17 years, 11 months ago) by otto
Branch: MAIN
Changes since 1.43: +2 -2 lines
Diff to previous 1.43 (colored)

avoid a race by installing SIGCHLD handler before fork() is called.
ok henning@ ckuethe@

Revision 1.43 / (download) - annotate - [select for diffs], Sat Jun 17 18:40:42 2006 UTC (17 years, 11 months ago) by otto
Branch: MAIN
Changes since 1.42: +30 -1 lines
Diff to previous 1.42 (colored)

Import frequency conrrection code from dragonfly, whith some changes:
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@

Revision 1.42 / (download) - annotate - [select for diffs], Wed Jun 7 06:29:03 2006 UTC (18 years ago) by otto
Branch: MAIN
Changes since 1.41: +2 -1 lines
Diff to previous 1.41 (colored)

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@

Revision 1.41 / (download) - annotate - [select for diffs], Tue Feb 21 23:47:00 2006 UTC (18 years, 3 months ago) by stevesk
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.40: +3 -2 lines
Diff to previous 1.40 (colored)

handle -1 return from host_dns(); ok henning@

Revision 1.40 / (download) - annotate - [select for diffs], Tue Sep 6 21:27:10 2005 UTC (18 years, 9 months ago) by wvdputte
Branch: MAIN
Changes since 1.39: +2 -2 lines
Diff to previous 1.39 (colored)

when running ntpd with "-s" as it's argument from /etc/rc.conf, make sure the
output goes to syslog and not console by moving around log_init

OK henning@, markus@ and mblamer@

Revision 1.39 / (download) - annotate - [select for diffs], Mon Jul 11 08:08:06 2005 UTC (18 years, 11 months ago) by dtucker
Branch: MAIN
CVS Tags: OPENBSD_3_8_BASE, OPENBSD_3_8
Changes since 1.38: +7 -4 lines
Diff to previous 1.38 (colored)

More descriptive error if a signal causes the child to exit; ok henning@

Revision 1.38 / (download) - annotate - [select for diffs], Sun Jun 19 17:11:13 2005 UTC (18 years, 11 months ago) by henning
Branch: MAIN
Changes since 1.37: +4 -4 lines
Diff to previous 1.37 (colored)

use a #define for the time to wait on -s and clarify a log msg

Revision 1.37 / (download) - annotate - [select for diffs], Sun Jun 19 16:42:57 2005 UTC (18 years, 11 months ago) by henning
Branch: MAIN
Changes since 1.36: +11 -11 lines
Diff to previous 1.36 (colored)

use a little state engine to keep track of delayed dns lookups and such,
eases things
tested by Jason Ackley <jason@ackley.net> Matthias Kilian
<kili@outback.escape.de> Stephen Marley <stephen@marley.org.uk> sturm@
theo ok

Revision 1.36 / (download) - annotate - [select for diffs], Thu May 26 09:13:06 2005 UTC (19 years ago) by dtucker
Branch: MAIN
Changes since 1.35: +13 -6 lines
Diff to previous 1.35 (colored)

Ensure previous adjust has completed before clearing alarm flag; ok henning@

Revision 1.35 / (download) - annotate - [select for diffs], Mon Apr 18 20:46:02 2005 UTC (19 years, 1 month ago) by henning
Branch: MAIN
Changes since 1.34: +6 -2 lines
Diff to previous 1.34 (colored)

extra paranoia, from a discussion with joerg

Revision 1.34 / (download) - annotate - [select for diffs], Thu Mar 31 17:02:43 2005 UTC (19 years, 2 months ago) by henning
Branch: MAIN
Changes since 1.33: +1 -3 lines
Diff to previous 1.33 (colored)

zap includes, grunk

Revision 1.33 / (download) - annotate - [select for diffs], Thu Mar 24 10:56:22 2005 UTC (19 years, 2 months ago) by henning
Branch: MAIN
Changes since 1.32: +4 -4 lines
Diff to previous 1.32 (colored)

fatal vs fatalx, Alexander von Gernler

Revision 1.32 / (download) - annotate - [select for diffs], Sun Mar 13 10:06:27 2005 UTC (19 years, 3 months ago) by dtucker
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.31: +11 -9 lines
Diff to previous 1.31 (colored)

Fixes in ntpd_settime (ie ntpd -s):
- Handle errors from syscalls better
- Prevent curtime.tv_usec from being negative for negative offsets.
- Don't claim to have done settimeofday if it fails.
ok henning@

Revision 1.31 / (download) - annotate - [select for diffs], Wed Mar 9 20:31:11 2005 UTC (19 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.30: +3 -1 lines
Diff to previous 1.30 (colored)

nasty: host_dns used to run before forking and chrooting etc, so it was
guaranteed that its res_init() call was done once before fork etc...
that is no longer the case. call res_init() in main() early.

Revision 1.30 / (download) - annotate - [select for diffs], Tue Mar 8 14:28:55 2005 UTC (19 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.29: +3 -3 lines
Diff to previous 1.29 (colored)

from the "shut the fuck up, ntpd" department:
move log_debug call to tell about skipping the settime due to lack of
answers down slightly below the 2nd (and final) log_init call so it becomes
a -d only thing. tested by dlg and me

Revision 1.29 / (download) - annotate - [select for diffs], Wed Feb 2 18:52:32 2005 UTC (19 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.28: +9 -9 lines
Diff to previous 1.28 (colored)

usage() is __dead
pt out by Alexander v Gernler

Revision 1.28 / (download) - annotate - [select for diffs], Fri Jan 28 12:32:24 2005 UTC (19 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.27: +8 -5 lines
Diff to previous 1.27 (colored)

fatal() if daemon() fails, Alexander von Gernler <grunk@pestilenz.org>

Revision 1.27 / (download) - annotate - [select for diffs], Wed Dec 22 16:04:11 2004 UTC (19 years, 5 months ago) by henning
Branch: MAIN
Changes since 1.26: +3 -2 lines
Diff to previous 1.26 (colored)

d can be negative, take that into account when comparing to the logging
threshold. spotted by Constantine Murenin <mureninc@gmail.com>, mickey ok

Revision 1.26 / (download) - annotate - [select for diffs], Mon Dec 20 15:10:05 2004 UTC (19 years, 5 months ago) by moritz
Branch: MAIN
Changes since 1.25: +3 -3 lines
Diff to previous 1.25 (colored)

some typos in log messages.

ok henning@

Revision 1.25 / (download) - annotate - [select for diffs], Mon Dec 6 20:57:17 2004 UTC (19 years, 6 months ago) by mickey
Branch: MAIN
Changes since 1.24: +5 -2 lines
Diff to previous 1.24 (colored)

do not log tiny local clock drifts; w/ help from Joerg Sonnenberger <joerg@britannica.bec.de>; henning@ ok

Revision 1.24 / (download) - annotate - [select for diffs], Wed Nov 10 11:27:54 2004 UTC (19 years, 7 months ago) by henning
Branch: MAIN
Changes since 1.23: +2 -2 lines
Diff to previous 1.23 (colored)

const'ify conffile
From: Joerg Sonnenberger <joerg@britannica.bec.de>

Revision 1.23 / (download) - annotate - [select for diffs], Thu Nov 4 23:04:22 2004 UTC (19 years, 7 months ago) by henning
Branch: MAIN
Changes since 1.22: +2 -2 lines
Diff to previous 1.22 (colored)

use SIG_DFL instead of SIG_IGN when we are not interested in SIG_CHILD
anymore, same thing for us and it makes darren's life easier for the
portable

Revision 1.22 / (download) - annotate - [select for diffs], Thu Sep 23 01:53:07 2004 UTC (19 years, 8 months ago) by henning
Branch: MAIN
Changes since 1.21: +4 -2 lines
Diff to previous 1.21 (colored)

reset chld_pid to 0 when acting upon a SIGCHLD so we don't try to send it
a kill then - tiny possible race there
pointed out by Brian Poole <raj@cerias.purdue.edu>

Revision 1.21 / (download) - annotate - [select for diffs], Sat Sep 18 23:21:35 2004 UTC (19 years, 8 months ago) by henning
Branch: MAIN
Changes since 1.20: +2 -2 lines
Diff to previous 1.20 (colored)

jmc says S before s and not s before S, sssssssso we do.

Revision 1.20 / (download) - annotate - [select for diffs], Sat Sep 18 20:37:12 2004 UTC (19 years, 8 months ago) by henning
Branch: MAIN
Changes since 1.19: +6 -3 lines
Diff to previous 1.19 (colored)

implement -S to override earlier -s, requested by theo

Revision 1.19 / (download) - annotate - [select for diffs], Sat Sep 18 20:27:57 2004 UTC (19 years, 8 months ago) by henning
Branch: MAIN
Changes since 1.18: +5 -1 lines
Diff to previous 1.18 (colored)

don't call settimeofday() when the offset is smaller than 180 seconds,
adjtime() will fix that fast enough, from discussion in theo's living room
ok mcbride beck

Revision 1.18 / (download) - annotate - [select for diffs], Sat Sep 18 20:01:38 2004 UTC (19 years, 8 months ago) by henning
Branch: MAIN
Changes since 1.17: +66 -14 lines
Diff to previous 1.17 (colored)

add a new -s option, that tells ntpd to set the time using settimeofday()
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

Revision 1.17 / (download) - annotate - [select for diffs], Wed Sep 15 19:21:25 2004 UTC (19 years, 8 months ago) by henning
Branch: MAIN
Changes since 1.16: +2 -2 lines
Diff to previous 1.16 (colored)

imsg framework cleanup:
-kill the _pid flavors of imsg_create and imsg_compose, and just add pid as
argument to those
-use imsg_create in imsg_compose instead of duplicating code
-check for datalen overflow

Revision 1.16 / (download) - annotate - [select for diffs], Wed Sep 15 19:14:11 2004 UTC (19 years, 8 months ago) by henning
Branch: MAIN
Changes since 1.15: +17 -13 lines
Diff to previous 1.15 (colored)

malloc the imsg buffers instead of having them statically, suggested by
micsky some time ago, ok otto

Revision 1.15 / (download) - annotate - [select for diffs], Wed Sep 15 00:08:06 2004 UTC (19 years, 8 months ago) by henning
Branch: MAIN
Changes since 1.14: +1 -2 lines
Diff to previous 1.14 (colored)

unused variables, theo

Revision 1.14 / (download) - annotate - [select for diffs], Thu Aug 12 16:33:59 2004 UTC (19 years, 10 months ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.13: +22 -2 lines
Diff to previous 1.13 (colored)

do not try to getaddrinfo() in the unprivileged process, send an imsg
asking the privileged one to do it. sends back an imsg with the
resulting addresses in a bunch of struct sockaddr_storage in the data
part.
this should fix all remaining issues with dns (non-)availability at
ntpd startup, be it due to named on localhost or something else.
tested by marco@ and Chris Paul <chris.paul@sentinare.com>

Revision 1.13 / (download) - annotate - [select for diffs], Tue Jul 13 11:16:22 2004 UTC (19 years, 11 months ago) by henning
Branch: MAIN
Changes since 1.12: +3 -3 lines
Diff to previous 1.12 (colored)

liek bgpd, use a socketpair(2) instead of a pipe(2)

Revision 1.12 / (download) - annotate - [select for diffs], Mon Jul 12 09:38:57 2004 UTC (19 years, 11 months ago) by dtucker
Branch: MAIN
Changes since 1.11: +3 -3 lines
Diff to previous 1.11 (colored)

Add missing newlines

Revision 1.11 / (download) - annotate - [select for diffs], Mon Jul 12 09:22:38 2004 UTC (19 years, 11 months ago) by dtucker
Branch: MAIN
Changes since 1.10: +9 -6 lines
Diff to previous 1.10 (colored)

Replace errx with equivalent fprintf+exit to make porting easier; ok henning@

Revision 1.10 / (download) - annotate - [select for diffs], Fri Jul 9 15:08:54 2004 UTC (19 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.9: +1 -3 lines
Diff to previous 1.9 (colored)

too chatty; ok henning

Revision 1.9 / (download) - annotate - [select for diffs], Fri Jul 9 11:34:11 2004 UTC (19 years, 11 months ago) by henning
Branch: MAIN
Changes since 1.8: +1 -14 lines
Diff to previous 1.8 (colored)

remove leftover pieces of on-the-fly reconfig shitz that made ntpd exit on
SIGHUP, noticed by otto

Revision 1.8 / (download) - annotate - [select for diffs], Thu Jul 8 15:06:43 2004 UTC (19 years, 11 months ago) by henning
Branch: MAIN
Changes since 1.7: +1 -3 lines
Diff to previous 1.7 (colored)

kill traces of on-the-fly reconfigure (from bgpd), not needed in ntpd

Revision 1.7 / (download) - annotate - [select for diffs], Wed Jul 7 06:57:13 2004 UTC (19 years, 11 months ago) by henning
Branch: MAIN
Changes since 1.6: +2 -2 lines
Diff to previous 1.6 (colored)

don't log every single reply we receive and log local clock adjustemt nicer

Revision 1.6 / (download) - annotate - [select for diffs], Mon Jul 5 07:46:16 2004 UTC (19 years, 11 months ago) by henning
Branch: MAIN
Changes since 1.5: +19 -1 lines
Diff to previous 1.5 (colored)

calculate the median offset from all servers we sync to and call
adjtime() when necessary to keep the local clock in sync
yes, that means ntpd syncs the local clock now.

Revision 1.5 / (download) - annotate - [select for diffs], Thu Jun 17 19:17:48 2004 UTC (19 years, 11 months ago) by henning
Branch: MAIN
Changes since 1.4: +2 -1 lines
Diff to previous 1.4 (colored)

provide most of the client functionality.
hook the descriptors into the main poll and such.
we're not doing anything with the reply we recive yet, tho.

mostly hacked on the Frankfurt->Montreal flight, as batteries and those
horrible air canada seats permitted...

Revision 1.4 / (download) - annotate - [select for diffs], Tue Jun 1 21:58:08 2004 UTC (20 years ago) by henning
Branch: MAIN
Changes since 1.3: +4 -1 lines
Diff to previous 1.3 (colored)

first cut at config file parser
for now, one can set the addresses to listen on

Revision 1.3 / (download) - annotate - [select for diffs], Tue Jun 1 16:27:09 2004 UTC (20 years ago) by henning
Branch: MAIN
Changes since 1.2: +6 -2 lines
Diff to previous 1.2 (colored)

allow ntpd to listen on nearly arbitary number of sockets (OPEN_MAX - 1 atm).
default to one IPv4 wildcard and one IPv6 wildcard one.

Revision 1.2 / (download) - annotate - [select for diffs], Mon May 31 13:55:31 2004 UTC (20 years ago) by henning
Branch: MAIN
Changes since 1.1: +2 -2 lines
Diff to previous 1.1 (colored)

fix usage()

Revision 1.1 / (download) - annotate - [select for diffs], Mon May 31 13:46:16 2004 UTC (20 years ago) by henning
Branch: MAIN

initial cut at ntpd.
it is just capable of answering (s)ntp4 requests with the local time
for now.
imsg/buffer and logging framework from bgpd, ntp protocol hackery
with Alexander Guy

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.