Commit Graph

273 Commits

Author SHA1 Message Date
roy 9a2df3ff00 Do not try to bind to un-useable IPv6 addresses. 2014-01-17 17:25:47 +00:00
apb bebb9d5ca8 For MKREPRO, instead of using __DATE__ and __TIME__
in ntp_calendar.c::ntpcal_get_build_date(), use a date/time
extracted from the importdate file.
2014-01-15 14:40:30 +00:00
apb b7f6cc1193 If the "importdate" file exists, do not embed the date/time/build number
in the generated version.  This logic was present in an earlier revision
of this file, but was lost in CVS revision 1.3 dated 2013-12-28.

Add a comment to make it less likely that this code is lost again.
2014-01-15 12:58:23 +00:00
joerg b3199998db Fix format strings. 2014-01-07 02:10:49 +00:00
kardel eaac9e3d28 - add new clk_sel240x.c 2014-01-05 15:47:23 +00:00
kardel 3e56dcea0a - enable the rest of the PARSE clocks (missed config option when merging) 2014-01-05 15:39:13 +00:00
kardel ca3d18325a - enable PARSE clocks (missed config option when merging)
- remove all conflict markers/finish merge in refclock_parse.c:1.10
2014-01-05 15:13:36 +00:00
joerg ba1a5140ab Don't bother with the h (short) modifier. The predicated use of bswap16
confuses the type tracking in clang and the use here is not portable
anyway, since it assumes short == int16_t.
2014-01-03 20:26:45 +00:00
joerg 30b2999ac3 Update warning flags to reflect the fixes. Restrict GCC flags to GCC. 2014-01-02 21:38:38 +00:00
joerg f4afb4e801 Don't pass in a format string, but flags for using %f / %g and the
desired precision. Allows format string verification to work correctly.
2014-01-02 21:37:00 +00:00
joerg 1a12c81543 Add format string attribute for better detection. 2014-01-02 21:35:50 +00:00
joerg f7fd78b752 Avoid pointer operations on the format string. 2014-01-02 21:35:19 +00:00
joerg 8531f75b5e Use separate variables for the format strings to get working format
string checking with both GCC and Clang.
2014-01-02 18:26:03 +00:00
christos f69b3e7990 fd == 0 is a valid descriptor! 2014-01-01 19:52:58 +00:00
pgoyette afa6e1a420 Remove duplicate/old declaration of 'host' now that we allocate it on stack. 2013-12-31 21:37:01 +00:00
christos 02a7f722be pointless to call alloca for a 1K path string... Just allocate it on the stack! 2013-12-31 20:56:29 +00:00
christos 08f2fa820a - regen using byacc.
Now that we can generate the parser files we yacc, we could create a tool
keyword-gen so that we can generate all the files on the fly. It is not worth
it though.
2013-12-30 19:06:45 +00:00
christos 31c4e4c2ef find ntp_scanner.h 2013-12-30 17:48:13 +00:00
christos 1aa1a11e17 regen 2013-12-30 17:45:40 +00:00
christos a04a202dbc put back mdstries 2013-12-30 17:42:19 +00:00
christos 382061577d prevent coredumps from syntax errors in the config file causing negative
include indexes
2013-12-30 17:41:57 +00:00
christos 4c05c4493f remove unused variables 2013-12-30 01:34:22 +00:00
christos a05b8588f7 Handle ancient vax gcc. 2013-12-29 03:32:00 +00:00
christos 6bb3b8411a not all characters are born signed. 2013-12-29 03:26:07 +00:00
christos 6a493d6bc6 Some html files were removed 2013-12-28 18:06:41 +00:00
christos 966c0b1b14 32 bit build fixes. 2013-12-28 17:00:50 +00:00
mrg d3f9e78087 remove (void *) casts when passing const pointers to a const void *
taking function.  ...
2013-12-28 13:27:39 +00:00
christos 94d1f47f5e adjust for non-amd64 build 2013-12-28 03:51:52 +00:00
christos 2073dae78f update mkver 2013-12-28 03:36:15 +00:00
christos 3683443505 mention manual handling of man pages 2013-12-28 03:29:46 +00:00
christos 2950cc38ef resolve conflicts 2013-12-28 03:20:12 +00:00
christos bab87fff35 adjust for new ntp and add the generated man pages 2013-12-28 03:19:43 +00:00
christos 8585484ef8 import devel ntpd to avoid amplification attacks. 2013-12-27 23:30:11 +00:00
christos eeceecfe62 fix unused variable warnings 2013-10-20 02:47:38 +00:00
joerg 3657cb7f1d Update LLVM/Clang snapshot to r191105. This brings in a better detection
of unused static variables and functions. Disable this for some external
code and for ioconf.c in the kernel.
2013-09-21 22:28:12 +00:00
njoly 856537a70d Use mdoc macro for literal block display. 2012-11-14 08:26:29 +00:00
kardel 6d4483818f re-enable broadcast client config after interface re-scanning
make broadcast transmission work again
2012-08-17 22:37:26 +00:00
christos 0f892d675b add cast. 2012-08-12 07:22:24 +00:00
christos 97b3f8422e - make the append function to not append past the end of the string
- use the append function some more
2012-08-12 06:16:51 +00:00
kardel b3d86d3e3a fix some fallout from append correction 2012-08-11 20:09:08 +00:00
christos 9bfa795a77 Homogenize all strn{cpy,cat} and snprintf() to a single append function to
prevent incorrect usage and buffer overflow.
2012-08-10 08:22:49 +00:00
joerg ab7e24ab4b Disable warning about broken strncat usage from clang for now.
The code is technically not going to overflow, but completely messed up.
2012-08-09 14:40:52 +00:00
jnemeth 98f55161d5 PR/46612 - Lloyd Parkes -- add a terminating newline to error messages 2012-06-25 20:23:43 +00:00
christos 720edde670 fix printf format. 2012-02-09 17:53:56 +00:00
christos b8867d0ef6 There is no point in creating an entry point for emalloc(), when all the other
functions are just defined in terms of ereallocz(). Fixes the sun2 build
because it avoids the conflict with emalloc() from libutil.
2012-02-04 16:31:02 +00:00
he dedd1c6538 Re-define emalloc(arg) to ntp_emalloc(arg), so that this can be linked
statically on NetBSD as well, since emalloc() conflicts with the entry
on our -lutil.
2012-02-04 14:56:58 +00:00
christos 5744870aac cleanup compilation (not TRT, but the expedient way) 2012-02-03 21:36:40 +00:00
christos 26053bd797 don't bother with ifdef's, just grab the biggest type you can. 2012-02-03 21:35:55 +00:00
christos 6a250e03e2 cleanup last warnings, and remove local warnings overrides. 2012-02-03 16:33:10 +00:00
christos 0c82c01637 using 2 casts to fix an unsigned-signed comparison is a sign that this it
is done incorrectly. The RHS is guaranteed positive at this point so cast
it to unsigned to match the LHS.
2012-02-03 14:36:51 +00:00
kardel 2bc1b7bd9a Clang compile fix from Joerg Sonneberger approved by releng. 2012-02-03 10:20:29 +00:00
kardel 2f3ccb499e cleanup printf fmt differences between i386/amd64 2012-02-01 22:48:15 +00:00
kardel 617a40a056 use WARNS=0 until const issue is resolved 2012-02-01 21:22:19 +00:00
kardel 9b98de2bc5 initialize min_dist 2012-02-01 21:21:25 +00:00
kardel cb314bfae7 build libopts with WARNS=0 for now 2012-02-01 20:49:09 +00:00
kardel a2545411b3 back to WARNS=4 (constify and signedness corrections) 2012-02-01 20:48:01 +00:00
kardel f6ba422c0a bin/45906: regenerate ntpd/ntp_keyword.h to accommodate our changes 2012-02-01 13:01:29 +00:00
kardel 10c9c4f431 add libotps for autoopts headers to CPPFLAGS 2012-02-01 08:15:21 +00:00
kardel 51c5c0eb79 NTP 4.2.6p5 (Harlan Stenn <stenn@ntp.org>, 2011/12/24)
Focus: Bug fixes

