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/8d1ae3f63062
branches: trunk
changeset: 815139:8d1ae3f63062
user: christos <christos%NetBSD.org@localhost>
date: Sun May 01 23:32:00 2016 +0000
description:
merge conflicts
diffstat:
external/bsd/ntp/bin/ntpd/Makefile | 5 +-
external/bsd/ntp/dist/include/ntp.h | 19 +-
external/bsd/ntp/dist/include/ntp_io.h | 5 +-
external/bsd/ntp/dist/include/ntp_refclock.h | 5 +-
external/bsd/ntp/dist/include/ntp_stdlib.h | 9 +-
external/bsd/ntp/dist/include/ntp_types.h | 10 +-
external/bsd/ntp/dist/include/ntp_worker.h | 57 +-
external/bsd/ntp/dist/include/parse.h | 8 +-
external/bsd/ntp/dist/include/recvbuff.h | 6 +-
external/bsd/ntp/dist/lib/isc/hmacmd5.c | 4 +-
external/bsd/ntp/dist/lib/isc/hmacsha.c | 12 +-
external/bsd/ntp/dist/lib/isc/include/isc/string.h | 20 +-
external/bsd/ntp/dist/libntp/a_md5encrypt.c | 6 +-
external/bsd/ntp/dist/libntp/authkeys.c | 363 ++++--
external/bsd/ntp/dist/libntp/authreadkeys.c | 122 +-
external/bsd/ntp/dist/libntp/authusekey.c | 4 +-
external/bsd/ntp/dist/libntp/ntp_intres.c | 50 +-
external/bsd/ntp/dist/libntp/ntp_worker.c | 29 +-
external/bsd/ntp/dist/libntp/recvbuff.c | 30 +-
external/bsd/ntp/dist/libntp/systime.c | 17 +-
external/bsd/ntp/dist/libntp/work_fork.c | 9 +-
external/bsd/ntp/dist/libntp/work_thread.c | 99 +-
external/bsd/ntp/dist/ntpd/keyword-gen.c | 5 +-
external/bsd/ntp/dist/ntpd/ntp_config.c | 17 +-
external/bsd/ntp/dist/ntpd/ntp_control.c | 386 +++++-
external/bsd/ntp/dist/ntpd/ntp_crypto.c | 4 +-
external/bsd/ntp/dist/ntpd/ntp_io.c | 467 ++++---
external/bsd/ntp/dist/ntpd/ntp_keyword.h | 975 ++++++++--------
external/bsd/ntp/dist/ntpd/ntp_parser.y | 8 +-
external/bsd/ntp/dist/ntpd/ntp_proto.c | 377 ++++++-
external/bsd/ntp/dist/ntpd/ntp_request.c | 524 +++++---
external/bsd/ntp/dist/ntpd/ntp_scanner.c | 2 +-
external/bsd/ntp/dist/ntpd/ntp_timer.c | 25 +-
external/bsd/ntp/dist/ntpd/ntpd-opts.c | 22 +-
external/bsd/ntp/dist/ntpd/ntpd-opts.h | 10 +-
external/bsd/ntp/dist/ntpd/ntpd.c | 75 +-
external/bsd/ntp/dist/ntpd/refclock_chu.c | 4 +-
external/bsd/ntp/dist/ntpd/refclock_gpsdjson.c | 24 +-
external/bsd/ntp/dist/ntpd/refclock_jjy.c | 92 +-
external/bsd/ntp/dist/ntpd/refclock_shm.c | 4 +-
external/bsd/ntp/dist/ntpdate/ntpdate.c | 16 +-
external/bsd/ntp/dist/ntpdc/ntpdc-opts.c | 22 +-
external/bsd/ntp/dist/ntpdc/ntpdc-opts.h | 10 +-
external/bsd/ntp/dist/ntpdc/ntpdc.c | 25 +-
external/bsd/ntp/dist/ntpq/ntpq-opts.c | 174 ++-
external/bsd/ntp/dist/ntpq/ntpq-opts.h | 37 +-
external/bsd/ntp/dist/ntpq/ntpq-subs.c | 86 +-
external/bsd/ntp/dist/ntpq/ntpq.c | 151 ++-
external/bsd/ntp/dist/ntpq/ntpq.h | 5 +-
external/bsd/ntp/dist/ntpsnmpd/ntpsnmpd-opts.c | 22 +-
external/bsd/ntp/dist/ntpsnmpd/ntpsnmpd-opts.h | 10 +-
external/bsd/ntp/dist/sntp/crypto.c | 37 +-
external/bsd/ntp/dist/sntp/crypto.h | 22 +-
external/bsd/ntp/dist/sntp/libevent/evconfig-private.h | 4 +-
external/bsd/ntp/dist/sntp/libevent/test/regress.gen.c | 4 +-
external/bsd/ntp/dist/sntp/libevent/test/regress.gen.h | 210 +---
external/bsd/ntp/dist/sntp/libopts/configfile.c | 28 +-
external/bsd/ntp/dist/sntp/libopts/enum.c | 8 +-
external/bsd/ntp/dist/sntp/libopts/find.c | 2 +-
external/bsd/ntp/dist/sntp/libopts/init.c | 5 +-
external/bsd/ntp/dist/sntp/libopts/load.c | 2 +-
external/bsd/ntp/dist/sntp/libopts/makeshell.c | 2 +-
external/bsd/ntp/dist/sntp/libopts/nested.c | 6 +-
external/bsd/ntp/dist/sntp/libopts/parse-duration.c | 6 +-
external/bsd/ntp/dist/sntp/libopts/reset.c | 2 +-
external/bsd/ntp/dist/sntp/libopts/save.c | 2 +-
external/bsd/ntp/dist/sntp/libopts/tokenize.c | 2 +-
external/bsd/ntp/dist/sntp/main.c | 4 +-
external/bsd/ntp/dist/sntp/networking.c | 4 +-
external/bsd/ntp/dist/sntp/sntp-opts.c | 22 +-
external/bsd/ntp/dist/sntp/sntp-opts.h | 10 +-
external/bsd/ntp/dist/util/ntp-keygen-opts.c | 22 +-
external/bsd/ntp/dist/util/ntp-keygen-opts.h | 10 +-
external/bsd/ntp/importdate | 2 +-
external/bsd/ntp/include/config.h | 86 +-
external/bsd/ntp/lib/libiscntp/Makefile | 3 +-
external/bsd/ntp/lib/libntp/Makefile | 3 +-
external/bsd/ntp/scripts/mkver | 2 +-
78 files changed, 3081 insertions(+), 1897 deletions(-)
diffs (truncated from 8630 to 300 lines):
diff -r 69f9efe23b41 -r 8d1ae3f63062 external/bsd/ntp/bin/ntpd/Makefile
--- a/external/bsd/ntp/bin/ntpd/Makefile Sun May 01 23:23:22 2016 +0000
+++ b/external/bsd/ntp/bin/ntpd/Makefile Sun May 01 23:32:00 2016 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.20 2016/03/23 09:00:31 mrg Exp $
+# $NetBSD: Makefile,v 1.21 2016/05/01 23:32:00 christos Exp $
.include <bsd.own.mk>
@@ -72,12 +72,13 @@
refclock_wwvb.c \
refclock_zyfer.c
+.include "${.CURDIR}/../Makefile.inc"
+
LDADD+= -L${LIBPARSE} -lparse -L${LIBISC} -liscntp -lm -lutil
DPADD+= ${LIBPARSE}/libparse.a ${LIBISC}/libiscntp.a ${LIBOPTS}/libopts.a ${LIBNTP}/libntp.a ${LIBM} ${LIBUTIL}
COPTS.ntp_control.c+= ${${ACTIVE_CC} == "gcc":? -Wno-format-nonliteral :}
-.include "${.CURDIR}/../Makefile.inc"
DIST=${IDIST}/ntpd
diff -r 69f9efe23b41 -r 8d1ae3f63062 external/bsd/ntp/dist/include/ntp.h
--- a/external/bsd/ntp/dist/include/ntp.h Sun May 01 23:23:22 2016 +0000
+++ b/external/bsd/ntp/dist/include/ntp.h Sun May 01 23:32:00 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ntp.h,v 1.5 2016/01/08 21:35:35 christos Exp $ */
+/* $NetBSD: ntp.h,v 1.6 2016/05/01 23:32:00 christos Exp $ */
/*
* ntp.h - NTP definitions for the masses
@@ -177,6 +177,7 @@
struct interface {
endpt * elink; /* endpt list link */
endpt * mclink; /* per-AF_* multicast list */
+ void * ioreg_ctx; /* IO registration context */
SOCKET fd; /* socket descriptor */
SOCKET bfd; /* for receiving broadcasts */
u_int32 ifnum; /* endpt instance count */
@@ -244,6 +245,13 @@
#define PEER_TEST_MASK (TEST10 | TEST11 | TEST12 | TEST13)
/*
+ * Unused flags
+ */
+#define TEST14 0x2000
+#define TEST15 0x4000
+#define TEST16 0x8000
+
+/*
* The peer structure. Holds state information relating to the guys
* we are peering with. Most of this stuff is from section 3.2 of the
* spec.
@@ -352,6 +360,7 @@
l_fp dst; /* destination timestamp */
l_fp aorg; /* origin timestamp */
l_fp borg; /* alternate origin timestamp */
+ l_fp bxmt; /* most recent broadcast transmit timestamp */
double offset; /* peer clock offset */
double delay; /* peer roundtrip delay */
double jitter; /* peer jitter (squares) */
@@ -384,13 +393,15 @@
* Statistic counters
*/
u_long timereset; /* time stat counters were reset */
- u_long timereceived; /* last packet received time */
+ u_long timelastrec; /* last packet received time */
+ u_long timereceived; /* last (clean) packet received time */
u_long timereachable; /* last reachable/unreachable time */
u_long sent; /* packets sent */
u_long received; /* packets received */
u_long processed; /* packets processed */
u_long badauth; /* bad authentication (TEST5) */
+ u_long badNAK; /* invalid crypto-NAK */
u_long bogusorg; /* bogus origin (TEST2, TEST3) */
u_long oldpkt; /* old duplicate (TEST1) */
u_long seldisptoolarge; /* bad header (TEST6, TEST7) */
@@ -545,6 +556,7 @@
l_fp rec; /* receive time stamp */
l_fp xmt; /* transmit time stamp */
+#define MIN_V4_PKT_LEN (12 * sizeof(u_int32)) /* min header length */
#define LEN_PKT_NOMAC (12 * sizeof(u_int32)) /* min header length */
#define MIN_MAC_LEN (1 * sizeof(u_int32)) /* crypto_NAK */
#define MAX_MD5_LEN (5 * sizeof(u_int32)) /* MD5 */
@@ -710,6 +722,9 @@
#define PROTO_ORPHAN 26
#define PROTO_ORPHWAIT 27
#define PROTO_MODE7 28
+#define PROTO_UECRYPTO 29
+#define PROTO_UECRYPTONAK 30
+#define PROTO_UEDIGEST 31
/*
* Configuration items for the loop filter
diff -r 69f9efe23b41 -r 8d1ae3f63062 external/bsd/ntp/dist/include/ntp_io.h
--- a/external/bsd/ntp/dist/include/ntp_io.h Sun May 01 23:23:22 2016 +0000
+++ b/external/bsd/ntp/dist/include/ntp_io.h Sun May 01 23:32:00 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ntp_io.h,v 1.4 2016/01/08 21:35:35 christos Exp $ */
+/* $NetBSD: ntp_io.h,v 1.5 2016/05/01 23:32:00 christos Exp $ */
#ifndef NTP_IO_H
#define NTP_IO_H
@@ -42,6 +42,8 @@
#include "libntp.h" /* This needs Something above for GETDTABLESIZE */
+#include "ntp_keyacc.h"
+
/*
* Define FNDELAY and FASYNC using O_NONBLOCK and O_ASYNC if we need
* to (and can). This is here initially for QNX, but may help for
@@ -85,7 +87,6 @@
extern int qos;
SOCKET move_fd(SOCKET fd);
isc_boolean_t get_broadcastclient_flag(void);
-extern int is_ip_address(const char *, u_short, sockaddr_u *);
extern void sau_from_netaddr(sockaddr_u *, const isc_netaddr_t *);
extern void add_nic_rule(nic_rule_match match_type,
const char *if_name, int prefixlen,
diff -r 69f9efe23b41 -r 8d1ae3f63062 external/bsd/ntp/dist/include/ntp_refclock.h
--- a/external/bsd/ntp/dist/include/ntp_refclock.h Sun May 01 23:23:22 2016 +0000
+++ b/external/bsd/ntp/dist/include/ntp_refclock.h Sun May 01 23:32:00 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ntp_refclock.h,v 1.4 2016/01/08 21:35:35 christos Exp $ */
+/* $NetBSD: ntp_refclock.h,v 1.5 2016/05/01 23:32:00 christos Exp $ */
/*
* ntp_refclock.h - definitions for reference clock support
@@ -107,7 +107,8 @@
int active; /* nonzero when in use */
#ifdef HAVE_IO_COMPLETION_PORT
- void * device_context; /* device-related data for i/o subsystem */
+ void * ioreg_ctx; /* IO registration context */
+ void * device_ctx; /* device-related data for i/o subsystem */
#endif
};
diff -r 69f9efe23b41 -r 8d1ae3f63062 external/bsd/ntp/dist/include/ntp_stdlib.h
--- a/external/bsd/ntp/dist/include/ntp_stdlib.h Sun May 01 23:23:22 2016 +0000
+++ b/external/bsd/ntp/dist/include/ntp_stdlib.h Sun May 01 23:32:00 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ntp_stdlib.h,v 1.12 2016/01/08 21:35:35 christos Exp $ */
+/* $NetBSD: ntp_stdlib.h,v 1.13 2016/05/01 23:32:00 christos Exp $ */
/*
* ntp_stdlib.h - Prototypes for NTP lib.
@@ -18,6 +18,7 @@
#include "ntp_malloc.h"
#include "ntp_string.h"
#include "ntp_syslog.h"
+#include "ntp_keyacc.h"
#ifdef __GNUC__
#define NTP_PRINTF(fmt, args) __attribute__((__format__(__printf__, fmt, args)))
@@ -73,6 +74,7 @@
extern size_t authencrypt (keyid_t, u_int32 *, size_t);
extern int authhavekey (keyid_t);
extern int authistrusted (keyid_t);
+extern int authistrustedip (keyid_t, sockaddr_u *);
extern int authreadkeys (const char *);
extern void authtrust (keyid_t, u_long);
extern int authusekey (keyid_t, int, const u_char *);
@@ -101,7 +103,7 @@
/* a_md5encrypt.c */
extern int MD5authdecrypt (int, const u_char *, u_int32 *, size_t, size_t);
extern size_t MD5authencrypt (int, const u_char *, u_int32 *, size_t);
-extern void MD5auth_setkey (keyid_t, int, const u_char *, size_t);
+extern void MD5auth_setkey (keyid_t, int, const u_char *, size_t, KeyAccT *c);
extern u_int32 addr2refid (sockaddr_u *);
/* emalloc.c */
@@ -145,6 +147,7 @@
extern int hextoint (const char *, u_long *);
extern const char * humanlogtime (void);
extern const char * humantime (time_t);
+extern int is_ip_address (const char *, u_short, sockaddr_u *);
extern char * mfptoa (u_int32, u_int32, short);
extern char * mfptoms (u_int32, u_int32, short);
extern const char * modetoa (size_t);
@@ -201,7 +204,7 @@
extern keyid_t cache_keyid; /* key identifier */
extern int cache_type; /* key type */
extern u_char * cache_secret; /* secret */
-extern u_short cache_secretsize; /* secret octets */
+extern size_t cache_secretsize; /* secret octets */
extern u_short cache_flags; /* KEY_ bit flags */
/* getopt.c */
diff -r 69f9efe23b41 -r 8d1ae3f63062 external/bsd/ntp/dist/include/ntp_types.h
--- a/external/bsd/ntp/dist/include/ntp_types.h Sun May 01 23:23:22 2016 +0000
+++ b/external/bsd/ntp/dist/include/ntp_types.h Sun May 01 23:32:00 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ntp_types.h,v 1.5 2016/01/08 21:35:35 christos Exp $ */
+/* $NetBSD: ntp_types.h,v 1.6 2016/05/01 23:32:00 christos Exp $ */
/*
* ntp_types.h - defines how int32 and u_int32 are treated.
@@ -37,6 +37,13 @@
# define FALSE 0
#endif
+#ifdef HAVE_STDBOOL_H
+# include <stdbool.h>
+#else
+typedef int bool; /* Can't use enum TRUE/FALSE because of above */
+#endif
+
+
/*
* This is another naming conflict.
* On NetBSD for MAC the macro "mac" is defined as 1
@@ -220,6 +227,7 @@
#define ASSOCID_MAX USHRT_MAX
typedef u_int32 keyid_t; /* cryptographic key ID */
#define KEYID_T_MAX (0xffffffff)
+
typedef u_int32 tstamp_t; /* NTP seconds timestamp */
/*
diff -r 69f9efe23b41 -r 8d1ae3f63062 external/bsd/ntp/dist/include/ntp_worker.h
--- a/external/bsd/ntp/dist/include/ntp_worker.h Sun May 01 23:23:22 2016 +0000
+++ b/external/bsd/ntp/dist/include/ntp_worker.h Sun May 01 23:32:00 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ntp_worker.h,v 1.4 2016/01/08 21:35:35 christos Exp $ */
+/* $NetBSD: ntp_worker.h,v 1.5 2016/05/01 23:32:00 christos Exp $ */
/*
* ntp_worker.h
@@ -62,33 +62,35 @@
#if defined(WORK_FORK)
typedef struct blocking_child_tag {
- int reusable;
- int pid;
- int req_write_pipe; /* parent */
- int resp_read_pipe;
- void * resp_read_ctx;
- int req_read_pipe; /* child */
- int resp_write_pipe;
- int ispipe;
+ int reusable;
+ int pid;
+ int req_write_pipe; /* parent */
+ int resp_read_pipe;
+ void * resp_read_ctx;
+ int req_read_pipe; /* child */
+ int resp_write_pipe;
+ int ispipe;
+ volatile u_int resp_ready_seen; /* signal/scan */
+ volatile u_int resp_ready_done; /* consumer/mainloop */
} blocking_child;
#elif defined(WORK_THREAD)
typedef struct blocking_child_tag {
-/*
- * blocking workitems and blocking_responses are dynamically-sized
- * one-dimensional arrays of pointers to blocking worker requests and
- * responses.
- *
- * IMPORTANT: This structure is shared between threads, and all access
- * that is not atomic (especially queue operations) must hold the
- * 'accesslock' semaphore to avoid data races.
- *
- * The resource management (thread/semaphore creation/destruction)
- * functions and functions just testing a handle are safe because these
- * are only changed by the main thread when no worker is running on the
- * same data structure.
- */
+ /*
+ * blocking workitems and blocking_responses are
+ * dynamically-sized one-dimensional arrays of pointers to
+ * blocking worker requests and responses.
+ *
+ * IMPORTANT: This structure is shared between threads, and all
+ * access that is not atomic (especially queue operations) must
+ * hold the 'accesslock' semaphore to avoid data races.
+ *
+ * The resource management (thread/semaphore
+ * creation/destruction) functions and functions just testing a
+ * handle are safe because these are only changed by the main
+ * thread when no worker is running on the same data structure.
+ */
int reusable;
sem_ref accesslock; /* shared access lock */
thr_ref thread_ref; /* thread 'handle' */
@@ -122,12 +124,18 @@
#else
sem_ref responses_pending; /* signalling */
#endif
+ volatile u_int resp_ready_seen; /* signal/scan */
+ volatile u_int resp_ready_done; /* consumer/mainloop */
sema_type sem_table[4];
thread_type thr_table[1];
Home |
Main Index |
Thread Index |
Old Index