Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/bsd/ntp merge conflicts
details: https://anonhg.NetBSD.org/src/rev/29ea9a9fddcc
branches: trunk
changeset: 349063:29ea9a9fddcc
user: christos <christos%NetBSD.org@localhost>
date: Tue Nov 22 03:09:30 2016 +0000
description:
merge conflicts
diffstat:
external/bsd/ntp/dist/include/ntp.h | 12 +-
external/bsd/ntp/dist/include/ntp_intres.h | 8 +-
external/bsd/ntp/dist/include/ntpd.h | 3 +-
external/bsd/ntp/dist/lib/isc/netaddr.c | 2 +-
external/bsd/ntp/dist/libntp/a_md5encrypt.c | 54 +-
external/bsd/ntp/dist/libntp/audio.c | 8 +-
external/bsd/ntp/dist/libntp/ntp_calendar.c | 87 +-
external/bsd/ntp/dist/libntp/ntp_intres.c | 64 +-
external/bsd/ntp/dist/libntp/ssl_init.c | 13 +-
external/bsd/ntp/dist/libntp/work_fork.c | 90 +-
external/bsd/ntp/dist/libparse/clk_hopf6021.c | 70 +-
external/bsd/ntp/dist/ntpd/keyword-gen.c | 3 +-
external/bsd/ntp/dist/ntpd/ntp_config.c | 38 +-
external/bsd/ntp/dist/ntpd/ntp_control.c | 160 +-
external/bsd/ntp/dist/ntpd/ntp_crypto.c | 347 ++-
external/bsd/ntp/dist/ntpd/ntp_keyword.h | 2103 ++++++++++++-----------
external/bsd/ntp/dist/ntpd/ntp_loopfilter.c | 13 +-
external/bsd/ntp/dist/ntpd/ntp_parser.y | 6 +-
external/bsd/ntp/dist/ntpd/ntp_peer.c | 116 +-
external/bsd/ntp/dist/ntpd/ntp_proto.c | 153 +-
external/bsd/ntp/dist/ntpd/ntp_refclock.c | 64 +-
external/bsd/ntp/dist/ntpd/ntpd-opts.c | 16 +-
external/bsd/ntp/dist/ntpd/ntpd-opts.h | 8 +-
external/bsd/ntp/dist/ntpd/refclock_gpsdjson.c | 4 +-
external/bsd/ntp/dist/ntpd/refclock_jjy.c | 12 +-
external/bsd/ntp/dist/ntpd/refclock_jupiter.c | 69 +-
external/bsd/ntp/dist/ntpdc/ntpdc-opts.c | 16 +-
external/bsd/ntp/dist/ntpdc/ntpdc-opts.h | 8 +-
external/bsd/ntp/dist/ntpq/ntpq-opts.c | 16 +-
external/bsd/ntp/dist/ntpq/ntpq-opts.h | 8 +-
external/bsd/ntp/dist/ntpq/ntpq.c | 11 +-
external/bsd/ntp/dist/ntpsnmpd/ntpsnmpd-opts.c | 16 +-
external/bsd/ntp/dist/ntpsnmpd/ntpsnmpd-opts.h | 8 +-
external/bsd/ntp/dist/sntp/crypto.c | 22 +-
external/bsd/ntp/dist/sntp/sntp-opts.c | 16 +-
external/bsd/ntp/dist/sntp/sntp-opts.h | 8 +-
external/bsd/ntp/dist/util/ntp-keygen-opts.c | 16 +-
external/bsd/ntp/dist/util/ntp-keygen-opts.h | 8 +-
external/bsd/ntp/dist/util/ntp-keygen.c | 369 ++-
external/bsd/ntp/importdate | 2 +-
external/bsd/ntp/include/config.h | 8 +-
external/bsd/ntp/lib/libntp/Makefile | 3 +-
external/bsd/ntp/scripts/mkver | 2 +-
43 files changed, 2327 insertions(+), 1733 deletions(-)
diffs (truncated from 6906 to 300 lines):
diff -r 3c162ab8d07f -r 29ea9a9fddcc external/bsd/ntp/dist/include/ntp.h
--- a/external/bsd/ntp/dist/include/ntp.h Tue Nov 22 02:06:00 2016 +0000
+++ b/external/bsd/ntp/dist/include/ntp.h Tue Nov 22 03:09:30 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ntp.h,v 1.7 2016/06/03 20:39:02 christos Exp $ */
+/* $NetBSD: ntp.h,v 1.8 2016/11/22 03:09:30 christos Exp $ */
/*
* ntp.h - NTP definitions for the masses
@@ -393,7 +393,7 @@
* Statistic counters
*/
u_long timereset; /* time stat counters were reset */
- u_long timelastrec; /* last packet received time */
+ u_long timelastrec; /* last packet received time, incl. trash */
u_long timereceived; /* last (clean) packet received time */
u_long timereachable; /* last reachable/unreachable time */
@@ -421,8 +421,7 @@
* MODE_BROADCAST and MODE_BCLIENT appear in the transition
* function. MODE_CONTROL and MODE_PRIVATE can appear in packets,
* but those never survive to the transition function.
- * is a
-/ */
+ */
#define MODE_UNSPEC 0 /* unspecified (old version) */
#define MODE_ACTIVE 1 /* symmetric active mode */
#define MODE_PASSIVE 2 /* symmetric passive mode */
@@ -435,7 +434,7 @@
#define MODE_CONTROL 6 /* control mode */
#define MODE_PRIVATE 7 /* private mode */
/*
- * This is a madeup mode for broadcast client.
+ * This is a made-up mode for broadcast client.
*/
#define MODE_BCLIENT 6 /* broadcast client mode */
@@ -726,6 +725,7 @@
#define PROTO_UECRYPTONAK 30
#define PROTO_UEDIGEST 31
#define PROTO_PCEDIGEST 32
+#define PROTO_BCPOLLBSTEP 33
/*
* Configuration items for the loop filter
@@ -733,7 +733,7 @@
#define LOOP_DRIFTINIT 1 /* iniitialize frequency */
#define LOOP_KERN_CLEAR 2 /* set initial frequency offset */
#define LOOP_MAX 3 /* set both step offsets */
-#define LOOP_MAX_BACK 4 /* set bacward-step offset */
+#define LOOP_MAX_BACK 4 /* set backward-step offset */
#define LOOP_MAX_FWD 5 /* set forward-step offset */
#define LOOP_PANIC 6 /* set panic offseet */
#define LOOP_PHI 7 /* set dispersion rate */
diff -r 3c162ab8d07f -r 29ea9a9fddcc external/bsd/ntp/dist/include/ntp_intres.h
--- a/external/bsd/ntp/dist/include/ntp_intres.h Tue Nov 22 02:06:00 2016 +0000
+++ b/external/bsd/ntp/dist/include/ntp_intres.h Tue Nov 22 03:09:30 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ntp_intres.h,v 1.4 2016/01/08 21:35:35 christos Exp $ */
+/* $NetBSD: ntp_intres.h,v 1.5 2016/11/22 03:09:30 christos Exp $ */
/*
* ntp_intres.h - client interface to blocking-worker name resolution.
@@ -11,6 +11,9 @@
#ifdef WORKER
#define INITIAL_DNS_RETRY 2 /* seconds between queries */
+/* flags for extended addrinfo version */
+#define GAIR_F_IGNDNSERR 0x0001 /* ignore DNS errors */
+
/*
* you call getaddrinfo_sometime(name, service, &hints, retry, callback_func, context);
* later (*callback_func)(rescode, gai_errno, context, name, service, hints, ai_result) is called.
@@ -21,6 +24,9 @@
extern int getaddrinfo_sometime(const char *, const char *,
const struct addrinfo *, int,
gai_sometime_callback, void *);
+extern int getaddrinfo_sometime_ex(const char *, const char *,
+ const struct addrinfo *, int,
+ gai_sometime_callback, void *, u_int);
/*
* In gai_sometime_callback routines, the resulting addrinfo list is
* only available until the callback returns. To hold on to the list
diff -r 3c162ab8d07f -r 29ea9a9fddcc external/bsd/ntp/dist/include/ntpd.h
--- a/external/bsd/ntp/dist/include/ntpd.h Tue Nov 22 02:06:00 2016 +0000
+++ b/external/bsd/ntp/dist/include/ntpd.h Tue Nov 22 03:09:30 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ntpd.h,v 1.8 2016/01/08 21:35:35 christos Exp $ */
+/* $NetBSD: ntpd.h,v 1.9 2016/11/22 03:09:30 christos Exp $ */
/*
* ntpd.h - Prototypes and external variables for ntpd.
@@ -485,6 +485,7 @@
extern double sys_bdelay; /* broadcast client default delay */
extern int sys_authenticate; /* requre authentication for config */
extern l_fp sys_authdelay; /* authentication delay */
+extern u_char sys_bcpollbstep; /* broadcast poll backstep gate */
extern u_long sys_epoch; /* last clock update time */
extern keyid_t sys_private; /* private value for session seed */
extern int sys_manycastserver; /* respond to manycast client pkts */
diff -r 3c162ab8d07f -r 29ea9a9fddcc external/bsd/ntp/dist/lib/isc/netaddr.c
--- a/external/bsd/ntp/dist/lib/isc/netaddr.c Tue Nov 22 02:06:00 2016 +0000
+++ b/external/bsd/ntp/dist/lib/isc/netaddr.c Tue Nov 22 03:09:30 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: netaddr.c,v 1.9 2016/01/08 21:35:36 christos Exp $ */
+/* $NetBSD: netaddr.c,v 1.10 2016/11/22 03:09:30 christos Exp $ */
/*
* Copyright (C) 2004, 2005, 2007, 2010-2012 Internet Systems Consortium, Inc. ("ISC")
diff -r 3c162ab8d07f -r 29ea9a9fddcc external/bsd/ntp/dist/libntp/a_md5encrypt.c
--- a/external/bsd/ntp/dist/libntp/a_md5encrypt.c Tue Nov 22 02:06:00 2016 +0000
+++ b/external/bsd/ntp/dist/libntp/a_md5encrypt.c Tue Nov 22 03:09:30 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: a_md5encrypt.c,v 1.6 2016/06/29 18:42:17 christos Exp $ */
+/* $NetBSD: a_md5encrypt.c,v 1.7 2016/11/22 03:09:30 christos Exp $ */
/*
* digest support for NTP, MD5 and with OpenSSL more
@@ -13,6 +13,7 @@
#include "ntp.h"
#include "ntp_md5.h" /* provides OpenSSL digest API */
#include "isc/string.h"
+#include "libssl_compat.h"
/*
* MD5authencrypt - generate message digest
*
@@ -28,7 +29,7 @@
{
u_char digest[EVP_MAX_MD_SIZE];
u_int len;
- EVP_MD_CTX ctx;
+ EVP_MD_CTX *ctx;
/*
* Compute digest of key concatenated with packet. Note: the
@@ -36,14 +37,20 @@
* was creaded.
*/
INIT_SSL();
- if (!EVP_DigestInit(&ctx, EVP_get_digestbynid(type))) {
+ ctx = EVP_MD_CTX_new();
+ if (!(ctx && EVP_DigestInit(ctx, EVP_get_digestbynid(type)))) {
msyslog(LOG_ERR,
"MAC encrypt: digest init failed");
+ EVP_MD_CTX_free(ctx);
return (0);
}
- EVP_DigestUpdate(&ctx, key, cache_secretsize);
- EVP_DigestUpdate(&ctx, (u_char *)pkt, length);
- EVP_DigestFinal(&ctx, digest, &len);
+ EVP_DigestUpdate(ctx, key, cache_secretsize);
+ EVP_DigestUpdate(ctx, (u_char *)pkt, length);
+ EVP_DigestFinal(ctx, digest, &len);
+ EVP_MD_CTX_free(ctx);
+ /* If the MAC is longer than the MAX then truncate it. */
+ if (len > MAX_MAC_LEN - 4)
+ len = MAX_MAC_LEN - 4;
memmove((u_char *)pkt + length + 4, digest, len);
return (len + 4);
}
@@ -65,7 +72,7 @@
{
u_char digest[EVP_MAX_MD_SIZE];
u_int len;
- EVP_MD_CTX ctx;
+ EVP_MD_CTX *ctx;
/*
* Compute digest of key concatenated with packet. Note: the
@@ -73,20 +80,26 @@
* was created.
*/
INIT_SSL();
- if (!EVP_DigestInit(&ctx, EVP_get_digestbynid(type))) {
+ ctx = EVP_MD_CTX_new();
+ if (!(ctx && EVP_DigestInit(ctx, EVP_get_digestbynid(type)))) {
msyslog(LOG_ERR,
"MAC decrypt: digest init failed");
+ EVP_MD_CTX_free(ctx);
return (0);
}
- EVP_DigestUpdate(&ctx, key, cache_secretsize);
- EVP_DigestUpdate(&ctx, (u_char *)pkt, length);
- EVP_DigestFinal(&ctx, digest, &len);
+ EVP_DigestUpdate(ctx, key, cache_secretsize);
+ EVP_DigestUpdate(ctx, (u_char *)pkt, length);
+ EVP_DigestFinal(ctx, digest, &len);
+ EVP_MD_CTX_free(ctx);
+ /* If the MAC is longer than the MAX then truncate it. */
+ if (len > MAX_MAC_LEN - 4)
+ len = MAX_MAC_LEN - 4;
if (size != (size_t)len + 4) {
msyslog(LOG_ERR,
"MAC decrypt: MAC length error");
return (0);
}
- return !isc_tsmemcmp(digest, (const char *)pkt + length + 4, len);
+ return !isc_tsmemcmp(digest, (u_char *)pkt + length + 4, len);
}
/*
@@ -100,7 +113,7 @@
{
u_char digest[20];
u_int32 addr_refid;
- EVP_MD_CTX ctx;
+ EVP_MD_CTX *ctx;
u_int len;
if (IS_IPV4(addr))
@@ -108,22 +121,23 @@
INIT_SSL();
-#if defined(OPENSSL) && OPENSSL_VERSION_NUMBER >= 0x0090700fL
- EVP_MD_CTX_init(&ctx);
+ ctx = EVP_MD_CTX_new();
+ EVP_MD_CTX_init(ctx);
#ifdef EVP_MD_CTX_FLAG_NON_FIPS_ALLOW
/* MD5 is not used as a crypto hash here. */
- EVP_MD_CTX_set_flags(&ctx, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW);
+ EVP_MD_CTX_set_flags(ctx, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW);
#endif
-#endif
- if (!EVP_DigestInit(&ctx, EVP_md5())) {
+ if (!EVP_DigestInit_ex(ctx, EVP_md5(), NULL)) {
msyslog(LOG_ERR,
"MD5 init failed");
+ EVP_MD_CTX_free(ctx); /* pedantic... but safe */
exit(1);
}
- EVP_DigestUpdate(&ctx, (u_char *)PSOCK_ADDR6(addr),
+ EVP_DigestUpdate(ctx, (u_char *)PSOCK_ADDR6(addr),
sizeof(struct in6_addr));
- EVP_DigestFinal(&ctx, digest, &len);
+ EVP_DigestFinal(ctx, digest, &len);
+ EVP_MD_CTX_free(ctx);
memcpy(&addr_refid, digest, sizeof(addr_refid));
return (addr_refid);
}
diff -r 3c162ab8d07f -r 29ea9a9fddcc external/bsd/ntp/dist/libntp/audio.c
--- a/external/bsd/ntp/dist/libntp/audio.c Tue Nov 22 02:06:00 2016 +0000
+++ b/external/bsd/ntp/dist/libntp/audio.c Tue Nov 22 03:09:30 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: audio.c,v 1.10 2016/01/08 21:35:38 christos Exp $ */
+/* $NetBSD: audio.c,v 1.11 2016/11/22 03:09:30 christos Exp $ */
/*
* audio.c - audio interface for reference clock audio drivers
@@ -57,7 +57,7 @@
#ifdef PCM_STYLE_SOUND
# define INIT_FILE "/etc/ntp.audio"
int agc = SOUND_MIXER_WRITE_RECLEV; /* or IGAIN or LINE */
-int monitor = SOUND_MIXER_WRITE_VOLUME; /* or OGAIN */
+int audiomonitor = SOUND_MIXER_WRITE_VOLUME; /* or OGAIN */
int devmask = 0;
int recmask = 0;
char cf_c_dev[100], cf_i_dev[100], cf_agc[100], cf_monitor[100];
@@ -336,7 +336,7 @@
/* devmask */
i = mixer_name(cf_monitor, devmask);
if (i >= 0)
- monitor = MIXER_WRITE(i);
+ audiomonitor = MIXER_WRITE(i);
else
printf("monitor %s not in devmask %#x\n",
cf_monitor, devmask);
@@ -414,7 +414,7 @@
# endif
l |= r << 8;
if (cf_monitor[0] != '\0')
- rval = ioctl(ctl_fd, monitor, &l );
+ rval = ioctl(ctl_fd, audiomonitor, &l );
else
rval = ioctl(ctl_fd, SOUND_MIXER_WRITE_VOLUME,
&l);
diff -r 3c162ab8d07f -r 29ea9a9fddcc external/bsd/ntp/dist/libntp/ntp_calendar.c
--- a/external/bsd/ntp/dist/libntp/ntp_calendar.c Tue Nov 22 02:06:00 2016 +0000
+++ b/external/bsd/ntp/dist/libntp/ntp_calendar.c Tue Nov 22 03:09:30 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ntp_calendar.c,v 1.8 2016/01/08 21:35:38 christos Exp $ */
+/* $NetBSD: ntp_calendar.c,v 1.9 2016/11/22 03:09:30 christos Exp $ */
/*
* ntp_calendar.c - calendar and helper functions
@@ -93,7 +93,7 @@
/*
*---------------------------------------------------------------------
* replacing the 'time()' function
- * --------------------------------------------------------------------
+ *---------------------------------------------------------------------
*/
static systime_func_ptr systime_func = &time;
@@ -397,7 +397,7 @@
/*
*---------------------------------------------------------------------
* basic calendar stuff
- * --------------------------------------------------------------------
Home |
Main Index |
Thread Index |
Old Index