Severity: Medium

This is a recommended upgrade.

This release updates sys_rootdisp and sys_jitter calculations to match the
RFC specification, fixes a potential IPv6 address matching error for the
"nic" and "interface" configuration directives, suppresses the creation of
extraneous ephemeral associations for certain broadcastclient and
multicastclient configurations, cleans up some ntpq display issues, and
includes improvements to orphan mode, minor bugs fixes and code clean-ups.

New features / changes in this release:

ntpd

 * Updated "nic" and "interface" IPv6 address handling to prevent
   mismatches with localhost [::1] and wildcard [::] which resulted from
   using the address/prefix format (e.g. fe80::/64)
 * Fix orphan mode stratum incorrectly counting to infinity
 * Orphan parent selection metric updated to includes missing ntohl()
 * Non-printable stratum 16 refid no longer sent to ntp
 * Duplicate ephemeral associations suppressed for broadcastclient and
   multicastclient without broadcastdelay
 * Exclude undetermined sys_refid from use in loopback TEST12
 * Exclude MODE_SERVER responses from KoD rate limiting
 * Include root delay in clock_update() sys_rootdisp calculations
 * get_systime() updated to exclude sys_residual offset (which only
   affected bits "below" sys_tick, the precision threshold)
 * sys.peer jitter weighting corrected in sys_jitter calculation

ntpq

 * -n option extended to include the billboard "server" column
 * IPv6 addresses in the local column truncated to prevent overruns

---
NTP 4.2.6p4 (Harlan Stenn <stenn@ntp.org>, 2011/09/22)

Focus: Bug fixes and portability improvements

Severity: Medium

This is a recommended upgrade.

This release includes build infrastructure updates, code
clean-ups, minor bug fixes, fixes for a number of minor
ref-clock issues, and documentation revisions.

Portability improvements affect AIX, HP-UX, Linux, OS X and 64-bit time_t.

New features / changes in this release:

Build system

* Fix checking for struct rtattr
* Update config.guess and config.sub for AIX
* Upgrade required version of autogen and libopts for building
  from our source code repository

ntpd

* Back-ported several fixes for Coverity warnings from ntp-dev
* Fix a rare boundary condition in UNLINK_EXPR_SLIST()
* Allow "logconfig =allall" configuration directive
* Bind tentative IPv6 addresses on Linux
* Correct WWVB/Spectracom driver to timestamp CR instead of LF
* Improved tally bit handling to prevent incorrect ntpq peer status reports
* Exclude the Undisciplined Local Clock and ACTS drivers from the initial
  candidate list unless they are designated a "prefer peer"
* Prevent the consideration of Undisciplined Local Clock or ACTS drivers for
  selection during the 'tos orphanwait' period
* Prefer an Orphan Mode Parent over the Undisciplined Local Clock or ACTS
  drivers
* Improved support of the Parse Refclock trusttime flag in Meinberg mode
* Back-port utility routines from ntp-dev: mprintf(), emalloc_zero()
* Added the NTPD_TICKADJ_PPM environment variable for specifying baseline
  clock slew on Microsoft Windows
* Code cleanup in libntpq

ntpdc

* Fix timerstats reporting

ntpdate

* Reduce time required to set clock
* Allow a timeout greater than 2 seconds

sntp

* Backward incompatible command-line option change:
  -l/--filelog changed -l/--logfile (to be consistent with ntpd)

Documentation

* Update html2man. Fix some tags in the .html files
* Distribute ntp-wait.html

---
NTP 4.2.6p3 (Harlan Stenn <stenn@ntp.org>, 2011/01/03)

Focus: Bug fixes and portability improvements

Severity: Medium

This is a recommended upgrade.

This release includes build infrastructure updates, code
clean-ups, minor bug fixes, fixes for a number of minor
ref-clock issues, and documentation revisions.

Portability improvements in this release affect AIX, Atari FreeMiNT,
FreeBSD4, Linux and Microsoft Windows.

New features / changes in this release:

Build system
* Use lsb_release to get information about Linux distributions.
* 'test' is in /usr/bin (instead of /bin) on some systems.
* Basic sanity checks for the ChangeLog file.
* Source certain build files with ./filename for systems without . in PATH.
* IRIX portability fix.
* Use a single copy of the "libopts" code.
* autogen/libopts upgrade.
* configure.ac m4 quoting cleanup.

ntpd
* Do not bind to IN6_IFF_ANYCAST addresses.
* Log the reason for exiting under Windows.
* Multicast fixes for Windows.
* Interpolation fixes for Windows.
* IPv4 and IPv6 Multicast fixes.
* Manycast solicitation fixes and general repairs.
* JJY refclock cleanup.
* NMEA refclock improvements.
* Oncore debug message cleanup.
* Palisade refclock now builds under Linux.
* Give RAWDCF more baud rates.
* Support Truetime Satellite clocks under Windows.
* Support Arbiter 1093C Satellite clocks under Windows.
* Make sure that the "filegen" configuration command defaults to "enable".
* Range-check the status codes (plus other cleanup) in the RIPE-NCC driver.
* Prohibit 'includefile' directive in remote configuration command.
* Fix 'nic' interface bindings.
* Fix the way we link with openssl if openssl is installed in the base
  system.

ntp-keygen
* Fix -V coredump.
* OpenSSL version display cleanup.

ntpdc
* Many counters should be treated as unsigned.

ntpdate
* Do not ignore replies with equal receive and transmit timestamps.

ntpq
* libntpq warning cleanup.

ntpsnmpd
* Correct SNMP type for "precision" and "resolution".
* Update the MIB from the draft version to RFC-5907.

sntp
* Display timezone offset when showing time for sntp in the local
  timezone.
* Pay proper attention to RATE KoD packets.
* Fix a miscalculation of the offset.
* Properly parse empty lines in the key file.
* Logging cleanup.
* Use tv_usec correctly in set_time().
* Documentation cleanup.

---
NTP 4.2.6p2 (Harlan Stenn <stenn@ntp.org>, 2010/07/08)

Focus: Bug fixes and portability improvements

Severity: Medium

This is a recommended upgrade.

This release includes build infrastructure updates, code
clean-ups, minor bug fixes, fixes for a number of minor
ref-clock issues, improved KOD handling, OpenSSL related
updates and documentation revisions.

Portability improvements in this release affect Irix, Linux,
Mac OS, Microsoft Windows, OpenBSD and QNX6

New features / changes in this release:

ntpd
* Range syntax for the trustedkey configuration directive
* Unified IPv4 and IPv6 restrict lists

ntpdate
* Rate limiting and KOD handling

ntpsnmpd
* default connection to net-snmpd via a unix-domain socket
* command-line 'socket name' option

ntpq / ntpdc
* support for the "passwd ..." syntax
* key-type specific password prompts

sntp
* MD5 authentication of an ntpd
* Broadcast and crypto
* OpenSSL support

---
NTP 4.2.6p1 (Harlan Stenn <stenn@ntp.org>, 2010/04/09)

Focus: Bug fixes, portability fixes, and documentation improvements

Severity: Medium

This is a recommended upgrade.
2012-02-01 07:54:58 +00:00
kardel 3123f114e2 merge import ntp-4-2-6p5 2012-02-01 07:46:20 +00:00
kardel f003fb54cd Import ntp 4.2.6p5 2012-01-31 21:18:50 +00:00
kardel 7f5b6b22a1 fix instructions in comment part 2012-01-31 20:05:13 +00:00
christos 6ee25ca9b9 use cleantags, instead of home grown copy. 2011-10-08 19:28:38 +00:00
he 89071b8936 Make this build again: include <err.h> when needed, and don't
shadow err() with a local variable called err...
2011-09-22 16:05:11 +00:00
christos 144b6f2c66 Check result of malloc (Maksymilian Arciemowicz) 2011-09-22 12:40:48 +00:00
joerg ba0add90b0 Disable noreturn checks for remaining external code 2011-09-16 16:41:20 +00:00
joerg 2ae99cf42b There is no such thing as WARNS=5. 2011-09-16 16:29:12 +00:00
christos 3eb92d7759 PR/45308: Manuel Bouyer: Update list of broadcast addresses after updating
interfaces.
2011-09-14 16:18:29 +00:00
joerg 0855702cc7 Use of non-literal format strings 2011-08-25 16:29:39 +00:00
christos 9c35de859b widen the type to avoid gcc warning about shifting too much. 2011-08-17 09:32:55 +00:00
christos 058f310f02 - proper varyadic warning and error
- don't call syslog with a buffer, use %s first.
2011-08-16 05:28:44 +00:00
christos 05d3ffd600 - it is not the 80's anymore, use proper varargs
- no need to exit again, error does
2011-08-16 05:24:20 +00:00
christos 7fdb569fcb - document non-literal strings
- fix bad security practices: {msyslog,syslog,printf}(buffer) ->
    {msyslog,syslog,printf}("%s", buffer)
- use an anonymous union to avoid type punning casts
- re-order expression to avoid integer overflow
2011-08-16 05:15:20 +00:00
christos afec221346 - fixes for non-literal strings
- add missing strbuf initialization
2011-08-16 04:45:17 +00:00
joerg d43405d38d -Wno-array-bounds is no longer needed for clang here 2011-08-09 13:00:58 +00:00
mrg db3c8201d3 avoid an overflow condition. 2011-07-01 02:18:54 +00:00
mrg 1b7bb725cc avoid a potential uninitialised variable problem. 2011-07-01 02:18:37 +00:00
mrg 56349c28d3 use __unused instead of having a function call itself, to provide an
empty translation unit.
2011-06-29 02:41:03 +00:00
mrg c64370a6d5 fix a potential off-by-two array overflow found by GCC 4.5.3. 2011-06-22 03:59:49 +00:00
mrg c111245a78 apply some -Wno-error and/or -fno-strict-aliasing.
all of this should be looked at closer, but some of them are not
very trivial.
2011-06-22 02:49:41 +00:00
kardel 2734092359 fix lineedit functionality. ntpq and friends would just exit on empty lines
which is not intended - there is a quit command for that purpose.
2011-06-19 15:58:07 +00:00
joerg a216da57a6 Default to -Wno-sign-compare -Wno-pointer-sign for clang.
Push -Wno-array-bounds down to the cases that depend on it.
Selectively disable warnings for 3rd party software or non-trivial
issues to be reviewed later to get clang -Werror to build most of the
tree.
2011-05-26 12:56:24 +00:00
gdt c93631d028 Don't copy ntpq.1 to ntpq.8 before overwriting it.
"foo > bar" fails when bar is mode 444, and files copied from the
source tree should be expected to perhaps be read only.  However, the
copy should have been removed when the sed was added.  And, it never
should have been "@"; suppressing it made debugging this harder than
it should have been.
2011-02-27 12:42:44 +00:00
plunky f4ffd55a5b setting USE_FORT=yes means that memmove() becomes a macro, and the
#ifdef inside the macro arguments is undefined behaviour (pcc reports
a syntax error)

This was fixed upstream so change this to be the same as the 4.2.6p3
stable release of ntp (can't find an actual changelog entry that
describes this, so have included the memcpy change also - memmove
is not required here)
2011-02-27 12:10:18 +00:00
plunky e9bb66e7cf clean up man files copied during build
also.. while we are putting the pages into different sections,
lets change the manpage contents to reflect that
2011-02-26 19:17:37 +00:00
kardel 4ba751f5ad make ntp compile for MKINET6=no 2011-01-09 14:49:39 +00:00
christos e19314b713 Pretending that %d can print size_t on __LP64__, by turning off warnings
is not really a good idea.  Turn on the warnings and fix them. Unfortunately
there are a bunch of const-castaways... Should be fed upstream.
2010-12-04 23:08:32 +00:00
christos 632ebb6b6e fix typo caused mdnstries not to work. 2010-11-30 15:00:10 +00:00
christos 960613872d Add a new config keyword "mdnstries" that can be set to 0 to disable mdns. 2010-11-29 00:39:40 +00:00
christos b155e612fc PR/44052: Takahiro HAYASHI: chrooted ntpd refers freed memory
As mentioned in the pr, process_routing_msgs can delete the current reader,
so cache the next element before calling it.
2010-11-06 20:40:12 +00:00
christos 3b2862d165 fix typo. From Anon Ymous 2010-09-22 14:37:08 +00:00
kardel 3319d8f1fd fix MKINET6=no compile 2010-09-04 17:06:06 +00:00
he 38fc53798e Another addition of -lterminfo after -ledit, so this links statically as well. 2010-09-01 16:43:39 +00:00
he e7d5fad5e6 Add -lterminfo after -ledit, so that this links when doing static
linking as well (found when building for the sun2 target).
2010-09-01 16:26:11 +00:00
he 35c0cfeaba Vax doesn't have IEEE floating point. 2010-09-01 13:46:58 +00:00
kardel 72a98abb7e support to follow NetBSD build options for
MKCRYPTO
	MKMDNS
	MKINET6
2010-08-29 18:55:50 +00:00
kardel d9d9735e8e make IPV6 support decision consistent with code in ntp_io.c 2010-08-29 18:54:30 +00:00
kardel 7d91f4fb19 remove commented out cruft 2010-08-29 18:52:59 +00:00
kardel f7077f6660 only refer to libdns_sd when mDNS is compiled in 2010-08-29 11:15:32 +00:00
kardel ef0ff97775 make mDNS registration depend on compile time build option MKMDNS 2010-08-29 10:13:07 +00:00
kardel 2092893b1f using a char * as timeout value is a unique concept - atol() the string 2010-08-28 20:54:24 +00:00
kardel 9893a031e7 don't return an int casted pointer as 'boolean' value - compare result of strchr with NULL 2010-08-28 20:52:55 +00:00
kardel 457fd0a5a5 disable .y.c rule - ntp_parser.y needs bison which is not part of the tool chain 2010-08-28 20:51:08 +00:00
kardel 179b12252e add installation of manual pages, html files and up to now missing commands (sntp, ntptrace) 2010-08-28 15:42:45 +00:00
kardel 2dee21c22b .sp only takes a single arg 2010-08-28 15:40:24 +00:00
kardel e2516bcdc0 fix DEBUG compilation 2010-08-28 15:39:25 +00:00
kardel 43632c662f remove uncondition #define DEBUG 2010-08-28 15:38:55 +00:00
tonnerre 89ba794efc Prevent ntpd instances from sending MODE_PRIVATE error responses back and
forth. This resolves CVE-2009-3563, but it should be noted that nobody uses
this code so far, so this is more of a preventive update than a security
one.
2010-04-25 22:50:11 +00:00
christos e28d07b4f4 put back -Werror 2009-12-14 02:09:39 +00:00
christos 71af8d5cf6 constify 2009-12-14 00:49:45 +00:00
christos 10afd40910 fix bogus ctype casts 2009-12-14 00:46:21 +00:00
christos 065f57e189 fix for long long time_t 2009-12-14 00:43:58 +00:00
christos 9cf8c53771 don't warn about SLEW; ntpd defines it! 2009-12-14 00:43:09 +00:00
christos e589aa514b use initgroups/setgroups
proper types for uid and gid.
2009-12-14 00:42:47 +00:00
christos eff9ac27fd fix debug printf format
fix bogus ctype cast
2009-12-14 00:42:21 +00:00
christos 5dd48b0c34 bring back our status printing function 2009-12-14 00:41:03 +00:00
christos 61c775be3f constify 2009-12-14 00:40:26 +00:00
christos ed38567fda fix bogus ctype casts 2009-12-14 00:38:48 +00:00
christos 7b8fd1634b don't redefine NANOSECOND 2009-12-14 00:38:20 +00:00
christos 7cabe5d03b (unsigned char) for ctype functions. 2009-12-13 23:25:40 +00:00
christos 20051da22f int/long portability. 2009-12-13 23:25:24 +00:00
kardel 1ca06f9c92 initial version of reachover make- and support-files 2009-12-13 17:13:47 +00:00
kardel abb0f93cd7 Import ntp 4.2.6 2009-12-13 16:51:59 +00:00