CVS commit: src/external/bsd/ntp/dist/ntpd

2021-02-18 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Thu Feb 18 15:13:38 UTC 2021

Modified Files:
src/external/bsd/ntp/dist/ntpd: ntp_timer.c

Log Message:
PR bin/55973:

fix routing message triggered one shot interface update.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/ntp/dist/ntpd/ntp_timer.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/ntp_timer.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_timer.c:1.9 src/external/bsd/ntp/dist/ntpd/ntp_timer.c:1.10
--- src/external/bsd/ntp/dist/ntpd/ntp_timer.c:1.9	Sun Jan  3 15:33:05 2021
+++ src/external/bsd/ntp/dist/ntpd/ntp_timer.c	Thu Feb 18 15:13:37 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_timer.c,v 1.9 2021/01/03 15:33:05 roy Exp $	*/
+/*	$NetBSD: ntp_timer.c,v 1.10 2021/02/18 15:13:37 kardel Exp $	*/
 
 /*
  * ntp_timer.c - event timer support routines
@@ -428,6 +428,8 @@ timer(void)
 		if (interface_interval)
 			timer_interfacetimeout(current_time +
 			interface_interval);
+		else
+			timer_interfacetimeout(0);
 		DPRINTF(2, ("timer: interface update\n"));
 		interface_update(NULL, NULL);
 	}



CVS commit: src/external/bsd/ntp/dist/ntpd

2021-01-31 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Sun Jan 31 08:27:49 UTC 2021

Modified Files:
src/external/bsd/ntp/dist/ntpd: ntp_io.c

Log Message:
ntpd: ignore errno EINTR on reads from the routing socket


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/external/bsd/ntp/dist/ntpd/ntp_io.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/ntp_io.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.30 src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.31
--- src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.30	Sun Jan 31 08:26:47 2021
+++ src/external/bsd/ntp/dist/ntpd/ntp_io.c	Sun Jan 31 08:27:49 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_io.c,v 1.30 2021/01/31 08:26:47 roy Exp $	*/
+/*	$NetBSD: ntp_io.c,v 1.31 2021/01/31 08:27:49 roy Exp $	*/
 
 /*
  * ntp_io.c - input/output routines for ntpd.	The socket-opening code
@@ -4741,7 +4741,7 @@ process_routing_msgs(struct asyncio_read
 cnt = read(reader->fd, buffer, sizeof(buffer));
 			} while (cnt != -1 || errno == ENOBUFS);
 			timer_interfacetimeout(current_time + UPDATE_GRACE);
-		} else {
+		} else if (errno != EINTR) {
 			msyslog(LOG_ERR,
 "routing socket reports: %m - disabling");
 			remove_asyncio_reader(reader);



CVS commit: src/external/bsd/ntp/dist/ntpd

2021-01-31 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Sun Jan 31 08:26:47 UTC 2021

Modified Files:
src/external/bsd/ntp/dist/ntpd: ntp_io.c

Log Message:
ntpd: move route socket overflow message from LOG_ERR to LOG_DEBUG

While here stop caring about RTM_LOSING as that's purely informational.
If routing does change then we get RTM_ADD/DEL/CHANGE.
Also stop caring about RTM_IFANNOUNCE as we really only want addresses
and interface flag updates which we get by RTM_NEWADDR/DELADDR/CHGADDR and
RTM_IFINFO.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/external/bsd/ntp/dist/ntpd/ntp_io.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/ntp_io.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.29 src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.30
--- src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.29	Sun Jan  3 15:33:05 2021
+++ src/external/bsd/ntp/dist/ntpd/ntp_io.c	Sun Jan 31 08:26:47 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_io.c,v 1.29 2021/01/03 15:33:05 roy Exp $	*/
+/*	$NetBSD: ntp_io.c,v 1.30 2021/01/31 08:26:47 roy Exp $	*/
 
 /*
  * ntp_io.c - input/output routines for ntpd.	The socket-opening code
@@ -4730,8 +4730,9 @@ process_routing_msgs(struct asyncio_read
 
 	if (cnt < 0) {
 		if (errno == ENOBUFS) {
-			msyslog(LOG_ERR,
-"routing socket reports: %m");
+			msyslog(LOG_DEBUG,
+"routing socket overflowed"
+" - will update interfaces");
 			/*
 			 * drain the routing socket as we need to update
 			 * the interfaces anyway
@@ -4792,15 +4793,9 @@ process_routing_msgs(struct asyncio_read
 #ifdef RTM_CHANGE
 		case RTM_CHANGE:
 #endif
-#ifdef RTM_LOSING
-		case RTM_LOSING:
-#endif
 #ifdef RTM_IFINFO
 		case RTM_IFINFO:
 #endif
-#ifdef RTM_IFANNOUNCE
-		case RTM_IFANNOUNCE:
-#endif
 #ifdef RTM_NEWLINK
 		case RTM_NEWLINK:
 #endif
@@ -4874,15 +4869,9 @@ init_async_notifications()
 #ifdef RTM_CHANGE
 		RTM_CHANGE,
 #endif
-#ifdef RTM_LOSING
-		RTM_LOSING,
-#endif
 #ifdef RTM_IFINFO
 		RTM_IFINFO,
 #endif
-#ifdef RTM_IFANNOUNCE
-		RTM_IFANNOUNCE,
-#endif
 #ifdef RTM_NEWLINK
 		RTM_NEWLINK,
 #endif



CVS commit: src/external/bsd/ntp/dist/ntpd

2021-01-03 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Sun Jan  3 15:33:05 UTC 2021

Modified Files:
src/external/bsd/ntp/dist/ntpd: cmd_args.c ntp_io.c ntp_timer.c

Log Message:
ntp: respect user's wishes to disable interface scanning

While here, disable periodic scanning by default on NetBSD as it's
no longer needed.
The user can still enable it though with a positive number to the -U
option.

kardel@ So far I see no other issues from the pitfalls I know of


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/ntp/dist/ntpd/cmd_args.c
cvs rdiff -u -r1.28 -r1.29 src/external/bsd/ntp/dist/ntpd/ntp_io.c
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/ntp/dist/ntpd/ntp_timer.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/cmd_args.c
diff -u src/external/bsd/ntp/dist/ntpd/cmd_args.c:1.6 src/external/bsd/ntp/dist/ntpd/cmd_args.c:1.7
--- src/external/bsd/ntp/dist/ntpd/cmd_args.c:1.6	Mon May 25 20:47:25 2020
+++ src/external/bsd/ntp/dist/ntpd/cmd_args.c	Sun Jan  3 15:33:05 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cmd_args.c,v 1.6 2020/05/25 20:47:25 christos Exp $	*/
+/*	$NetBSD: cmd_args.c,v 1.7 2021/01/03 15:33:05 roy Exp $	*/
 
 /*
  * cmd_args.c = command-line argument processing
@@ -181,9 +181,11 @@ getCmdOpts(
 	if (HAVE_OPT( UPDATEINTERVAL )) {
 		long val = OPT_VALUE_UPDATEINTERVAL;
 
-		if (val >= 0)
+		if (val >= 0) {
 			interface_interval = val;
-		else {
+			if (interface_interval == 0)
+disable_dynamic_updates = 1;
+		} else {
 			fprintf(stderr,
 "command line interface update interval %ld must not be negative\n",
 val);

Index: src/external/bsd/ntp/dist/ntpd/ntp_io.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.28 src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.29
--- src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.28	Fri Jan  1 17:21:47 2021
+++ src/external/bsd/ntp/dist/ntpd/ntp_io.c	Sun Jan  3 15:33:05 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_io.c,v 1.28 2021/01/01 17:21:47 roy Exp $	*/
+/*	$NetBSD: ntp_io.c,v 1.29 2021/01/03 15:33:05 roy Exp $	*/
 
 /*
  * ntp_io.c - input/output routines for ntpd.	The socket-opening code
@@ -455,8 +455,13 @@ init_io(void)
 {
 	/* Init buffer free list and stat counters */
 	init_recvbuff(RECV_INIT);
+#ifdef SO_RERROR
+	/* route(4) overflow can be observed */
+	interface_interval = 0;
+#else
 	/* update interface every 5 minutes as default */
 	interface_interval = 300;
+#endif
 
 #ifdef WORK_PIPE
 	addremove_io_fd = _addremove_io_fd;

Index: src/external/bsd/ntp/dist/ntpd/ntp_timer.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_timer.c:1.8 src/external/bsd/ntp/dist/ntpd/ntp_timer.c:1.9
--- src/external/bsd/ntp/dist/ntpd/ntp_timer.c:1.8	Mon May 25 20:47:25 2020
+++ src/external/bsd/ntp/dist/ntpd/ntp_timer.c	Sun Jan  3 15:33:05 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_timer.c,v 1.8 2020/05/25 20:47:25 christos Exp $	*/
+/*	$NetBSD: ntp_timer.c,v 1.9 2021/01/03 15:33:05 roy Exp $	*/
 
 /*
  * ntp_timer.c - event timer support routines
@@ -423,9 +423,11 @@ timer(void)
 	/*
 	 * Interface update timer
 	 */
-	if (interface_interval && interface_timer <= current_time) {
-		timer_interfacetimeout(current_time +
-		interface_interval);
+	if (!disable_dynamic_updates &&
+	interface_timer && interface_timer <= current_time) {
+		if (interface_interval)
+			timer_interfacetimeout(current_time +
+			interface_interval);
 		DPRINTF(2, ("timer: interface update\n"));
 		interface_update(NULL, NULL);
 	}



CVS commit: src/external/bsd/ntp/dist/ntpd

2021-01-01 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Jan  1 17:21:47 UTC 2021

Modified Files:
src/external/bsd/ntp/dist/ntpd: ntp_io.c

Log Message:
ntpd: In the event of route(4) overflow, update the interfaces


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/external/bsd/ntp/dist/ntpd/ntp_io.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/ntp_io.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.27 src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.28
--- src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.27	Mon May 25 20:47:25 2020
+++ src/external/bsd/ntp/dist/ntpd/ntp_io.c	Fri Jan  1 17:21:47 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_io.c,v 1.27 2020/05/25 20:47:25 christos Exp $	*/
+/*	$NetBSD: ntp_io.c,v 1.28 2021/01/01 17:21:47 roy Exp $	*/
 
 /*
  * ntp_io.c - input/output routines for ntpd.	The socket-opening code
@@ -4727,6 +4727,14 @@ process_routing_msgs(struct asyncio_read
 		if (errno == ENOBUFS) {
 			msyslog(LOG_ERR,
 "routing socket reports: %m");
+			/*
+			 * drain the routing socket as we need to update
+			 * the interfaces anyway
+			 */
+			do {
+cnt = read(reader->fd, buffer, sizeof(buffer));
+			} while (cnt != -1 || errno == ENOBUFS);
+			timer_interfacetimeout(current_time + UPDATE_GRACE);
 		} else {
 			msyslog(LOG_ERR,
 "routing socket reports: %m - disabling");
@@ -4837,6 +4845,9 @@ init_async_notifications()
 	struct sockaddr_nl sa;
 #else
 	int fd = socket(PF_ROUTE, SOCK_RAW, 0);
+#ifdef SO_RERROR
+	int on = 1;
+#endif
 #endif
 #ifdef RO_MSGFILTER
 	unsigned char msgfilter[] = {
@@ -4907,6 +4918,10 @@ init_async_notifications()
 	, sizeof(msgfilter)) == -1)
 		msyslog(LOG_ERR, "RO_MSGFILTER: %m");
 #endif
+#ifdef SO_RERROR
+	if (setsockopt(fd, SOL_SOCKET, SO_RERROR, , sizeof(on)) == -1)
+		msyslog(LOG_ERR, "SO_RERROR: %m");
+#endif
 	make_socket_nonblocking(fd);
 #if defined(HAVE_SIGNALED_IO)
 	init_socket_sig(fd);



CVS commit: src/external/bsd/ntp/dist/libntp

2020-10-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 10 13:41:14 UTC 2020

Modified Files:
src/external/bsd/ntp/dist/libntp: work_fork.c

Log Message:
Wait for the asynchronous dns resolver child to be done (and close the
socket descriptors) before returning. Otherwise we might get bind errors.
Reported by kim@, fixed by mlelstv@.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/external/bsd/ntp/dist/libntp/work_fork.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/libntp/work_fork.c
diff -u src/external/bsd/ntp/dist/libntp/work_fork.c:1.14 src/external/bsd/ntp/dist/libntp/work_fork.c:1.15
--- src/external/bsd/ntp/dist/libntp/work_fork.c:1.14	Mon May 25 16:47:24 2020
+++ src/external/bsd/ntp/dist/libntp/work_fork.c	Sat Oct 10 09:41:14 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: work_fork.c,v 1.14 2020/05/25 20:47:24 christos Exp $	*/
+/*	$NetBSD: work_fork.c,v 1.15 2020/10/10 13:41:14 christos Exp $	*/
 
 /*
  * work_fork.c - fork implementation for blocking worker child.
@@ -559,6 +559,9 @@ fork_blocking_child(
 		/* wire into I/O loop */
 		(*addremove_io_fd)(c->resp_read_pipe, is_pipe, FALSE);
 
+		/* wait until child is done */
+		rc = netread(c->resp_read_pipe, , sizeof(rc));
+
 		return;		/* parent returns */
 	}
 
@@ -585,6 +588,10 @@ fork_blocking_child(
 	c->resp_write_pipe = blocking_pipes[3];
 
 	kill_asyncio(0);
+
+	/* Tell parent we are ready */
+	rc = netwrite(c->resp_write_pipe, , sizeof(rc));
+
 	closelog();
 	if (syslog_file != NULL) {
 		fclose(syslog_file);



CVS commit: src/external/bsd/ntp/dist/lib/isc

2020-09-06 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Sep  7 00:48:45 UTC 2020

Modified Files:
src/external/bsd/ntp/dist/lib/isc: assertions.c

Log Message:
avoid calling printf %s with NULL.  fix idea from christos.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/ntp/dist/lib/isc/assertions.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/lib/isc/assertions.c
diff -u src/external/bsd/ntp/dist/lib/isc/assertions.c:1.6 src/external/bsd/ntp/dist/lib/isc/assertions.c:1.7
--- src/external/bsd/ntp/dist/lib/isc/assertions.c:1.6	Mon May 25 20:47:20 2020
+++ src/external/bsd/ntp/dist/lib/isc/assertions.c	Mon Sep  7 00:48:45 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: assertions.c,v 1.6 2020/05/25 20:47:20 christos Exp $	*/
+/*	$NetBSD: assertions.c,v 1.7 2020/09/07 00:48:45 mrg Exp $	*/
 
 /*
  * Copyright (C) 2004, 2005, 2007-2009  Internet Systems Consortium, Inc. ("ISC")
@@ -94,7 +94,7 @@ isc_assertion_typetotext(isc_assertionty
 		result = "INVARIANT";
 		break;
 	default:
-		result = NULL;
+		result = "*invalid*";
 	}
 	return (result);
 }



CVS commit: src/external/bsd/ntp/dist/ntpd

2020-09-03 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Thu Sep  3 07:26:41 UTC 2020

Modified Files:
src/external/bsd/ntp/dist/ntpd: refclock_parse.c

Log Message:
remove unneeded newline in quotes variable string - keeps ntpq happy


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/external/bsd/ntp/dist/ntpd/refclock_parse.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/refclock_parse.c
diff -u src/external/bsd/ntp/dist/ntpd/refclock_parse.c:1.22 src/external/bsd/ntp/dist/ntpd/refclock_parse.c:1.23
--- src/external/bsd/ntp/dist/ntpd/refclock_parse.c:1.22	Mon May 25 20:47:25 2020
+++ src/external/bsd/ntp/dist/ntpd/refclock_parse.c	Thu Sep  3 07:26:41 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: refclock_parse.c,v 1.22 2020/05/25 20:47:25 christos Exp $	*/
+/*	$NetBSD: refclock_parse.c,v 1.23 2020/09/03 07:26:41 kardel Exp $	*/
 
 /*
  * /src/NTP/REPOSITORY/ntp4-dev/ntpd/refclock_parse.c,v 4.81 2009/05/01 10:15:29 kardel RELEASE_20090105_A
@@ -4287,7 +4287,7 @@ mk_utcinfo(
 	}
 	else
 	{
-		snprintf( t, size, "UTC offset parameter: %is, no leap second announced.\n", dtls );
+		snprintf( t, size, "UTC offset parameter: %is, no leap second announced.", dtls );
 	}
 
 }



CVS commit: src/external/bsd/ntp/dist

2020-05-30 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sat May 30 23:52:10 UTC 2020

Modified Files:
src/external/bsd/ntp/dist/include: ntp_config.h
src/external/bsd/ntp/dist/ntpd: ntp_config.c

Log Message:
Don't define psl as common symbol, move it into the only file using it.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/bsd/ntp/dist/include/ntp_config.h
cvs rdiff -u -r1.23 -r1.24 src/external/bsd/ntp/dist/ntpd/ntp_config.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/include/ntp_config.h
diff -u src/external/bsd/ntp/dist/include/ntp_config.h:1.12 src/external/bsd/ntp/dist/include/ntp_config.h:1.13
--- src/external/bsd/ntp/dist/include/ntp_config.h:1.12	Mon May 25 20:47:19 2020
+++ src/external/bsd/ntp/dist/include/ntp_config.h	Sat May 30 23:52:09 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_config.h,v 1.12 2020/05/25 20:47:19 christos Exp $	*/
+/*	$NetBSD: ntp_config.h,v 1.13 2020/05/30 23:52:09 joerg Exp $	*/
 
 #ifndef NTP_CONFIG_H
 #define NTP_CONFIG_H
@@ -277,17 +277,6 @@ typedef struct settrap_parms_tag {
 	int		ifaddr_nonnull;
 } settrap_parms;
 
-
-/*
- * Poll Skew List
- */
-
-psl_item psl[17-3+1];		/* values for polls 3-17 */
-/* To simplify the runtime code we */
-/* don't want to have to special-case */
-/* dealing with a default */
-
-
 /*
 ** Data Minimization Items
 */

Index: src/external/bsd/ntp/dist/ntpd/ntp_config.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_config.c:1.23 src/external/bsd/ntp/dist/ntpd/ntp_config.c:1.24
--- src/external/bsd/ntp/dist/ntpd/ntp_config.c:1.23	Wed May 27 23:52:19 2020
+++ src/external/bsd/ntp/dist/ntpd/ntp_config.c	Sat May 30 23:52:09 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_config.c,v 1.23 2020/05/27 23:52:19 christos Exp $	*/
+/*	$NetBSD: ntp_config.c,v 1.24 2020/05/30 23:52:09 joerg Exp $	*/
 
 /* ntp_config.c
  *
@@ -69,6 +69,16 @@ extern int yyparse(void);
 # include 
 #endif
 
+/*
+ * Poll Skew List
+ */
+
+static psl_item psl[17-3+1];	/* values for polls 3-17 */
+/* To simplify the runtime code we */
+/* don't want to have to special-case */
+/* dealing with a default */
+
+
 /* list of servers from command line for config_peers() */
 int	cmdline_server_count;
 char **	cmdline_servers;



CVS commit: src/external/bsd/ntp/dist/include

2020-05-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri May 29 20:56:27 UTC 2020

Modified Files:
src/external/bsd/ntp/dist/include: ntp_refclock.h

Log Message:
make it compile again


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/ntp/dist/include/ntp_refclock.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/include/ntp_refclock.h
diff -u src/external/bsd/ntp/dist/include/ntp_refclock.h:1.7 src/external/bsd/ntp/dist/include/ntp_refclock.h:1.8
--- src/external/bsd/ntp/dist/include/ntp_refclock.h:1.7	Fri May 29 16:54:16 2020
+++ src/external/bsd/ntp/dist/include/ntp_refclock.h	Fri May 29 16:56:27 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_refclock.h,v 1.7 2020/05/29 20:54:16 christos Exp $	*/
+/*	$NetBSD: ntp_refclock.h,v 1.8 2020/05/29 20:56:27 christos Exp $	*/
 
 /*
  * ntp_refclock.h - definitions for reference clock support
@@ -13,6 +13,7 @@
 
 #include "ntp_types.h"
 #include "ntp_tty.h"
+#include "ntp_stdlib.h"
 #include "recvbuff.h"
 
 
@@ -246,7 +247,7 @@ extern	void	refclock_format_lcode(
 			struct refclockproc *, char const *, ...)
 			NTP_PRINTF(2, 3);
 extern	void	refclock_vformat_lcode(
-			struct refclockproc *, char const *, va_list);
+			struct refclockproc *, char const *, va_list)
 			NTP_PRINTF(2, 0);
    
 struct refclock_atom;



CVS commit: src/external/bsd/ntp/dist/include

2020-05-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri May 29 20:54:16 UTC 2020

Modified Files:
src/external/bsd/ntp/dist/include: ntp_refclock.h

Log Message:
Add more printf annotations


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/ntp/dist/include/ntp_refclock.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/include/ntp_refclock.h
diff -u src/external/bsd/ntp/dist/include/ntp_refclock.h:1.6 src/external/bsd/ntp/dist/include/ntp_refclock.h:1.7
--- src/external/bsd/ntp/dist/include/ntp_refclock.h:1.6	Mon May 25 16:47:19 2020
+++ src/external/bsd/ntp/dist/include/ntp_refclock.h	Fri May 29 16:54:16 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_refclock.h,v 1.6 2020/05/25 20:47:19 christos Exp $	*/
+/*	$NetBSD: ntp_refclock.h,v 1.7 2020/05/29 20:54:16 christos Exp $	*/
 
 /*
  * ntp_refclock.h - definitions for reference clock support
@@ -243,9 +243,11 @@ extern	void	refclock_save_lcode(
 			struct refclockproc *, char const *, size_t);
 /* format data into la_code */
 extern	void	refclock_format_lcode(
-			struct refclockproc *, char const *, ...);
+			struct refclockproc *, char const *, ...)
+			NTP_PRINTF(2, 3);
 extern	void	refclock_vformat_lcode(
 			struct refclockproc *, char const *, va_list);
+			NTP_PRINTF(2, 0);
    
 struct refclock_atom;
 extern int	refclock_ppsaugment(



CVS commit: src/external/bsd/ntp/dist/libntp

2020-05-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri May 29 20:15:14 UTC 2020

Modified Files:
src/external/bsd/ntp/dist/libntp: timexsup.c

Log Message:
Add explicit casts


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/ntp/dist/libntp/timexsup.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/libntp/timexsup.c
diff -u src/external/bsd/ntp/dist/libntp/timexsup.c:1.2 src/external/bsd/ntp/dist/libntp/timexsup.c:1.3
--- src/external/bsd/ntp/dist/libntp/timexsup.c:1.2	Mon May 25 16:47:24 2020
+++ src/external/bsd/ntp/dist/libntp/timexsup.c	Fri May 29 16:15:14 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: timexsup.c,v 1.2 2020/05/25 20:47:24 christos Exp $	*/
+/*	$NetBSD: timexsup.c,v 1.3 2020/05/29 20:15:14 christos Exp $	*/
 
 /*
  * timexsup.c - 'struct timex' support functions
@@ -30,9 +30,9 @@ clamp_rounded(
 	dval = floor(dval + 0.5);
 
 	/* clamp / saturate */
-	if (dval >= LONG_MAX)
+	if (dval >= (double)LONG_MAX)
 		return LONG_MAX;
-	if (dval <= LONG_MIN)
+	if (dval <= (double)LONG_MIN)
 		return LONG_MIN;
 	return (long)dval;
 	



CVS commit: src/external/bsd/ntp/dist

2020-05-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri May 29 20:15:38 UTC 2020

Modified Files:
src/external/bsd/ntp/dist/include: ntp_stdlib.h
src/external/bsd/ntp/dist/libntp: msyslog.c

Log Message:
fix printf format warning with format_arg


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/external/bsd/ntp/dist/include/ntp_stdlib.h
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/ntp/dist/libntp/msyslog.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/include/ntp_stdlib.h
diff -u src/external/bsd/ntp/dist/include/ntp_stdlib.h:1.16 src/external/bsd/ntp/dist/include/ntp_stdlib.h:1.17
--- src/external/bsd/ntp/dist/include/ntp_stdlib.h:1.16	Mon May 25 16:47:20 2020
+++ src/external/bsd/ntp/dist/include/ntp_stdlib.h	Fri May 29 16:15:37 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_stdlib.h,v 1.16 2020/05/25 20:47:20 christos Exp $	*/
+/*	$NetBSD: ntp_stdlib.h,v 1.17 2020/05/29 20:15:37 christos Exp $	*/
 
 /*
  * ntp_stdlib.h - Prototypes for NTP lib.
@@ -23,9 +23,11 @@
 #ifdef __GNUC__
 #define NTP_PRINTF(fmt, args) __attribute__((__format__(__printf__, fmt, args)))
 #define NTP_SYSLOG(fmt, args) __attribute__((__format__(__syslog__, fmt, args)))
+#define NTP_FORMAT_ARG(args) __attribute__((__format_arg__(args)))
 #else
 #define NTP_PRINTF(fmt, args)
 #define NTP_SYSLOG(fmt, args)
+#define NTP_FORMAT_ARG(args)
 #endif
 
 extern	int	mprintf(const char *, ...) NTP_SYSLOG(1, 2);

Index: src/external/bsd/ntp/dist/libntp/msyslog.c
diff -u src/external/bsd/ntp/dist/libntp/msyslog.c:1.6 src/external/bsd/ntp/dist/libntp/msyslog.c:1.7
--- src/external/bsd/ntp/dist/libntp/msyslog.c:1.6	Mon May 25 16:47:24 2020
+++ src/external/bsd/ntp/dist/libntp/msyslog.c	Fri May 29 16:15:38 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: msyslog.c,v 1.6 2020/05/25 20:47:24 christos Exp $	*/
+/*	$NetBSD: msyslog.c,v 1.7 2020/05/29 20:15:38 christos Exp $	*/
 
 /*
  * msyslog - either send a message to the terminal or print it on
@@ -44,11 +44,14 @@ extern char const * progname;
 
 /* Declare the local functions */
 void	addto_syslog	(int, const char *);
-#ifndef VSNPRINTF_PERCENT_M
-void	format_errmsg	(char *, size_t, const char *, int);
+#ifdef VSNPRINTF_PERCENT_M
+#define format_errmsg(buf, len, fmt, error) (fmt)
+#else
+static const char *format_errmsg(char *, size_t, const char *, int)
+NTP_FORMAT_ARG(3);
 
 /* format_errmsg() is under #ifndef VSNPRINTF_PERCENT_M above */
-void
+static const char *
 format_errmsg(
 	char *		nfmt,
 	size_t		lennfmt,
@@ -86,6 +89,7 @@ format_errmsg(
 		}
 	}
 	*n = '\0';
+	return nfmt;
 }
 #endif	/* VSNPRINTF_PERCENT_M */
 
@@ -233,9 +237,7 @@ mvsnprintf(
 	)
 {
 #ifndef VSNPRINTF_PERCENT_M
-	char		nfmt[256];
-#else
-	const char *	nfmt = fmt;
+	char		fmtbuf[256];
 #endif
 	int		errval;
 
@@ -248,12 +250,11 @@ mvsnprintf(
 #endif /* SYS_WINNT */
 		errval = errno;
 
-#ifndef VSNPRINTF_PERCENT_M
-	format_errmsg(nfmt, sizeof(nfmt), fmt, errval);
-#else
+#ifdef VSNPRINTF_PERCENT_M
 	errno = errval;
 #endif
-	return vsnprintf(buf, bufsiz, nfmt, ap);
+	return vsnprintf(buf, bufsiz,
+	format_errmsg(fmtbuf, sizeof(fmtbuf), fmt, errval), ap);
 }
 
 
@@ -265,9 +266,7 @@ mvfprintf(
 	)
 {
 #ifndef VSNPRINTF_PERCENT_M
-	char		nfmt[256];
-#else
-	const char *	nfmt = fmt;
+	char		fmtbuf[256];
 #endif
 	int		errval;
 
@@ -280,12 +279,11 @@ mvfprintf(
 #endif /* SYS_WINNT */
 		errval = errno;
 
-#ifndef VSNPRINTF_PERCENT_M
-	format_errmsg(nfmt, sizeof(nfmt), fmt, errval);
-#else
+#ifdef VSNPRINTF_PERCENT_M
 	errno = errval;
 #endif
-	return vfprintf(fp, nfmt, ap);
+	return vfprintf(fp, 
+	format_errmsg(fmtbuf, sizeof(fmtbuf), fmt, errval), ap);
 }
 
 



CVS commit: src/external/bsd/ntp/dist

2020-05-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May 27 23:52:20 UTC 2020

Modified Files:
src/external/bsd/ntp/dist/ntpd: ntp_config.c refclock_neoclock4x.c
src/external/bsd/ntp/dist/ntpq: ntpq.c
src/external/bsd/ntp/dist/util: ntp-keygen.c

Log Message:
Adjustments to our patches requested by upstream


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/external/bsd/ntp/dist/ntpd/ntp_config.c
cvs rdiff -u -r1.11 -r1.12 \
src/external/bsd/ntp/dist/ntpd/refclock_neoclock4x.c
cvs rdiff -u -r1.21 -r1.22 src/external/bsd/ntp/dist/ntpq/ntpq.c
cvs rdiff -u -r1.13 -r1.14 src/external/bsd/ntp/dist/util/ntp-keygen.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/ntp_config.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_config.c:1.22 src/external/bsd/ntp/dist/ntpd/ntp_config.c:1.23
--- src/external/bsd/ntp/dist/ntpd/ntp_config.c:1.22	Mon May 25 16:47:25 2020
+++ src/external/bsd/ntp/dist/ntpd/ntp_config.c	Wed May 27 19:52:19 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_config.c,v 1.22 2020/05/25 20:47:25 christos Exp $	*/
+/*	$NetBSD: ntp_config.c,v 1.23 2020/05/27 23:52:19 christos Exp $	*/
 
 /* ntp_config.c
  *
@@ -3892,7 +3892,7 @@ config_fudge(
 
 			case T_Refid:
 clock_stat.haveflags |= CLK_HAVEVAL2;
-/* strncpy() does exactly what we want here: */
+/* avoid using strncpy because gcc warns */
 len = strlen(curr_opt->value.s);
 if (len > sizeof(clock_stat.fudgeval2))
 	len = sizeof(clock_stat.fudgeval2);

Index: src/external/bsd/ntp/dist/ntpd/refclock_neoclock4x.c
diff -u src/external/bsd/ntp/dist/ntpd/refclock_neoclock4x.c:1.11 src/external/bsd/ntp/dist/ntpd/refclock_neoclock4x.c:1.12
--- src/external/bsd/ntp/dist/ntpd/refclock_neoclock4x.c:1.11	Mon May 25 16:47:25 2020
+++ src/external/bsd/ntp/dist/ntpd/refclock_neoclock4x.c	Wed May 27 19:52:19 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: refclock_neoclock4x.c,v 1.11 2020/05/25 20:47:25 christos Exp $	*/
+/*	$NetBSD: refclock_neoclock4x.c,v 1.12 2020/05/27 23:52:19 christos Exp $	*/
 
 /*
  *
@@ -727,6 +727,7 @@ neoclock4x_control(int unit,
   if(NULL != out)
 {
   char *tt;
+  /* the 199 here is almost 2x the max string */
   char tmpbuf[199];
 
   out->kv_list = (struct ctl_var *)0;
@@ -767,6 +768,7 @@ neoclock4x_control(int unit,
 snprintf(tt, 39, "dststatus=\"winter\"");
   else
 snprintf(tt, 39, "dststatus=\"unknown\"");
+  /* the 99 below is greater than 80 the max string */
   tt = add_var(>kv_list, 80, RO|DEF);
   snprintf(tt, 99, "firmware=\"%s\"", up->firmware);
   tt = add_var(>kv_list, 40, RO|DEF);

Index: src/external/bsd/ntp/dist/ntpq/ntpq.c
diff -u src/external/bsd/ntp/dist/ntpq/ntpq.c:1.21 src/external/bsd/ntp/dist/ntpq/ntpq.c:1.22
--- src/external/bsd/ntp/dist/ntpq/ntpq.c:1.21	Mon May 25 16:47:26 2020
+++ src/external/bsd/ntp/dist/ntpq/ntpq.c	Wed May 27 19:52:19 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntpq.c,v 1.21 2020/05/25 20:47:26 christos Exp $	*/
+/*	$NetBSD: ntpq.c,v 1.22 2020/05/27 23:52:19 christos Exp $	*/
 
 /*
  * ntpq - query an NTP server using mode 6 commands
@@ -3738,7 +3738,7 @@ cookedprint(
 		case SN:
 			if (!value)
 output_raw = '?';
-			else if (isdigit((unsigned char)*value)) {	/* number without sign */
+			else if (isdigit(*(const unsigned char *)value)) {	/* number without sign */
 bv[0] = '+';
 atoascii (value, MAXVALLEN, bv+1, sizeof(bv)-1);
 output(fp, name, bv);

Index: src/external/bsd/ntp/dist/util/ntp-keygen.c
diff -u src/external/bsd/ntp/dist/util/ntp-keygen.c:1.13 src/external/bsd/ntp/dist/util/ntp-keygen.c:1.14
--- src/external/bsd/ntp/dist/util/ntp-keygen.c:1.13	Mon May 25 16:47:37 2020
+++ src/external/bsd/ntp/dist/util/ntp-keygen.c	Wed May 27 19:52:20 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp-keygen.c,v 1.13 2020/05/25 20:47:37 christos Exp $	*/
+/*	$NetBSD: ntp-keygen.c,v 1.14 2020/05/27 23:52:20 christos Exp $	*/
 
 /*
  * Program to generate cryptographic keys for ntp clients and servers
@@ -281,7 +281,7 @@ followlink(
 
 	REQUIRE(bufsiz > 0);
 
-	len = readlink(fname, result, bufsiz);
+	len = readlink(fname, result, sizeof(result));
 	if (len < 0) {
 		fname[0] = '\0';
 		return;



CVS commit: src/external/bsd/ntp/dist/sntp/libopts

2020-05-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon May 25 20:54:08 UTC 2020

Modified Files:
src/external/bsd/ntp/dist/sntp/libopts: boolean.c configfile.c

Log Message:
Add FALLTHROUGH


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/ntp/dist/sntp/libopts/boolean.c
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/ntp/dist/sntp/libopts/configfile.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/sntp/libopts/boolean.c
diff -u src/external/bsd/ntp/dist/sntp/libopts/boolean.c:1.5 src/external/bsd/ntp/dist/sntp/libopts/boolean.c:1.6
--- src/external/bsd/ntp/dist/sntp/libopts/boolean.c:1.5	Mon May 25 16:47:34 2020
+++ src/external/bsd/ntp/dist/sntp/libopts/boolean.c	Mon May 25 16:54:07 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: boolean.c,v 1.5 2020/05/25 20:47:34 christos Exp $	*/
+/*	$NetBSD: boolean.c,v 1.6 2020/05/25 20:54:07 christos Exp $	*/
 
 
 /**
@@ -66,8 +66,8 @@ optionBooleanVal(tOptions * opts, tOptDe
 long  val = strtol(od->optArg.argString, , 0);
 if ((val != 0) || (*pz != NUL))
 break;
-/* FALLTHROUGH */
 }
+/*FALLTHROUGH*/
 case 'N':
 case 'n':
 case 'F':

Index: src/external/bsd/ntp/dist/sntp/libopts/configfile.c
diff -u src/external/bsd/ntp/dist/sntp/libopts/configfile.c:1.9 src/external/bsd/ntp/dist/sntp/libopts/configfile.c:1.10
--- src/external/bsd/ntp/dist/sntp/libopts/configfile.c:1.9	Mon May 25 16:47:34 2020
+++ src/external/bsd/ntp/dist/sntp/libopts/configfile.c	Mon May 25 16:54:07 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: configfile.c,v 1.9 2020/05/25 20:47:34 christos Exp $	*/
+/*	$NetBSD: configfile.c,v 1.10 2020/05/25 20:54:07 christos Exp $	*/
 
 /**
  * \file configfile.c
@@ -468,7 +468,7 @@ file_preset(tOptions * opts, char const 
 ftext = strchr(ftext + 2, '>');
 if (ftext++ != NULL)
 break;
-
+		/*FALLTHROUGH*/
 default:
 ftext = NULL;
 }



CVS commit: src/external/bsd/ntp/dist/ntpd

2019-04-24 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Wed Apr 24 11:55:05 UTC 2019

Modified Files:
src/external/bsd/ntp/dist/ntpd: ntp_config.c

Log Message:
Only warn about being unable to make a smaller stack if asking for debug
messages.

Between ASLR and stack clash random-sized padding, we can't make small
stacks reliably. Not doing so isn't a problem, so don't warn users about
it on every boot.

PR bin/51118


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/external/bsd/ntp/dist/ntpd/ntp_config.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/ntp_config.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_config.c:1.20 src/external/bsd/ntp/dist/ntpd/ntp_config.c:1.21
--- src/external/bsd/ntp/dist/ntpd/ntp_config.c:1.20	Mon Dec 24 02:58:39 2018
+++ src/external/bsd/ntp/dist/ntpd/ntp_config.c	Wed Apr 24 11:55:05 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_config.c,v 1.20 2018/12/24 02:58:39 christos Exp $	*/
+/*	$NetBSD: ntp_config.c,v 1.21 2019/04/24 11:55:05 maya Exp $	*/
 
 /* ntp_config.c
  *
@@ -5252,7 +5252,7 @@ ntp_rlimit(
 			}
 			rl.rlim_cur = rl_value;
 			if (-1 == setrlimit(RLIMIT_STACK, )) {
-msyslog(LOG_ERR,
+msyslog(LOG_DEBUG,
 	"ntp_rlimit: Cannot set RLIMIT_STACK: %m");
 			}
 		}



CVS commit: src/external/bsd/ntp/dist/sntp

2019-01-26 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Jan 27 04:28:19 UTC 2019

Modified Files:
src/external/bsd/ntp/dist/sntp: crypto.c

Log Message:
fix duplicated chunk from merge


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/external/bsd/ntp/dist/sntp/crypto.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/sntp/crypto.c
diff -u src/external/bsd/ntp/dist/sntp/crypto.c:1.16 src/external/bsd/ntp/dist/sntp/crypto.c:1.17
--- src/external/bsd/ntp/dist/sntp/crypto.c:1.16	Sun Jan 27 02:08:34 2019
+++ src/external/bsd/ntp/dist/sntp/crypto.c	Sun Jan 27 04:28:18 2019
@@ -1,12 +1,4 @@
-/*	$NetBSD: crypto.c,v 1.16 2019/01/27 02:08:34 pgoyette Exp $	*/
-
-/*
- * HMS: we need to test:
- * - OpenSSL versions, if we are building with them
- * - our versions
- *
- * We may need to test with(out) OPENSSL separately.
- */
+/*	$NetBSD: crypto.c,v 1.17 2019/01/27 04:28:18 dholland Exp $	*/
 
 /*
  * HMS: we need to test:



CVS commit: src/external/bsd/ntp/dist/ntpdate

2018-12-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Dec 26 18:31:29 UTC 2018

Modified Files:
src/external/bsd/ntp/dist/ntpdate: ntpdate.c

Log Message:
PR/53813: Edgar Pettijohn: Print usage message if no servers are found.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/bsd/ntp/dist/ntpdate/ntpdate.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpdate/ntpdate.c
diff -u src/external/bsd/ntp/dist/ntpdate/ntpdate.c:1.12 src/external/bsd/ntp/dist/ntpdate/ntpdate.c:1.13
--- src/external/bsd/ntp/dist/ntpdate/ntpdate.c:1.12	Sat Sep 29 17:52:34 2018
+++ src/external/bsd/ntp/dist/ntpdate/ntpdate.c	Wed Dec 26 13:31:29 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntpdate.c,v 1.12 2018/09/29 21:52:34 christos Exp $	*/
+/*	$NetBSD: ntpdate.c,v 1.13 2018/12/26 18:31:29 christos Exp $	*/
 
 /*
  * ntpdate - set the time of day by polling one or more NTP servers
@@ -433,6 +433,7 @@ ntpdatemain (
 	}
 
 	if (errflg) {
+usage:
 		(void) fprintf(stderr,
 		"usage: %s [-46bBdqsuv] [-a key#] [-e delay] [-k file] [-p samples] [-o version#] [-t timeo] server ...\n",
 		progname);
@@ -509,7 +510,7 @@ ntpdatemain (
 
 	if (sys_numservers == 0) {
 		msyslog(LOG_ERR, "no servers can be used, exiting");
-		exit(1);
+		goto usage;
 	}
 
 	/*



CVS commit: src/external/bsd/ntp/dist/ntpd

2018-12-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Dec 24 02:58:39 UTC 2018

Modified Files:
src/external/bsd/ntp/dist/ntpd: ntp_config.c

Log Message:
only use yydebug if YYDEBUG


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/external/bsd/ntp/dist/ntpd/ntp_config.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/ntp_config.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_config.c:1.19 src/external/bsd/ntp/dist/ntpd/ntp_config.c:1.20
--- src/external/bsd/ntp/dist/ntpd/ntp_config.c:1.19	Sat Sep 29 17:52:33 2018
+++ src/external/bsd/ntp/dist/ntpd/ntp_config.c	Sun Dec 23 21:58:39 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_config.c,v 1.19 2018/09/29 21:52:33 christos Exp $	*/
+/*	$NetBSD: ntp_config.c,v 1.20 2018/12/24 02:58:39 christos Exp $	*/
 
 /* ntp_config.c
  *
@@ -4750,7 +4750,7 @@ getconfig(
 
 
 	/*** BULK OF THE PARSER ***/
-#ifdef DEBUG
+#if defined(DEBUG) && defined(YYDEBUG)
 	yydebug = !!(debug >= 5);
 #endif
 	yyparse();



CVS commit: src/external/bsd/ntp/dist/ntpd

2018-10-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 20 02:30:43 UTC 2018

Modified Files:
src/external/bsd/ntp/dist/ntpd: ntpd.c

Log Message:
Don't try to drop privileges twice, it produces a spurious error message
in the forked child.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/external/bsd/ntp/dist/ntpd/ntpd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/ntpd.c
diff -u src/external/bsd/ntp/dist/ntpd/ntpd.c:1.16 src/external/bsd/ntp/dist/ntpd/ntpd.c:1.17
--- src/external/bsd/ntp/dist/ntpd/ntpd.c:1.16	Sat Sep 29 17:52:33 2018
+++ src/external/bsd/ntp/dist/ntpd/ntpd.c	Fri Oct 19 22:30:43 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntpd.c,v 1.16 2018/09/29 21:52:33 christos Exp $	*/
+/*	$NetBSD: ntpd.c,v 1.17 2018/10/20 02:30:43 christos Exp $	*/
 
 /*
  * ntpd.c - main program for the fixed point NTP daemon
@@ -688,24 +688,9 @@ getgroup:
 	return 1;
 }
 
-/*
- * Change (effective) user and group IDs, also initialize the supplementary group access list
- */
-int set_user_group_ids(void);
-int
-set_user_group_ids(void)
+static int
+set_group_ids(void)
 {
-	/* If the the user was already mapped, no need to map it again */
-	if ((NULL != user) && (0 == sw_uid)) {
-		if (0 == map_user())
-			exit (-1);
-	}
-	/* same applies for the group */
-	if ((NULL != group) && (0 == sw_gid)) {
-		if (0 == map_group())
-			exit (-1);
-	}
-
 	if (user && initgroups(user, sw_gid)) {
 		msyslog(LOG_ERR, "Cannot initgroups() to user `%s': %m", user);
 		return 0;
@@ -729,6 +714,12 @@ set_user_group_ids(void)
 			msyslog(LOG_ERR, "initgroups(<%s>, %d) filed: %m", pw->pw_name, pw->pw_gid);
 			return 0;
 		}
+	return 1;
+}
+
+static int
+set_user_ids(void)
+{
 	if (user && setuid(sw_uid)) {
 		msyslog(LOG_ERR, "Cannot setuid() to user `%s': %m", user);
 		return 0;
@@ -737,6 +728,31 @@ set_user_group_ids(void)
 		msyslog(LOG_ERR, "Cannot seteuid() to user `%s': %m", user);
 		return 0;
 	}
+	return 1;
+}
+
+/*
+ * Change (effective) user and group IDs, also initialize the supplementary group access list
+ */
+int set_user_group_ids(void);
+int
+set_user_group_ids(void)
+{
+	/* If the the user was already mapped, no need to map it again */
+	if ((NULL != user) && (0 == sw_uid)) {
+		if (0 == map_user())
+			exit (-1);
+	}
+	/* same applies for the group */
+	if ((NULL != group) && (0 == sw_gid)) {
+		if (0 == map_group())
+			exit (-1);
+	}
+
+	if (getegid() != sw_gid && 0 == set_group_ids())
+		return 0;
+	if (geteuid() != sw_uid && 0 == set_user_ids())
+		return 0;
 
 	return 1;
 }



CVS commit: src/external/bsd/ntp/dist/ntpd

2017-04-11 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Tue Apr 11 14:17:34 UTC 2017

Modified Files:
src/external/bsd/ntp/dist/ntpd: ntp_io.c

Log Message:
Use RO_MSGFILTER.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/external/bsd/ntp/dist/ntpd/ntp_io.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/ntp_io.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.23 src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.24
--- src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.23	Fri Jun  3 20:39:02 2016
+++ src/external/bsd/ntp/dist/ntpd/ntp_io.c	Tue Apr 11 14:17:34 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_io.c,v 1.23 2016/06/03 20:39:02 christos Exp $	*/
+/*	$NetBSD: ntp_io.c,v 1.24 2017/04/11 14:17:34 roy Exp $	*/
 
 /*
  * ntp_io.c - input/output routines for ntpd.	The socket-opening code
@@ -4795,6 +4795,50 @@ init_async_notifications()
 #else
 	int fd = socket(PF_ROUTE, SOCK_RAW, 0);
 #endif
+#ifdef RO_MSGFILTER
+	unsigned char msgfilter[] = {
+#ifdef RTM_NEWADDR
+		RTM_NEWADDR,
+#endif
+#ifdef RTM_DELADDR
+		RTM_DELADDR,
+#endif
+#ifdef RTM_ADD
+		RTM_ADD,
+#endif
+#ifdef RTM_DELETE
+		RTM_DELETE,
+#endif
+#ifdef RTM_REDIRECT
+		RTM_REDIRECT,
+#endif
+#ifdef RTM_CHANGE
+		RTM_CHANGE,
+#endif
+#ifdef RTM_LOSING
+		RTM_LOSING,
+#endif
+#ifdef RTM_IFINFO
+		RTM_IFINFO,
+#endif
+#ifdef RTM_IFANNOUNCE
+		RTM_IFANNOUNCE,
+#endif
+#ifdef RTM_NEWLINK
+		RTM_NEWLINK,
+#endif
+#ifdef RTM_DELLINK
+		RTM_DELLINK,
+#endif
+#ifdef RTM_NEWROUTE
+		RTM_NEWROUTE,
+#endif
+#ifdef RTM_DELROUTE
+		RTM_DELROUTE,
+#endif
+	};
+#endif /* !RO_MSGFILTER */
+
 	if (fd < 0) {
 		msyslog(LOG_ERR,
 			"unable to open routing socket (%m) - using polled interface update");
@@ -4815,6 +4859,11 @@ init_async_notifications()
 		return;
 	}
 #endif
+#ifdef RO_MSGFILTER
+	if (setsockopt(fd, PF_ROUTE, RO_MSGFILTER,
+	, sizeof(msgfilter)) == -1)
+		msyslog(LOG_ERR, "RO_MSGFILTER: %m");
+#endif
 	make_socket_nonblocking(fd);
 #if defined(HAVE_SIGNALED_IO)
 	init_socket_sig(fd);



CVS commit: src/external/bsd/ntp/dist/libntp

2015-12-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Dec  2 02:04:06 UTC 2015

Modified Files:
src/external/bsd/ntp/dist/libntp: authkeys.c

Log Message:
Don't bother calling log for values <= 1... XXX: should use ilog() instead.
Fixes vax.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/ntp/dist/libntp/authkeys.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/libntp/authkeys.c
diff -u src/external/bsd/ntp/dist/libntp/authkeys.c:1.7 src/external/bsd/ntp/dist/libntp/authkeys.c:1.8
--- src/external/bsd/ntp/dist/libntp/authkeys.c:1.7	Fri Oct 23 14:06:19 2015
+++ src/external/bsd/ntp/dist/libntp/authkeys.c	Tue Dec  1 21:04:06 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: authkeys.c,v 1.7 2015/10/23 18:06:19 christos Exp $	*/
+/*	$NetBSD: authkeys.c,v 1.8 2015/12/02 02:04:06 christos Exp $	*/
 
 /*
  * authkeys.c - routines to manage the storage of authentication keys
@@ -236,7 +236,7 @@ auth_resize_hashtable(void)
 	symkey *	sk;
 
 	totalkeys = authnumkeys + authnumfreekeys;
-	hashbits = auth_log2(totalkeys / 4.0) + 1;
+	hashbits = (totalkeys <= 4 ? 0 : auth_log2(totalkeys / 4.0)) + 1;
 	hashbits = max(4, hashbits);
 	hashbits = min(15, hashbits);
 



CVS commit: src/external/bsd/ntp/dist/sntp/libopts

2015-11-30 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Mon Nov 30 10:37:25 UTC 2015

Modified Files:
src/external/bsd/ntp/dist/sntp/libopts: enum.c

Log Message:
As far as I (and my compiler) can tell, there's no need to cast
the arg to strncmp().


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/ntp/dist/sntp/libopts/enum.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/sntp/libopts/enum.c
diff -u src/external/bsd/ntp/dist/sntp/libopts/enum.c:1.5 src/external/bsd/ntp/dist/sntp/libopts/enum.c:1.6
--- src/external/bsd/ntp/dist/sntp/libopts/enum.c:1.5	Fri Jul 10 14:20:35 2015
+++ src/external/bsd/ntp/dist/sntp/libopts/enum.c	Mon Nov 30 10:37:25 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: enum.c,v 1.5 2015/07/10 14:20:35 christos Exp $	*/
+/*	$NetBSD: enum.c,v 1.6 2015/11/30 10:37:25 he Exp $	*/
 
 
 /**
@@ -217,7 +217,7 @@ find_name(char const * name, tOptions * 
  *  Multiple partial matches means we have an ambiguous match.
  */
 for (idx = 0; idx < name_ct; idx++) {
-if (strncmp(paz_names[idx], (const char *)name, len) == 0) {
+if (strncmp(paz_names[idx], name, len) == 0) {
 if (paz_names[idx][len] == NUL)
 return idx;  /* full match */
 



CVS commit: src/external/bsd/ntp/dist

2015-10-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Oct 14 15:55:43 UTC 2015

Modified Files:
src/external/bsd/ntp/dist/include: ntp_stdlib.h
src/external/bsd/ntp/dist/ntpd: refclock_jupiter.c refclock_oncore.c

Log Message:
introduce an NTP_SYSLOG macro.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/ntp/dist/include/ntp_stdlib.h
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/ntp/dist/ntpd/refclock_jupiter.c
cvs rdiff -u -r1.11 -r1.12 src/external/bsd/ntp/dist/ntpd/refclock_oncore.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/include/ntp_stdlib.h
diff -u src/external/bsd/ntp/dist/include/ntp_stdlib.h:1.9 src/external/bsd/ntp/dist/include/ntp_stdlib.h:1.10
--- src/external/bsd/ntp/dist/include/ntp_stdlib.h:1.9	Fri Jul 10 10:20:29 2015
+++ src/external/bsd/ntp/dist/include/ntp_stdlib.h	Wed Oct 14 11:55:42 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_stdlib.h,v 1.9 2015/07/10 14:20:29 christos Exp $	*/
+/*	$NetBSD: ntp_stdlib.h,v 1.10 2015/10/14 15:55:42 christos Exp $	*/
 
 /*
  * ntp_stdlib.h - Prototypes for NTP lib.
@@ -21,18 +21,20 @@
 
 #ifdef __GNUC__
 #define NTP_PRINTF(fmt, args) __attribute__((__format__(__printf__, fmt, args)))
+#define NTP_SYSLOG(fmt, args) __attribute__((__format__(__syslog__, fmt, args)))
 #else
 #define NTP_PRINTF(fmt, args)
+#define NTP_SYSLOG(fmt, args)
 #endif
 
-extern	int	mprintf(const char *, ...) NTP_PRINTF(1, 2);
-extern	int	mfprintf(FILE *, const char *, ...) NTP_PRINTF(2, 3);
-extern	int	mvfprintf(FILE *, const char *, va_list) NTP_PRINTF(2, 0);
+extern	int	mprintf(const char *, ...) NTP_SYSLOG(1, 2);
+extern	int	mfprintf(FILE *, const char *, ...) NTP_SYSLOG(2, 3);
+extern	int	mvfprintf(FILE *, const char *, va_list) NTP_SYSLOG(2, 0);
 extern	int	mvsnprintf(char *, size_t, const char *, va_list)
-			NTP_PRINTF(3, 0);
+			NTP_SYSLOG(3, 0);
 extern	int	msnprintf(char *, size_t, const char *, ...)
-			NTP_PRINTF(3, 4);
-extern	void	msyslog(int, const char *, ...) NTP_PRINTF(2, 3);
+			NTP_SYSLOG(3, 4);
+extern	void	msyslog(int, const char *, ...) NTP_SYSLOG(2, 3);
 extern	void	init_logging	(const char *, u_int32, int);
 extern	int	change_logfile	(const char *, int);
 extern	void	setup_logfile	(const char *);

Index: src/external/bsd/ntp/dist/ntpd/refclock_jupiter.c
diff -u src/external/bsd/ntp/dist/ntpd/refclock_jupiter.c:1.8 src/external/bsd/ntp/dist/ntpd/refclock_jupiter.c:1.9
--- src/external/bsd/ntp/dist/ntpd/refclock_jupiter.c:1.8	Fri Jul 10 10:20:33 2015
+++ src/external/bsd/ntp/dist/ntpd/refclock_jupiter.c	Wed Oct 14 11:55:43 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: refclock_jupiter.c,v 1.8 2015/07/10 14:20:33 christos Exp $	*/
+/*	$NetBSD: refclock_jupiter.c,v 1.9 2015/10/14 15:55:43 christos Exp $	*/
 
 /*
  * Copyright (c) 1997, 1998, 2003
@@ -136,8 +136,7 @@ static	void	jupiter_canmsg	(struct insta
 static	u_short	jupiter_cksum	(u_short *, u_int);
 static	int	jupiter_config	(struct instance *);
 static	void	jupiter_debug	(struct peer *, const char *,
- const char *, ...)
-			__attribute__ ((format (printf, 3, 4)));
+ const char *, ...) NTP_SYSLOG(3, 4);
 static	const char *	jupiter_parse_t	(struct instance *, u_short *);
 static	const char *	jupiter_parse_gpos	(struct instance *, u_short *);
 static	void	jupiter_platform	(struct instance *, u_int);

Index: src/external/bsd/ntp/dist/ntpd/refclock_oncore.c
diff -u src/external/bsd/ntp/dist/ntpd/refclock_oncore.c:1.11 src/external/bsd/ntp/dist/ntpd/refclock_oncore.c:1.12
--- src/external/bsd/ntp/dist/ntpd/refclock_oncore.c:1.11	Fri Jul 10 10:20:33 2015
+++ src/external/bsd/ntp/dist/ntpd/refclock_oncore.c	Wed Oct 14 11:55:43 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: refclock_oncore.c,v 1.11 2015/07/10 14:20:33 christos Exp $	*/
+/*	$NetBSD: refclock_oncore.c,v 1.12 2015/10/14 15:55:43 christos Exp $	*/
 
 /*
  * 
@@ -380,7 +380,7 @@ static	void	oncore_compute_dH (struc
 static	void	oncore_load_almanac   (struct instance *);
 static	void	oncore_log	  (struct instance *, int, const char *);
 static	int	oncore_log_f	  (struct instance *, int, const char *, ...)
-		NTP_PRINTF(3, 4);
+		NTP_SYSLOG(3, 4);
 static	void	oncore_print_Cb   (struct instance *, u_char *);
 /* static  voidoncore_print_array	 (u_char *, int);	*/
 static	void	oncore_print_posn (struct instance *);



CVS commit: src/external/bsd/ntp/dist/ntpd

2015-07-20 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon Jul 20 13:13:31 UTC 2015

Modified Files:
src/external/bsd/ntp/dist/ntpd: ntp_timer.c

Log Message:
Don't use fabs on integers.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/ntp/dist/ntpd/ntp_timer.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/ntp_timer.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_timer.c:1.3 src/external/bsd/ntp/dist/ntpd/ntp_timer.c:1.4
--- src/external/bsd/ntp/dist/ntpd/ntp_timer.c:1.3	Fri Jul 10 14:20:32 2015
+++ src/external/bsd/ntp/dist/ntpd/ntp_timer.c	Mon Jul 20 13:13:31 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_timer.c,v 1.3 2015/07/10 14:20:32 christos Exp $	*/
+/*	$NetBSD: ntp_timer.c,v 1.4 2015/07/20 13:13:31 joerg Exp $	*/
 
 /*
  * ntp_timer.c - event timer support routines
@@ -624,7 +624,7 @@ check_leapsec(
 		const char *leapmsg = NULL;
 		if (lsdata.warped  0) {
 			if (clock_max_back  0.0 
-			clock_max_back  fabs(lsdata.warped)) {
+			clock_max_back  abs(lsdata.warped)) {
 step_systime(lsdata.warped);
 leapmsg = leapmsg_p_step;
 			} else {
@@ -632,7 +632,7 @@ check_leapsec(
 			}
 		} else 	if (lsdata.warped  0) {
 			if (clock_max_fwd  0.0 
-			clock_max_fwd  fabs(lsdata.warped)) {
+			clock_max_fwd  abs(lsdata.warped)) {
 step_systime(lsdata.warped);
 leapmsg = leapmsg_n_step;
 			} else {



CVS commit: src/external/bsd/ntp/dist/libntp

2015-07-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jul 20 15:35:00 UTC 2015

Modified Files:
src/external/bsd/ntp/dist/libntp: work_fork.c

Log Message:
we set SIGCHLD to SIG_IGN so we are not going to generate zombies so it
will be an error to wait.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/ntp/dist/libntp/work_fork.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/libntp/work_fork.c
diff -u src/external/bsd/ntp/dist/libntp/work_fork.c:1.6 src/external/bsd/ntp/dist/libntp/work_fork.c:1.7
--- src/external/bsd/ntp/dist/libntp/work_fork.c:1.6	Fri Jul 17 11:17:07 2015
+++ src/external/bsd/ntp/dist/libntp/work_fork.c	Mon Jul 20 11:35:00 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: work_fork.c,v 1.6 2015/07/17 15:17:07 christos Exp $	*/
+/*	$NetBSD: work_fork.c,v 1.7 2015/07/20 15:35:00 christos Exp $	*/
 
 /*
  * work_fork.c - fork implementation for blocking worker child.
@@ -127,7 +127,13 @@ harvest_child_status(
 		/* Wait on the child so it can finish terminating */
 		if (waitpid(c-pid, NULL, 0) == c-pid)
 			TRACE(4, (harvested child %d\n, c-pid));
-		else msyslog(LOG_ERR, error waiting on child %d: %m, c-pid);
+		else if (errno != ECHILD) {
+			/*
+			 * SIG_IGN on SIGCHLD on some os's means do not wait
+			 * but reap automaticallyi
+			 */
+			msyslog(LOG_ERR, error waiting on child %d: %m, c-pid);
+		}
 		c-pid = 0;
 	}
 }



CVS commit: src/external/bsd/ntp/dist/libntp

2015-07-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jul 17 15:17:07 UTC 2015

Modified Files:
src/external/bsd/ntp/dist/libntp: work_fork.c

Log Message:
PR/50048: Martin Husemann: Avoid reaping the child twice by setting c-pid = 0
after the wait.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/ntp/dist/libntp/work_fork.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/libntp/work_fork.c
diff -u src/external/bsd/ntp/dist/libntp/work_fork.c:1.5 src/external/bsd/ntp/dist/libntp/work_fork.c:1.6
--- src/external/bsd/ntp/dist/libntp/work_fork.c:1.5	Fri Jul 10 10:20:32 2015
+++ src/external/bsd/ntp/dist/libntp/work_fork.c	Fri Jul 17 11:17:07 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: work_fork.c,v 1.5 2015/07/10 14:20:32 christos Exp $	*/
+/*	$NetBSD: work_fork.c,v 1.6 2015/07/17 15:17:07 christos Exp $	*/
 
 /*
  * work_fork.c - fork implementation for blocking worker child.
@@ -128,6 +128,7 @@ harvest_child_status(
 		if (waitpid(c-pid, NULL, 0) == c-pid)
 			TRACE(4, (harvested child %d\n, c-pid));
 		else msyslog(LOG_ERR, error waiting on child %d: %m, c-pid);
+		c-pid = 0;
 	}
 }
 
@@ -164,7 +165,6 @@ cleanup_after_child(
 		close(c-resp_read_pipe);
 		c-resp_read_pipe = -1;
 	}
-	c-pid = 0;
 	c-resp_read_ctx = NULL;
 	DEBUG_INSIST(-1 == c-req_read_pipe);
 	DEBUG_INSIST(-1 == c-resp_write_pipe);



CVS commit: src/external/bsd/ntp/dist/ntpd

2015-07-10 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Fri Jul 10 21:31:19 UTC 2015

Modified Files:
src/external/bsd/ntp/dist/ntpd: ntp_control.c

Log Message:
backport fix for bug 2867 -  ntpd with autokey active crashed by 'ntpq -crv'


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/bsd/ntp/dist/ntpd/ntp_control.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/ntp_control.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_control.c:1.12 src/external/bsd/ntp/dist/ntpd/ntp_control.c:1.13
--- src/external/bsd/ntp/dist/ntpd/ntp_control.c:1.12	Fri Jul 10 14:20:32 2015
+++ src/external/bsd/ntp/dist/ntpd/ntp_control.c	Fri Jul 10 21:31:19 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_control.c,v 1.12 2015/07/10 14:20:32 christos Exp $	*/
+/*	$NetBSD: ntp_control.c,v 1.13 2015/07/10 21:31:19 kardel Exp $	*/
 
 /*
  * ntp_control.c - respond to mode 6 control messages and send async
@@ -422,10 +422,10 @@ static const struct ctl_var sys_var[] = 
 	{ CS_TIMER_XMTS,	RO, timer_xmts },	/* 87 */
 	{ CS_FUZZ,		RO, fuzz },		/* 88 */
 	{ CS_WANDER_THRESH,	RO, clk_wander_threshold }, /* 89 */
-#ifdef LEAP_SMEAR
+
 	{ CS_LEAPSMEARINTV,	RO, leapsmearinterval },/* 90 */
 	{ CS_LEAPSMEAROFFS,	RO, leapsmearoffset },  /* 91 */
-#endif	 /* LEAP_SMEAR */
+
 #ifdef AUTOKEY
 	{ CS_FLAGS,	RO, flags },		/* 1 + CS_MAX_NOAUTOKEY */
 	{ CS_HOST,	RO, host },		/* 2 + CS_MAX_NOAUTOKEY */
@@ -2404,6 +2404,9 @@ ctl_putsys(
 			ntohl(hostval.tstamp));
 		break;
 #endif	/* AUTOKEY */
+
+	default:
+		break;
 	}
 }
 



CVS commit: src/external/bsd/ntp/dist/ntpq

2015-06-28 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sun Jun 28 15:37:37 UTC 2015

Modified Files:
src/external/bsd/ntp/dist/ntpq: ntpq-subs.c

Log Message:
fix ifstats command by relaxing invalid sanity check - ntp bug #2860


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/ntp/dist/ntpq/ntpq-subs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpq/ntpq-subs.c
diff -u src/external/bsd/ntp/dist/ntpq/ntpq-subs.c:1.9 src/external/bsd/ntp/dist/ntpq/ntpq-subs.c:1.10
--- src/external/bsd/ntp/dist/ntpq/ntpq-subs.c:1.9	Tue Apr  7 17:34:19 2015
+++ src/external/bsd/ntp/dist/ntpq/ntpq-subs.c	Sun Jun 28 15:37:37 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntpq-subs.c,v 1.9 2015/04/07 17:34:19 christos Exp $	*/
+/*	$NetBSD: ntpq-subs.c,v 1.10 2015/06/28 15:37:37 kardel Exp $	*/
 
 /*
  * ntpq-subs.c - subroutines which are called to perform ntpq commands.
@@ -3101,7 +3101,7 @@ validate_ifnum(
 {
 	if (prow-ifnum == ifnum)
 		return;
-	if (prow-ifnum + 1 == ifnum) {
+	if (prow-ifnum + 1 = ifnum) {
 		if (*pfields  IFSTATS_FIELDS)
 			fprintf(fp, Warning: incomplete row with %d (of %d) fields,
 *pfields, IFSTATS_FIELDS);



CVS commit: src/external/bsd/ntp/dist/ntpd

2015-05-02 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Sat May  2 14:46:51 UTC 2015

Modified Files:
src/external/bsd/ntp/dist/ntpd: ntp_io.c

Log Message:
Don't bind to IN_IFF_TENTATIVE or IN_IFF_DETACHED addresses.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/external/bsd/ntp/dist/ntpd/ntp_io.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/ntp_io.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.17 src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.18
--- src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.17	Tue Apr  7 17:34:19 2015
+++ src/external/bsd/ntp/dist/ntpd/ntp_io.c	Sat May  2 14:46:51 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_io.c,v 1.17 2015/04/07 17:34:19 christos Exp $	*/
+/*	$NetBSD: ntp_io.c,v 1.18 2015/05/02 14:46:51 roy Exp $	*/
 
 /*
  * ntp_io.c - input/output routines for ntpd.	The socket-opening code
@@ -1647,6 +1647,34 @@ set_wildcard_reuse(
 }
 #endif /* OS_NEEDS_REUSEADDR_FOR_IFADDRBIND */
 
+static isc_boolean_t
+check_flags(
+	sockaddr_u *psau,
+	const char *name,
+	u_int32 flags
+	)
+{
+#if defined(SIOCGIFAFLAG_IN)
+	struct ifreq ifr;
+	int fd;
+
+	if (psau-sa.sa_family != AF_INET)
+		return ISC_FALSE;
+	if ((fd = socket(AF_INET, SOCK_DGRAM, 0))  0)
+		return ISC_FALSE;
+	ZERO(ifr);
+	memcpy(ifr.ifr_addr, psau-sa, sizeof(ifr.ifr_addr));
+	strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name));
+	if (ioctl(fd, SIOCGIFAFLAG_IN, ifr)  0) {
+		close(fd);
+		return ISC_FALSE;
+	}
+	close(fd);
+	if ((ifr.ifr_addrflags  flags) != 0)
+		return ISC_TRUE;
+#endif	/* SIOCGIFAFLAG_IN */
+	return ISC_FALSE;
+}
 
 static isc_boolean_t
 check_flags6(
@@ -1696,19 +1724,32 @@ is_valid(
 	const char *name
 	)
 {
-	u_int32 flags6;
+	u_int32 flags;
 
-	flags6 = 0;
+	flags = 0;
+	switch (psau-sa.sa_family) {
+	case AF_INET:
+#ifdef IN_IFF_DETACHED
+		flags |= IN_IFF_DETACHED;
+#endif
+#ifdef IN_IFF_TENTATIVE
+		flags |= IN_IFF_TENTATIVE;
+#endif
+		return check_flags(psau, name, flags) ? ISC_FALSE : ISC_TRUE;
+	case AF_INET6:
 #ifdef IN6_IFF_DEPARTED
-	flags6 |= IN6_IFF_DEPARTED;
+		flags |= IN6_IFF_DEPARTED;
 #endif
 #ifdef IN6_IFF_DETACHED
-	flags6 |= IN6_IFF_DETACHED;
+		flags |= IN6_IFF_DETACHED;
 #endif
 #ifdef IN6_IFF_TENTATIVE
-	flags6 |= IN6_IFF_TENTATIVE;
+		flags |= IN6_IFF_TENTATIVE;
 #endif
-	return check_flags6(psau, name, flags6) ? ISC_FALSE : ISC_TRUE;
+		return check_flags6(psau, name, flags) ? ISC_FALSE : ISC_TRUE;
+	default:
+		return ISC_FALSE;
+	}
 }
 
 /*



CVS commit: src/external/bsd/ntp/dist/ntpd

2015-04-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Apr 13 17:45:19 UTC 2015

Modified Files:
src/external/bsd/ntp/dist/ntpd: refclock_shm.c

Log Message:
CID 1269537: Unreachable code


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/ntp/dist/ntpd/refclock_shm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/refclock_shm.c
diff -u src/external/bsd/ntp/dist/ntpd/refclock_shm.c:1.4 src/external/bsd/ntp/dist/ntpd/refclock_shm.c:1.5
--- src/external/bsd/ntp/dist/ntpd/refclock_shm.c:1.4	Tue Apr  7 13:34:19 2015
+++ src/external/bsd/ntp/dist/ntpd/refclock_shm.c	Mon Apr 13 13:45:19 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: refclock_shm.c,v 1.4 2015/04/07 17:34:19 christos Exp $	*/
+/*	$NetBSD: refclock_shm.c,v 1.5 2015/04/13 17:45:19 christos Exp $	*/
 
 /*
  * refclock_shm - clock driver for utc via shared memory
@@ -197,9 +197,8 @@ getShmTime(
 		return NULL;
 	}
 
-#endif
-
 	return p;
+#endif
 }
 /*
  * shm_start - attach to shared memory



CVS commit: src/external/bsd/ntp/dist/ntpd

2015-01-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jan 27 02:37:18 UTC 2015

Modified Files:
src/external/bsd/ntp/dist/ntpd: refclock_parse.c

Log Message:
put back initialization of the buffer which was accidentally removed.
XXX: pullup-7.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/external/bsd/ntp/dist/ntpd/refclock_parse.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/refclock_parse.c
diff -u src/external/bsd/ntp/dist/ntpd/refclock_parse.c:1.13 src/external/bsd/ntp/dist/ntpd/refclock_parse.c:1.14
--- src/external/bsd/ntp/dist/ntpd/refclock_parse.c:1.13	Fri Dec 19 15:43:17 2014
+++ src/external/bsd/ntp/dist/ntpd/refclock_parse.c	Mon Jan 26 21:37:18 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: refclock_parse.c,v 1.13 2014/12/19 20:43:17 christos Exp $	*/
+/*	$NetBSD: refclock_parse.c,v 1.14 2015/01/27 02:37:18 christos Exp $	*/
 
 /*
  * /src/NTP/REPOSITORY/ntp4-dev/ntpd/refclock_parse.c,v 4.81 2009/05/01 10:15:29 kardel RELEASE_20090105_A
@@ -2535,6 +2535,7 @@ parsestate(
 	int i;
 	char *s, *t;
 
+	*buffer = '\0';
 	s = t = buffer;
 
 	i = 0;



CVS commit: src/external/bsd/ntp/dist/ntpd

2014-12-23 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Dec 23 15:47:32 UTC 2014

Modified Files:
src/external/bsd/ntp/dist/ntpd: refclock_gpsdjson.c

Log Message:
myasprintf (wtf) passes down a format string, so use __printflike.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/ntp/dist/ntpd/refclock_gpsdjson.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/refclock_gpsdjson.c
diff -u src/external/bsd/ntp/dist/ntpd/refclock_gpsdjson.c:1.3 src/external/bsd/ntp/dist/ntpd/refclock_gpsdjson.c:1.4
--- src/external/bsd/ntp/dist/ntpd/refclock_gpsdjson.c:1.3	Mon Dec 22 04:21:47 2014
+++ src/external/bsd/ntp/dist/ntpd/refclock_gpsdjson.c	Tue Dec 23 15:47:32 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: refclock_gpsdjson.c,v 1.3 2014/12/22 04:21:47 christos Exp $	*/
+/*	$NetBSD: refclock_gpsdjson.c,v 1.4 2014/12/23 15:47:32 joerg Exp $	*/
 
 /*
  * refclock_gpsdjson.c - clock driver as GPSD JSON client
@@ -120,7 +120,7 @@ static	void	gpsd_control	(int, const str
 static	void	gpsd_timer	(int, peerT *);
 static  voidgpsd_clockstats (int, peerT *);
 
-static  int myasprintf(char**, char const*, ...);
+static  int myasprintf(char**, char const*, ...) __printflike(2, 3);
 
 struct refclock refclock_gpsdjson = {
 	gpsd_start,		/* start up driver */



CVS commit: src/external/bsd/ntp/dist/ntpd

2014-12-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Dec 22 04:21:47 UTC 2014

Modified Files:
src/external/bsd/ntp/dist/ntpd: refclock_gpsdjson.c

Log Message:
avoid shadowing of log2 on some platforms.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/ntp/dist/ntpd/refclock_gpsdjson.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/refclock_gpsdjson.c
diff -u src/external/bsd/ntp/dist/ntpd/refclock_gpsdjson.c:1.2 src/external/bsd/ntp/dist/ntpd/refclock_gpsdjson.c:1.3
--- src/external/bsd/ntp/dist/ntpd/refclock_gpsdjson.c:1.2	Fri Dec 19 15:43:17 2014
+++ src/external/bsd/ntp/dist/ntpd/refclock_gpsdjson.c	Sun Dec 21 23:21:47 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: refclock_gpsdjson.c,v 1.2 2014/12/19 20:43:17 christos Exp $	*/
+/*	$NetBSD: refclock_gpsdjson.c,v 1.3 2014/12/22 04:21:47 christos Exp $	*/
 
 /*
  * refclock_gpsdjson.c - clock driver as GPSD JSON client
@@ -856,7 +856,7 @@ process_tpv(
 	const char * gps_time;
 	int  gps_mode;
 	double   ept, epp, epx, epy, epv;
-	int  log2;
+	int  xlog2;
 
 	gps_mode = (int)json_object_lookup_int_default(
 		jctx, 0, mode, 0);
@@ -922,9 +922,9 @@ process_tpv(
 	ept = min(ept, epp  );
 	ept = min(ept, 0.5  );
 	ept = max(ept, 1.0-9);
-	ept = frexp(ept, log2);
+	ept = frexp(ept, xlog2);
 
-	peer-precision = log2;
+	peer-precision = xlog2;
 }
 
 /* -- */



CVS commit: src/external/bsd/ntp/dist/ntpd

2014-12-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Dec 22 04:23:58 UTC 2014

Modified Files:
src/external/bsd/ntp/dist/ntpd: refclock_nmea.c

Log Message:
avoid shadowing of recv.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/ntp/dist/ntpd/refclock_nmea.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/refclock_nmea.c
diff -u src/external/bsd/ntp/dist/ntpd/refclock_nmea.c:1.6 src/external/bsd/ntp/dist/ntpd/refclock_nmea.c:1.7
--- src/external/bsd/ntp/dist/ntpd/refclock_nmea.c:1.6	Fri Dec 19 15:43:17 2014
+++ src/external/bsd/ntp/dist/ntpd/refclock_nmea.c	Sun Dec 21 23:23:58 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: refclock_nmea.c,v 1.6 2014/12/19 20:43:17 christos Exp $	*/
+/*	$NetBSD: refclock_nmea.c,v 1.7 2014/12/22 04:23:58 christos Exp $	*/
 
 /*
  * refclock_nmea.c - clock driver for an NMEA GPS CLOCK
@@ -314,7 +314,7 @@ static int	unfold_century	(struct calend
 static int	gpsfix_century	(struct calendar * jd, const gps_weektm * wd,
  u_short * ccentury);
 static l_fp eval_gps_time	(struct peer * peer, const struct calendar * gpst,
- const struct timespec * gpso, const l_fp * recv);
+ const struct timespec * gpso, const l_fp * xrecv);
 
 static int	nmead_open	(const char * device);
 static void save_ltc(struct refclockproc * const, const char * const,
@@ -1782,7 +1782,7 @@ eval_gps_time(
 	struct peer   * peer, /* for logging etc */
 	const struct calendar * gpst, /* GPS time stamp  */
 	const struct timespec * tofs, /* GPS frac second  offset */
-	const l_fp* recv  /* receive time stamp */
+	const l_fp* xrecv /* receive time stamp */
 	)
 {
 	struct refclockproc * const pp = peer-procptr;
@@ -1838,7 +1838,7 @@ eval_gps_time(
 	}
 
 	/* - get unfold base: day of full recv time - 512 weeks */
-	vi64 = ntpcal_ntp_to_ntp(recv-l_ui, NULL);
+	vi64 = ntpcal_ntp_to_ntp(xrecv-l_ui, NULL);
 	rs64 = ntpcal_daysplit(vi64);
 	rcv_sec = rs64.lo;
 	rcv_day = rs64.hi - 512 * 7;
@@ -1848,7 +1848,7 @@ eval_gps_time(
 	 * fractional day of the receive time, we shift the base day for
 	 * the unfold by 1. */
 	if (   gps_sec   rcv_sec
-	   || (gps_sec == rcv_sec  retv.l_uf  recv-l_uf))
+	   || (gps_sec == rcv_sec  retv.l_uf  xrecv-l_uf))
 		rcv_day += 1;
 
 	/* - don't warp ahead of GPS invention! */



CVS commit: src/external/bsd/ntp/dist

2014-12-20 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sat Dec 20 08:38:48 UTC 2014

Modified Files:
src/external/bsd/ntp/dist/ntpd: ntp_control.c
src/external/bsd/ntp/dist/sntp: networking.c

Log Message:
Fix signed vs unsigned errors.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/ntp/dist/ntpd/ntp_control.c
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/ntp/dist/sntp/networking.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/ntp_control.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_control.c:1.9 src/external/bsd/ntp/dist/ntpd/ntp_control.c:1.10
--- src/external/bsd/ntp/dist/ntpd/ntp_control.c:1.9	Fri Dec 19 20:43:17 2014
+++ src/external/bsd/ntp/dist/ntpd/ntp_control.c	Sat Dec 20 08:38:47 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_control.c,v 1.9 2014/12/19 20:43:17 christos Exp $	*/
+/*	$NetBSD: ntp_control.c,v 1.10 2014/12/20 08:38:47 uebayasi Exp $	*/
 
 /*
  * ntp_control.c - respond to mode 6 control messages and send async
@@ -1347,7 +1347,7 @@ ctl_putdata(
 		/*
 		 * Not enough room in this one, flush it out.
 		 */
-		currentlen = MIN(dlen, dataend - datapt);
+		currentlen = MIN(dlen, (unsigned int)(dataend - datapt));
 
 		memcpy(datapt, dp, currentlen);
 

Index: src/external/bsd/ntp/dist/sntp/networking.c
diff -u src/external/bsd/ntp/dist/sntp/networking.c:1.8 src/external/bsd/ntp/dist/sntp/networking.c:1.9
--- src/external/bsd/ntp/dist/sntp/networking.c:1.8	Fri Dec 19 20:43:18 2014
+++ src/external/bsd/ntp/dist/sntp/networking.c	Sat Dec 20 08:38:47 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: networking.c,v 1.8 2014/12/19 20:43:18 christos Exp $	*/
+/*	$NetBSD: networking.c,v 1.9 2014/12/20 08:38:47 uebayasi Exp $	*/
 
 #include config.h
 #include networking.h
@@ -82,7 +82,7 @@ skip_efields(
 	while ((tail - head)  6) {
 		nlen = ntohl(*head++)  0x;
 		nlen = (nlen + 3)  2;
-		if (nlen  (tail - head) || nlen  4)
+		if (nlen  (u_int)(tail - head) || nlen  4)
 			return NULL;	/* Blooper! Inconsistent! */
 		head += nlen;
 	}



CVS commit: src/external/bsd/ntp/dist/sntp/libopts

2014-12-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Dec 19 20:48:55 UTC 2014

Modified Files:
src/external/bsd/ntp/dist/sntp/libopts: autoopts.h

Log Message:
I will let others decide if we should grow this wart...


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/ntp/dist/sntp/libopts/autoopts.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/sntp/libopts/autoopts.h
diff -u src/external/bsd/ntp/dist/sntp/libopts/autoopts.h:1.6 src/external/bsd/ntp/dist/sntp/libopts/autoopts.h:1.7
--- src/external/bsd/ntp/dist/sntp/libopts/autoopts.h:1.6	Fri Dec 19 15:43:19 2014
+++ src/external/bsd/ntp/dist/sntp/libopts/autoopts.h	Fri Dec 19 15:48:55 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoopts.h,v 1.6 2014/12/19 20:43:19 christos Exp $	*/
+/*	$NetBSD: autoopts.h,v 1.7 2014/12/19 20:48:55 christos Exp $	*/
 
 
 /*
@@ -34,7 +34,11 @@
 
 #ifndef AUTOGEN_AUTOOPTS_H
 #define AUTOGEN_AUTOOPTS_H
+#if 0
 #include stdnoreturn.h
+#else
+#define noreturn __dead
+#endif
 
 #define AO_NAME_LIMIT   127
 #define AO_NAME_SIZE((size_t)(AO_NAME_LIMIT + 1))



CVS commit: src/external/bsd/ntp/dist/sntp/libopts

2014-11-22 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sun Nov 23 01:47:59 UTC 2014

Modified Files:
src/external/bsd/ntp/dist/sntp/libopts: init.c
src/external/bsd/ntp/dist/sntp/libopts/autoopts: options.h

Log Message:
Replace very question pointer games to override const, mark the member
writeable when inside the guts of the library.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/ntp/dist/sntp/libopts/init.c
cvs rdiff -u -r1.6 -r1.7 \
src/external/bsd/ntp/dist/sntp/libopts/autoopts/options.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/sntp/libopts/init.c
diff -u src/external/bsd/ntp/dist/sntp/libopts/init.c:1.2 src/external/bsd/ntp/dist/sntp/libopts/init.c:1.3
--- src/external/bsd/ntp/dist/sntp/libopts/init.c:1.2	Sat Dec 28 03:20:15 2013
+++ src/external/bsd/ntp/dist/sntp/libopts/init.c	Sun Nov 23 01:47:59 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: init.c,v 1.2 2013/12/28 03:20:15 christos Exp $	*/
+/*	$NetBSD: init.c,v 1.3 2014/11/23 01:47:59 joerg Exp $	*/
 
 /**
  * \file initialize.c
@@ -103,20 +103,17 @@ validate_struct(tOptions * opts, char co
  */
 if (opts-pzProgName == NULL) {
 char const *  pz = strrchr(pname, DIRCH);
-char const ** pp =
-(char const **)(void **)(intptr_t)(opts-pzProgName);
 
 if (pz != NULL)
-*pp = pz+1;
+opts-pzProgName = pz+1;
 else
-*pp = pname;
+opts-pzProgName = pname;
 
 pz = pathfind(getenv(PATH), (char *)(intptr_t)pname, rx);
 if (pz != NULL)
 pname = (void *)(intptr_t)pz;
 
-pp  = (char const **)(void **)(intptr_t)(opts-pzProgPath);
-*pp = pname;
+opts-pzProgPath = pname;
 
 /*
  *  when comparing long names, these are equivalent

Index: src/external/bsd/ntp/dist/sntp/libopts/autoopts/options.h
diff -u src/external/bsd/ntp/dist/sntp/libopts/autoopts/options.h:1.6 src/external/bsd/ntp/dist/sntp/libopts/autoopts/options.h:1.7
--- src/external/bsd/ntp/dist/sntp/libopts/autoopts/options.h:1.6	Sat Dec 28 03:20:15 2013
+++ src/external/bsd/ntp/dist/sntp/libopts/autoopts/options.h	Sun Nov 23 01:47:59 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: options.h,v 1.6 2013/12/28 03:20:15 christos Exp $	*/
+/*	$NetBSD: options.h,v 1.7 2014/11/23 01:47:59 joerg Exp $	*/
 
 /*   -*- buffer-read-only: t -*- vi: set ro:
  *
@@ -602,9 +602,17 @@ struct options {
 char *  pzCurOpt;  /// current option text
 
 /// Public, the full path of the program
+#if AUTOOPTS_INTERNAL
+char const *pzProgPath;
+#else
 char const * const  pzProgPath;
+#endif
 /// Public, the name of the executable, without any path
+#if AUTOOPTS_INTERNAL
+char const *pzProgName;
+#else
 char const * const  pzProgName;
+#endif
 /// Public, the upper-cased, shell variable syntax-ed program name
 char const * const  pzPROGNAME;
 /// the name of the rc file (configuration file)



CVS commit: src/external/bsd/ntp/dist/libntp

2014-04-01 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Tue Apr  1 17:34:44 UTC 2014

Modified Files:
src/external/bsd/ntp/dist/libntp: atouint.c

Log Message:
remove stray 'return 0;' that effectively disabled atouint().

Hi Christos!


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/ntp/dist/libntp/atouint.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/libntp/atouint.c
diff -u src/external/bsd/ntp/dist/libntp/atouint.c:1.3 src/external/bsd/ntp/dist/libntp/atouint.c:1.4
--- src/external/bsd/ntp/dist/libntp/atouint.c:1.3	Sat Dec 28 03:20:13 2013
+++ src/external/bsd/ntp/dist/libntp/atouint.c	Tue Apr  1 17:34:44 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: atouint.c,v 1.3 2013/12/28 03:20:13 christos Exp $	*/
+/*	$NetBSD: atouint.c,v 1.4 2014/04/01 17:34:44 kardel Exp $	*/
 
 #include config.h
 #include sys/types.h
@@ -29,7 +29,6 @@ atouint(
 		return 0;
 
 	u = 0;
-		return 0;
 	while ('\0' != *cp) {
 		if (!isdigit((unsigned char)*cp))
 			return 0;



CVS commit: src/external/bsd/ntp/dist/ntpd

2014-02-27 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Feb 27 18:11:41 UTC 2014

Modified Files:
src/external/bsd/ntp/dist/ntpd: refclock_wwv.c

Log Message:
Use labs for long arguments and fabs for double ones.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 src/external/bsd/ntp/dist/ntpd/refclock_wwv.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/refclock_wwv.c
diff -u src/external/bsd/ntp/dist/ntpd/refclock_wwv.c:1.1.1.2 src/external/bsd/ntp/dist/ntpd/refclock_wwv.c:1.2
--- src/external/bsd/ntp/dist/ntpd/refclock_wwv.c:1.1.1.2	Fri Dec 27 23:30:52 2013
+++ src/external/bsd/ntp/dist/ntpd/refclock_wwv.c	Thu Feb 27 18:11:41 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: refclock_wwv.c,v 1.1.1.2 2013/12/27 23:30:52 christos Exp $	*/
+/*	$NetBSD: refclock_wwv.c,v 1.2 2014/02/27 18:11:41 joerg Exp $	*/
 
 /*
  * refclock_wwv - clock driver for NIST WWV/H time/frequency station
@@ -1340,7 +1340,7 @@ wwv_qrz(
 		if (sp-reach  (1  AMAX))
 			sp-count--;
 		if (sp-synmax  ATHR  sp-synsnr  ASNR) {
-			if (abs(epoch)  AWND * MS) {
+			if (labs(epoch)  AWND * MS) {
 sp-reach |= 1;
 sp-count++;
 sp-mepoch = sp-lastpos = sp-pos;
@@ -1542,14 +1542,14 @@ wwv_endpoc(
 	 */
 	dtemp = (mepoch - zepoch) % WWV_SEC;
 	if (up-status  FGATE) {
-		if (abs(dtemp)  MAXFREQ * MINAVG) {
+		if (fabs(dtemp)  MAXFREQ * MINAVG) {
 			up-freq += (dtemp / 2.) / ((mcount - zcount) *
 			FCONST);
 			if (up-freq  MAXFREQ)
 up-freq = MAXFREQ;
 			else if (up-freq  -MAXFREQ)
 up-freq = -MAXFREQ;
-			if (abs(dtemp)  MAXFREQ * MINAVG / 2.) {
+			if (fabs(dtemp)  MAXFREQ * MINAVG / 2.) {
 if (avginc  3) {
 	avginc++;
 } else {



CVS commit: src/external/bsd/ntp/dist/ntpd

2014-02-27 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Feb 27 18:12:11 UTC 2014

Modified Files:
src/external/bsd/ntp/dist/ntpd: refclock_irig.c

Log Message:
Use abs for difference of integers.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/ntp/dist/ntpd/refclock_irig.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/refclock_irig.c
diff -u src/external/bsd/ntp/dist/ntpd/refclock_irig.c:1.3 src/external/bsd/ntp/dist/ntpd/refclock_irig.c:1.4
--- src/external/bsd/ntp/dist/ntpd/refclock_irig.c:1.3	Sat Dec 28 03:20:14 2013
+++ src/external/bsd/ntp/dist/ntpd/refclock_irig.c	Thu Feb 27 18:12:11 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: refclock_irig.c,v 1.3 2013/12/28 03:20:14 christos Exp $	*/
+/*	$NetBSD: refclock_irig.c,v 1.4 2014/02/27 18:12:11 joerg Exp $	*/
 
 /*
  * refclock_irig - audio IRIG-B/E demodulator/decoder
@@ -764,7 +764,7 @@ irig_baud(
 	 * persist for lots of samples.
 	 */
 	up-exing = -up-yxing;
-	if (fabs(up-envxing - up-envphase) = 1) {
+	if (abs(up-envxing - up-envphase) = 1) {
 		up-tcount++;
 		if (up-tcount  20 * up-tc) {
 			up-tc++;



CVS commit: src/external/bsd/ntp/dist/libparse

2014-02-27 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Feb 27 18:12:41 UTC 2014

Modified Files:
src/external/bsd/ntp/dist/libparse: data_mbg.c

Log Message:
offs_from_utc is known to be small, so explicitly cast it to int.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/ntp/dist/libparse/data_mbg.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/libparse/data_mbg.c
diff -u src/external/bsd/ntp/dist/libparse/data_mbg.c:1.3 src/external/bsd/ntp/dist/libparse/data_mbg.c:1.4
--- src/external/bsd/ntp/dist/libparse/data_mbg.c:1.3	Sat Dec 28 03:20:14 2013
+++ src/external/bsd/ntp/dist/libparse/data_mbg.c	Thu Feb 27 18:12:41 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: data_mbg.c,v 1.3 2013/12/28 03:20:14 christos Exp $	*/
+/*	$NetBSD: data_mbg.c,v 1.4 2014/02/27 18:12:41 joerg Exp $	*/
 
 /*
  * /src/NTP/REPOSITORY/ntp4-dev/libparse/data_mbg.c,v 4.8 2006/06/22 18:40:01 kardel RELEASE_20060622_A
@@ -268,8 +268,8 @@ mbg_tm_str(
 		 tmp-year, tmp-month, tmp-mday,
 		 tmp-hour, tmp-minute, tmp-second, tmp-frac,
 		 (tmp-offs_from_utc  0) ? '-' : '+',
-		 abs(tmp-offs_from_utc) / 3600,
-		 (abs(tmp-offs_from_utc) / 60) % 60);
+		 abs((int)tmp-offs_from_utc) / 3600,
+		 (abs((int)tmp-offs_from_utc) / 60) % 60);
 	*buffpp += strlen(*buffpp);
 
 	mbg_time_status_str(buffpp, tmp-status, size - (*buffpp - s));



CVS commit: src/external/bsd/ntp/dist/ntpd

2014-01-25 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Jan 26 02:21:08 UTC 2014

Modified Files:
src/external/bsd/ntp/dist/ntpd: ntp_io.c

Log Message:
stoa() already includes the scope, no need to print it twice.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/external/bsd/ntp/dist/ntpd/ntp_io.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/ntp_io.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.13 src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.14
--- src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.13	Fri Jan 17 17:25:47 2014
+++ src/external/bsd/ntp/dist/ntpd/ntp_io.c	Sun Jan 26 02:21:08 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_io.c,v 1.13 2014/01/17 17:25:47 roy Exp $	*/
+/*	$NetBSD: ntp_io.c,v 1.14 2014/01/26 02:21:08 mlelstv Exp $	*/
 
 /*
  * ntp_io.c - input/output routines for ntpd.	The socket-opening code
@@ -2818,7 +2818,6 @@ open_socket(
 {
 	SOCKET	fd;
 	int	errval;
-	char	scopetext[16];
 	/*
 	 * int is OK for REUSEADR per
 	 * http://www.kohala.com/start/mcast.api.txt
@@ -2968,16 +2967,10 @@ open_socket(
 		|| debug  1
 #endif
 		) {
-			if (SCOPE(addr))
-snprintf(scopetext, sizeof(scopetext),
-	 %%%d, SCOPE(addr));
-			else
-scopetext[0] = 0;
-
 			msyslog(LOG_ERR,
-bind(%d) AF_INET%s %s%s#%d%s flags 0x%x failed: %m,
+bind(%d) AF_INET%s %s#%d%s flags 0x%x failed: %m,
 fd, IS_IPV6(addr) ? 6 : ,
-stoa(addr), scopetext, SRCPORT(addr),
+stoa(addr), SRCPORT(addr),
 IS_MCAST(addr) ?  (multicast) : ,
 interf-flags);
 		}



CVS commit: src/external/bsd/ntp/dist/libntp

2014-01-20 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Mon Jan 20 19:03:33 UTC 2014

Modified Files:
src/external/bsd/ntp/dist/libntp: work_fork.c

Log Message:
fix voluntary self-destruct (kill(0, SIGUP)) after successful int_res run and 
interface change


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/ntp/dist/libntp/work_fork.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/libntp/work_fork.c
diff -u src/external/bsd/ntp/dist/libntp/work_fork.c:1.1.1.1 src/external/bsd/ntp/dist/libntp/work_fork.c:1.2
--- src/external/bsd/ntp/dist/libntp/work_fork.c:1.1.1.1	Fri Dec 27 23:30:48 2013
+++ src/external/bsd/ntp/dist/libntp/work_fork.c	Mon Jan 20 19:03:33 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: work_fork.c,v 1.1.1.1 2013/12/27 23:30:48 christos Exp $	*/
+/*	$NetBSD: work_fork.c,v 1.2 2014/01/20 19:03:33 kardel Exp $	*/
 
 /*
  * work_fork.c - fork implementation for blocking worker child.
@@ -100,8 +100,10 @@ interrupt_worker_sleep(void)
 
 	for (idx = 0; idx  blocking_children_alloc; idx++) {
 		c = blocking_children[idx];
-		if (NULL == c)
+
+		if (NULL == c || c-reusable == TRUE)
 			continue;
+
 		rc = kill(c-pid, SIGHUP);
 		if (rc  0)
 			msyslog(LOG_ERR,



CVS commit: src/external/bsd/ntp/dist/ntpd

2014-01-17 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Jan 17 17:25:47 UTC 2014

Modified Files:
src/external/bsd/ntp/dist/ntpd: ntp_io.c

Log Message:
Do not try to bind to un-useable IPv6 addresses.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/bsd/ntp/dist/ntpd/ntp_io.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/ntp_io.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.12 src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.13
--- src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.12	Sat Dec 28 17:00:50 2013
+++ src/external/bsd/ntp/dist/ntpd/ntp_io.c	Fri Jan 17 17:25:47 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_io.c,v 1.12 2013/12/28 17:00:50 christos Exp $	*/
+/*	$NetBSD: ntp_io.c,v 1.13 2014/01/17 17:25:47 roy Exp $	*/
 
 /*
  * ntp_io.c - input/output routines for ntpd.	The socket-opening code
@@ -1632,16 +1632,15 @@ set_wildcard_reuse(
 
 
 static isc_boolean_t
-is_anycast(
+check_flags6(
 	sockaddr_u *psau,
-	const char *name
+	const char *name,
+	u_int32 flags6
 	)
 {
-#if defined(INCLUDE_IPV6_SUPPORT)  defined(SIOCGIFAFLAG_IN6)  \
-defined(IN6_IFF_ANYCAST)
+#if defined(INCLUDE_IPV6_SUPPORT)  defined(SIOCGIFAFLAG_IN6)
 	struct in6_ifreq ifr6;
 	int fd;
-	u_int32 flags6;
 
 	if (psau-sa.sa_family != AF_INET6)
 		return ISC_FALSE;
@@ -1655,13 +1654,45 @@ is_anycast(
 		return ISC_FALSE;
 	}
 	close(fd);
-	flags6 = ifr6.ifr_ifru.ifru_flags6;
-	if ((flags6  IN6_IFF_ANYCAST) != 0)
+	if ((ifr6.ifr_ifru.ifru_flags6  flags6) != 0)
 		return ISC_TRUE;
-#endif	/* INCLUDE_IPV6_SUPPORT  SIOCGIFAFLAG_IN6  IN6_IFF_ANYCAST */
+#endif	/* INCLUDE_IPV6_SUPPORT  SIOCGIFAFLAG_IN6 */
 	return ISC_FALSE;
 }
 
+static isc_boolean_t
+is_anycast(
+	sockaddr_u *psau,
+	const char *name
+	)
+{
+#ifdef IN6_IFF_ANYCAST
+	return check_flags6(psau, name, IN6_IFF_ANYCAST);
+#else
+	return ISC_FALSE;
+#endif
+}
+
+static isc_boolean_t
+is_valid(
+	sockaddr_u *psau,
+	const char *name
+	)
+{
+	u_int32 flags6;
+
+	flags6 = 0;
+#ifdef IN6_IFF_DEPARTED
+	flags6 |= IN6_IFF_DEPARTED;
+#endif
+#ifdef IN6_IFF_DETACHED
+	flags6 |= IN6_IFF_DETACHED;
+#endif
+#ifdef IN6_IFF_TENTATIVE
+	flags6 |= IN6_IFF_TENTATIVE;
+#endif
+	return check_flags6(psau, name, flags6) ? ISC_FALSE : ISC_TRUE;
+}
 
 /*
  * update_interface strategy
@@ -1795,6 +1826,12 @@ update_interfaces(
 			continue;
 
 		/*
+		 * skip any address that is an invalid state to be used
+		 */
+		if (!is_valid(enumep.sin, isc_if.name))
+			continue;
+
+		/*
 		 * map to local *address* in order to map all duplicate
 		 * interfaces to an endpt structure with the appropriate
 		 * socket.  Our name space is (ip-address), NOT



CVS commit: src/external/bsd/ntp/dist/ntpd

2014-01-06 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Jan  7 02:10:49 UTC 2014

Modified Files:
src/external/bsd/ntp/dist/ntpd: refclock_parse.c

Log Message:
Fix format strings.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/bsd/ntp/dist/ntpd/refclock_parse.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/refclock_parse.c
diff -u src/external/bsd/ntp/dist/ntpd/refclock_parse.c:1.11 src/external/bsd/ntp/dist/ntpd/refclock_parse.c:1.12
--- src/external/bsd/ntp/dist/ntpd/refclock_parse.c:1.11	Sun Jan  5 15:13:36 2014
+++ src/external/bsd/ntp/dist/ntpd/refclock_parse.c	Tue Jan  7 02:10:49 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: refclock_parse.c,v 1.11 2014/01/05 15:13:36 kardel Exp $	*/
+/*	$NetBSD: refclock_parse.c,v 1.12 2014/01/07 02:10:49 joerg Exp $	*/
 
 /*
  * /src/NTP/REPOSITORY/ntp4-dev/ntpd/refclock_parse.c,v 4.81 2009/05/01 10:15:29 kardel RELEASE_20090105_A
@@ -2464,7 +2464,7 @@ init_iobinding(
  ** support routines
  **/
 
-static char *
+static __printflike(4, 5) char *
 ap(char *buffer, size_t len, char *pos, const char *fmt, ...)
 {
 	va_list va;
@@ -5552,28 +5552,28 @@ trimbletsip_message(
 t = ap(pbuffer, sizeof(pbuffer), t, illegal value 0x%02x, mb(0)  0xFF);
 break;
 			case 0x00:
-t = ap(pbuffer, sizeof(pbuffer), t, doing position fixes, BUFFER_SIZE(pbuffer, t));
+t = ap(pbuffer, sizeof(pbuffer), t, doing position fixes);
 break;
 			case 0x01:
-t = ap(pbuffer, sizeof(pbuffer), t, no GPS time yet, BUFFER_SIZE(pbuffer, t));
+t = ap(pbuffer, sizeof(pbuffer), t, no GPS time yet);
 break;
 			case 0x03:
-t = ap(pbuffer, sizeof(pbuffer), t, PDOP too high, BUFFER_SIZE(pbuffer, t));
+t = ap(pbuffer, sizeof(pbuffer), t, PDOP too high);
 break;
 			case 0x08:
-t = ap(pbuffer, sizeof(pbuffer), t, no usable satellites, BUFFER_SIZE(pbuffer, t));
+t = ap(pbuffer, sizeof(pbuffer), t, no usable satellites);
 break;
 			case 0x09:
-t = ap(pbuffer, sizeof(pbuffer), t, only ONE usable satellite, BUFFER_SIZE(pbuffer, t));
+t = ap(pbuffer, sizeof(pbuffer), t, only ONE usable satellite);
 break;
 			case 0x0A:
-t = ap(pbuffer, sizeof(pbuffer), t, only TWO usable satellites, BUFFER_SIZE(pbuffer, t));
+t = ap(pbuffer, sizeof(pbuffer), t, only TWO usable satellites);
 break;
 			case 0x0B:
-t = ap(pbuffer, sizeof(pbuffer), t, only THREE usable satellites, BUFFER_SIZE(pbuffer, t));
+t = ap(pbuffer, sizeof(pbuffer), t, only THREE usable satellites);
 break;
 			case 0x0C:
-t = ap(pbuffer, sizeof(pbuffer), t, the chosen satellite is unusable, BUFFER_SIZE(pbuffer, t));
+t = ap(pbuffer, sizeof(pbuffer), t, the chosen satellite is unusable);
 break;
 			}
 



CVS commit: src/external/bsd/ntp/dist

2014-01-03 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri Jan  3 20:26:45 UTC 2014

Modified Files:
src/external/bsd/ntp/dist/libntp: socktoa.c
src/external/bsd/ntp/dist/ntpq: ntpq-subs.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.3 -r1.2 src/external/bsd/ntp/dist/libntp/socktoa.c
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/ntp/dist/ntpq/ntpq-subs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/libntp/socktoa.c
diff -u src/external/bsd/ntp/dist/libntp/socktoa.c:1.1.1.3 src/external/bsd/ntp/dist/libntp/socktoa.c:1.2
--- src/external/bsd/ntp/dist/libntp/socktoa.c:1.1.1.3	Fri Dec 27 23:30:48 2013
+++ src/external/bsd/ntp/dist/libntp/socktoa.c	Fri Jan  3 20:26:45 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: socktoa.c,v 1.1.1.3 2013/12/27 23:30:48 christos Exp $	*/
+/*	$NetBSD: socktoa.c,v 1.2 2014/01/03 20:26:45 joerg Exp $	*/
 
 /*
  * socktoa.c	socktoa(), sockporttoa(), and sock_hash()
@@ -93,8 +93,8 @@ sockporttoa(
 	LIB_GETBUF(buf);
 	snprintf(buf, LIB_BUFLENGTH,
 		 (IS_IPV6(sock))
-		 ? [%s]:%hu
-		 : %s:%hu,
+		 ? [%s]:%u
+		 : %s:%u,
 		 atext, SRCPORT(sock));
 	errno = saved_errno;
 

Index: src/external/bsd/ntp/dist/ntpq/ntpq-subs.c
diff -u src/external/bsd/ntp/dist/ntpq/ntpq-subs.c:1.6 src/external/bsd/ntp/dist/ntpq/ntpq-subs.c:1.7
--- src/external/bsd/ntp/dist/ntpq/ntpq-subs.c:1.6	Mon Dec 30 01:34:22 2013
+++ src/external/bsd/ntp/dist/ntpq/ntpq-subs.c	Fri Jan  3 20:26:45 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntpq-subs.c,v 1.6 2013/12/30 01:34:22 christos Exp $	*/
+/*	$NetBSD: ntpq-subs.c,v 1.7 2014/01/03 20:26:45 joerg Exp $	*/
 
 /*
  * ntpq-subs.c - subroutines which are called to perform ntpq commands.
@@ -3036,7 +3036,7 @@ mrulist(
 		LFPTOD(interval, favgint);
 		favgint /= recent-count;
 		avgint = (int)(favgint + 0.5);
-		fprintf(fp, %6d %6d %4hx %c %d %d %6d %5hu %s\n,
+		fprintf(fp, %6d %6d %4hx %c %d %d %6d %5u %s\n,
 			lstint, avgint, recent-rs,
 			(RES_KOD  recent-rs)
 			? 'K'



CVS commit: src/external/bsd/ntp/dist/libntp

2014-01-02 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Jan  2 18:26:03 UTC 2014

Modified Files:
src/external/bsd/ntp/dist/libntp: prettydate.c

Log Message:
Use separate variables for the format strings to get working format
string checking with both GCC and Clang.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/ntp/dist/libntp/prettydate.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/libntp/prettydate.c
diff -u src/external/bsd/ntp/dist/libntp/prettydate.c:1.2 src/external/bsd/ntp/dist/libntp/prettydate.c:1.3
--- src/external/bsd/ntp/dist/libntp/prettydate.c:1.2	Sat Dec 28 03:20:13 2013
+++ src/external/bsd/ntp/dist/libntp/prettydate.c	Thu Jan  2 18:26:03 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: prettydate.c,v 1.2 2013/12/28 03:20:13 christos Exp $	*/
+/*	$NetBSD: prettydate.c,v 1.3 2014/01/02 18:26:03 joerg Exp $	*/
 
 /*
  * prettydate - convert a time stamp to something readable
@@ -159,10 +159,10 @@ common_prettydate(
 	int local
 	)
 {
-	static const char* pfmt[2] = {
-		%08lx.%08lx  %s, %s %2d %4d %2d:%02d:%02d.%03u,
-		%08lx.%08lx [%s, %s %2d %4d %2d:%02d:%02d.%03u UTC]
-	};
+	static const char pfmt0[] =
+	%08lx.%08lx  %s, %s %2d %4d %2d:%02d:%02d.%03u;
+	static const char pfmt1[] =
+	%08lx.%08lx [%s, %s %2d %4d %2d:%02d:%02d.%03u UTC];
 
 	char	*bp;
 	struct tm   *tm;
@@ -188,13 +188,13 @@ common_prettydate(
 		 */
 		struct calendar jd;
 		ntpcal_time_to_date(jd, sec);
-		snprintf(bp, LIB_BUFLENGTH, pfmt[local != 0],
+		snprintf(bp, LIB_BUFLENGTH, local ? pfmt1 : pfmt0,
 			 (u_long)ts-l_ui, (u_long)ts-l_uf,
 			 daynames[jd.weekday], months[jd.month-1],
 			 jd.monthday, jd.year, jd.hour,
 			 jd.minute, jd.second, msec);
 	} else		
-		snprintf(bp, LIB_BUFLENGTH, pfmt[0],
+		snprintf(bp, LIB_BUFLENGTH, pfmt0,
 			 (u_long)ts-l_ui, (u_long)ts-l_uf,
 			 daynames[tm-tm_wday], months[tm-tm_mon],
 			 tm-tm_mday, 1900 + tm-tm_year, tm-tm_hour,



CVS commit: src/external/bsd/ntp/dist/ntpd

2014-01-02 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Jan  2 21:35:50 UTC 2014

Modified Files:
src/external/bsd/ntp/dist/ntpd: refclock_true.c

Log Message:
Add format string attribute for better detection.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.3 -r1.2 src/external/bsd/ntp/dist/ntpd/refclock_true.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/refclock_true.c
diff -u src/external/bsd/ntp/dist/ntpd/refclock_true.c:1.1.1.3 src/external/bsd/ntp/dist/ntpd/refclock_true.c:1.2
--- src/external/bsd/ntp/dist/ntpd/refclock_true.c:1.1.1.3	Fri Dec 27 23:31:00 2013
+++ src/external/bsd/ntp/dist/ntpd/refclock_true.c	Thu Jan  2 21:35:50 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: refclock_true.c,v 1.1.1.3 2013/12/27 23:31:00 christos Exp $	*/
+/*	$NetBSD: refclock_true.c,v 1.2 2014/01/02 21:35:50 joerg Exp $	*/
 
 /*
  * refclock_true - clock driver for the Kinemetrics Truetime receivers
@@ -203,6 +203,7 @@ struct	refclock refclock_true = {
 #if !defined(__STDC__)
 # define true_debug (void)
 #else
+NTP_PRINTF(2, 3)
 static void
 true_debug(struct peer *peer, const char *fmt, ...)
 {



CVS commit: src/external/bsd/ntp/dist/libntp

2014-01-02 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Jan  2 21:35:19 UTC 2014

Modified Files:
src/external/bsd/ntp/dist/libntp: timetoa.c

Log Message:
Avoid pointer operations on the format string.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/ntp/dist/libntp/timetoa.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/libntp/timetoa.c
diff -u src/external/bsd/ntp/dist/libntp/timetoa.c:1.1.1.1 src/external/bsd/ntp/dist/libntp/timetoa.c:1.2
--- src/external/bsd/ntp/dist/libntp/timetoa.c:1.1.1.1	Fri Dec 27 23:30:48 2013
+++ src/external/bsd/ntp/dist/libntp/timetoa.c	Thu Jan  2 21:35:19 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: timetoa.c,v 1.1.1.1 2013/12/27 23:30:48 christos Exp $	*/
+/*	$NetBSD: timetoa.c,v 1.2 2014/01/02 21:35:19 joerg Exp $	*/
 
 /*
  * timetoa.c -- time_t related string formatting
@@ -59,14 +59,12 @@ format_time_fraction(
 	u_int		u;
 	long		fraclimit;
 	int		notneg;	/* flag for non-negative value	*/
-	const char *	fmt;
 	ldiv_t		qr;
 
 	DEBUG_REQUIRE(prec != 0);
 
 	LIB_GETBUF(cp);
 	secs_u = (u_time)secs;
-	fmt = -% UTIME_FORMAT .%0*ld;
 	
 	/* check if we need signed or unsigned mode */
 	notneg = (prec  0);
@@ -94,9 +92,7 @@ format_time_fraction(
 
 	/* Get the absolute value of the split representation time. */
 	notneg = notneg || ((time_t)secs_u = 0);
-	if (notneg) {
-		fmt++;		/* skip '-' */
-	} else {
+	if (!notneg) {
 		secs_u = ~secs_u;
 		if (0 == frac)
 			secs_u++;
@@ -105,7 +101,8 @@ format_time_fraction(
 	}
 
 	/* finally format the data and return the result */
-	snprintf(cp, LIB_BUFLENGTH, fmt, secs_u, prec_u, frac);
+	snprintf(cp, LIB_BUFLENGTH, %s% UTIME_FORMAT .%0*ld,
+	notneg?  : -, secs_u, prec_u, frac);
 	
 	return cp;
 }



CVS commit: src/external/bsd/ntp/dist/ntpd

2014-01-02 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Jan  2 21:37:00 UTC 2014

Modified Files:
src/external/bsd/ntp/dist/ntpd: ntp_control.c

Log Message:
Don't pass in a format string, but flags for using %f / %g and the
desired precision. Allows format string verification to work correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/ntp/dist/ntpd/ntp_control.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/ntp_control.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_control.c:1.7 src/external/bsd/ntp/dist/ntpd/ntp_control.c:1.8
--- src/external/bsd/ntp/dist/ntpd/ntp_control.c:1.7	Sat Dec 28 03:20:14 2013
+++ src/external/bsd/ntp/dist/ntpd/ntp_control.c	Thu Jan  2 21:37:00 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_control.c,v 1.7 2013/12/28 03:20:14 christos Exp $	*/
+/*	$NetBSD: ntp_control.c,v 1.8 2014/01/02 21:37:00 joerg Exp $	*/
 
 /*
  * ntp_control.c - respond to mode 6 control messages and send async
@@ -60,13 +60,10 @@ static	u_short ctlclkstatus	(struct refc
 static	void	ctl_flushpkt	(u_char);
 static	void	ctl_putdata	(const char *, unsigned int, int);
 static	void	ctl_putstr	(const char *, const char *, size_t);
-static	void	ctl_putdblf	(const char *, const char *, double);
-const char ctl_def_dbl_fmt[] = %.3f;
-#define	ctl_putdbl(tag, d)	ctl_putdblf(tag, ctl_def_dbl_fmt, d)
-const char ctl_def_dbl6_fmt[] = %.6f;
-#define	ctl_putdbl6(tag, d)	ctl_putdblf(tag, ctl_def_dbl6_fmt, d)
-const char ctl_def_sfp_fmt[] = %g;
-#define	ctl_putsfp(tag, sfp)	ctl_putdblf(tag, ctl_def_sfp_fmt, \
+static	void	ctl_putdblf	(const char *, int, int, double);
+#define	ctl_putdbl(tag, d)	ctl_putdblf(tag, 1, 3, d)
+#define	ctl_putdbl6(tag, d)	ctl_putdblf(tag, 1, 6, d)
+#define	ctl_putsfp(tag, sfp)	ctl_putdblf(tag, 0, -1, \
 	FPTOD(sfp))
 static	void	ctl_putuint	(const char *, u_long);
 static	void	ctl_puthex	(const char *, u_long);
@@ -1426,7 +1423,8 @@ ctl_putunqstr(
 static void
 ctl_putdblf(
 	const char *	tag,
-	const char *	fmt,
+	int		use_f,
+	int		precision,
 	double		d
 	)
 {
@@ -1440,7 +1438,8 @@ ctl_putdblf(
 		*cp++ = *cq++;
 	*cp++ = '=';
 	NTP_INSIST((size_t)(cp - buffer)  sizeof(buffer));
-	snprintf(cp, sizeof(buffer) - (cp - buffer), fmt, d);
+	snprintf(cp, sizeof(buffer) - (cp - buffer), use_f ? %.*f : %.*g,
+	precision, d);
 	cp += strlen(cp);
 	ctl_putdata(buffer, (unsigned)(cp - buffer), 0);
 }
@@ -2097,7 +2096,7 @@ ctl_putsys(
 	case CS_K_OFFSET:
 		CTL_IF_KERNLOOP(
 			ctl_putdblf, 
-			(sys_var[varid].text, %g, to_ms * ntx.offset)
+			(sys_var[varid].text, 0, -1, to_ms * ntx.offset)
 		);
 		break;
 
@@ -2111,7 +2110,7 @@ ctl_putsys(
 	case CS_K_MAXERR:
 		CTL_IF_KERNLOOP(
 			ctl_putdblf,
-			(sys_var[varid].text, %.6g,
+			(sys_var[varid].text, 0, 6,
 			 to_ms * ntx.maxerror)
 		);
 		break;
@@ -2119,7 +2118,7 @@ ctl_putsys(
 	case CS_K_ESTERR:
 		CTL_IF_KERNLOOP(
 			ctl_putdblf,
-			(sys_var[varid].text, %.6g,
+			(sys_var[varid].text, 0, 6,
 			 to_ms * ntx.esterror)
 		);
 		break;
@@ -2143,7 +2142,7 @@ ctl_putsys(
 	case CS_K_PRECISION:
 		CTL_IF_KERNLOOP(
 			ctl_putdblf,
-			(sys_var[varid].text, %.6g,
+			(sys_var[varid].text, 0, 6,
 			to_ms * ntx.precision)
 		);
 		break;



CVS commit: src/external/bsd/ntp/dist/ntpd

2014-01-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jan  1 19:52:58 UTC 2014

Modified Files:
src/external/bsd/ntp/dist/ntpd: refclock_acts.c

Log Message:
fd == 0 is a valid descriptor!


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/ntp/dist/ntpd/refclock_acts.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/refclock_acts.c
diff -u src/external/bsd/ntp/dist/ntpd/refclock_acts.c:1.6 src/external/bsd/ntp/dist/ntpd/refclock_acts.c:1.7
--- src/external/bsd/ntp/dist/ntpd/refclock_acts.c:1.6	Fri Dec 27 22:20:14 2013
+++ src/external/bsd/ntp/dist/ntpd/refclock_acts.c	Wed Jan  1 14:52:58 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: refclock_acts.c,v 1.6 2013/12/28 03:20:14 christos Exp $	*/
+/*	$NetBSD: refclock_acts.c,v 1.7 2014/01/01 19:52:58 christos Exp $	*/
 
 /*
  * refclock_acts - clock driver for the NIST/USNO/PTB/NPL Computer Time
@@ -517,7 +517,7 @@ acts_timeout(
 		up-unit);
 		fd = refclock_open(device, SPEED232, LDISC_ACTS |
 		LDISC_RAW | LDISC_REMOTE);
-		if (fd = 0) {
+		if (fd  0) {
 			msyslog(LOG_ERR, acts: open fails %m);
 			return;
 		}



CVS commit: src/external/bsd/ntp/dist/libntp

2013-12-31 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Dec 31 20:56:29 UTC 2013

Modified Files:
src/external/bsd/ntp/dist/libntp: ntp_intres.c

Log Message:
pointless to call alloca for a 1K path string... Just allocate it on the stack!


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/ntp/dist/libntp/ntp_intres.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/libntp/ntp_intres.c
diff -u src/external/bsd/ntp/dist/libntp/ntp_intres.c:1.1.1.1 src/external/bsd/ntp/dist/libntp/ntp_intres.c:1.2
--- src/external/bsd/ntp/dist/libntp/ntp_intres.c:1.1.1.1	Fri Dec 27 18:30:47 2013
+++ src/external/bsd/ntp/dist/libntp/ntp_intres.c	Tue Dec 31 15:56:29 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_intres.c,v 1.1.1.1 2013/12/27 23:30:47 christos Exp $	*/
+/*	$NetBSD: ntp_intres.c,v 1.2 2013/12/31 20:56:29 christos Exp $	*/
 
 /*
  * ntp_intres.c - Implements a generic blocking worker child or thread,
@@ -691,6 +691,7 @@ blocking_getnameinfo(
 	char *			cp;
 	int			rc;
 	time_t			time_now;
+	char			host[1024];
 
 	gni_req = (void *)((char *)req + sizeof(*req));
 
@@ -701,19 +702,7 @@ blocking_getnameinfo(
 	 * large allocations.  We only need room for the host
 	 * and service names.
 	 */
-	NTP_REQUIRE(octets  1024);
-
-#ifndef HAVE_ALLOCA
-	host = emalloc(octets);
-#else
-	host = alloca(octets);
-	if (NULL == host) {
-		msyslog(LOG_ERR,
-			blocking_getnameinfo unable to allocate %lu octets on stack,
-			(u_long)octets);
-		exit(1);
-	}
-#endif
+	NTP_REQUIRE(octets  sizeof(host));
 	service = host + gni_req-hostoctets;
 
 	worker_ctx = get_worker_context(c, gni_req-dns_idx);
@@ -795,9 +784,6 @@ blocking_getnameinfo(
 	rc = queue_blocking_response(c, resp, resp_octets, req);
 	if (rc)
 		msyslog(LOG_ERR, blocking_getnameinfo unable to queue response);
-#ifndef HAVE_ALLOCA
-	free(host);
-#endif
 	return rc;
 }
 



CVS commit: src/external/bsd/ntp/dist/libntp

2013-12-31 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Tue Dec 31 21:37:01 UTC 2013

Modified Files:
src/external/bsd/ntp/dist/libntp: ntp_intres.c

Log Message:
Remove duplicate/old declaration of 'host' now that we allocate it on stack.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/ntp/dist/libntp/ntp_intres.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/libntp/ntp_intres.c
diff -u src/external/bsd/ntp/dist/libntp/ntp_intres.c:1.2 src/external/bsd/ntp/dist/libntp/ntp_intres.c:1.3
--- src/external/bsd/ntp/dist/libntp/ntp_intres.c:1.2	Tue Dec 31 20:56:29 2013
+++ src/external/bsd/ntp/dist/libntp/ntp_intres.c	Tue Dec 31 21:37:01 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_intres.c,v 1.2 2013/12/31 20:56:29 christos Exp $	*/
+/*	$NetBSD: ntp_intres.c,v 1.3 2013/12/31 21:37:01 pgoyette Exp $	*/
 
 /*
  * ntp_intres.c - Implements a generic blocking worker child or thread,
@@ -686,7 +686,6 @@ blocking_getnameinfo(
 	blocking_gni_resp *	gni_resp;
 	size_t			octets;
 	size_t			resp_octets;
-	char *			host;
 	char *			service;
 	char *			cp;
 	int			rc;



CVS commit: src/external/bsd/ntp/dist

2013-12-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Dec 30 17:42:20 UTC 2013

Modified Files:
src/external/bsd/ntp/dist/include: ntp_config.h
src/external/bsd/ntp/dist/ntpd: ntp_config.c ntp_parser.y

Log Message:
put back mdstries


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/ntp/dist/include/ntp_config.h
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/ntp/dist/ntpd/ntp_config.c
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/ntp/dist/ntpd/ntp_parser.y

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/include/ntp_config.h
diff -u src/external/bsd/ntp/dist/include/ntp_config.h:1.4 src/external/bsd/ntp/dist/include/ntp_config.h:1.5
--- src/external/bsd/ntp/dist/include/ntp_config.h:1.4	Fri Dec 27 22:20:13 2013
+++ src/external/bsd/ntp/dist/include/ntp_config.h	Mon Dec 30 12:42:19 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_config.h,v 1.4 2013/12/28 03:20:13 christos Exp $	*/
+/*	$NetBSD: ntp_config.h,v 1.5 2013/12/30 17:42:19 christos Exp $	*/
 
 #ifndef NTP_CONFIG_H
 #define NTP_CONFIG_H
@@ -241,6 +241,7 @@ struct config_tree_tag {
 	int_fifo *	reset_counters;
 
 	sim_fifo *	sim_details;
+	int		mdnstries;
 };
 
 

Index: src/external/bsd/ntp/dist/ntpd/ntp_config.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_config.c:1.7 src/external/bsd/ntp/dist/ntpd/ntp_config.c:1.8
--- src/external/bsd/ntp/dist/ntpd/ntp_config.c:1.7	Sun Dec 29 20:34:22 2013
+++ src/external/bsd/ntp/dist/ntpd/ntp_config.c	Mon Dec 30 12:42:19 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_config.c,v 1.7 2013/12/30 01:34:22 christos Exp $	*/
+/*	$NetBSD: ntp_config.c,v 1.8 2013/12/30 17:42:19 christos Exp $	*/
 
 /* ntp_config.c
  *
@@ -316,6 +316,7 @@ static void config_ntpd(config_tree *);
 static void config_other_modes(config_tree *);
 static void config_auth(config_tree *);
 static void config_access(config_tree *);
+static void config_mdnstries(config_tree *);
 static void config_phone(config_tree *);
 static void config_setvar(config_tree *);
 static void config_ttl(config_tree *);
@@ -393,6 +394,7 @@ init_syntax_tree(
 	)
 {
 	ZERO(*ptree);
+	ptree-mdnstries = 5;
 }
 
 
@@ -3040,6 +3042,16 @@ config_phone(
 }
 #endif	/* !SIM */
 
+static void
+config_mdnstries(
+	config_tree *ptree
+	)
+{
+#ifdef HAVE_DNSREGISTRATION
+	extern int mdnstries;
+	mdnstries = ptree-mdnstries;
+#endif  /* HAVE_DNSREGISTRATION */
+}
 
 #ifdef FREE_CFG_T
 static void
@@ -4268,6 +4280,7 @@ config_ntpd(
 	config_system_opts(ptree);
 	config_logconfig(ptree);
 	config_phone(ptree);
+	config_mdnstries(ptree);
 	config_setvar(ptree);
 	config_ttl(ptree);
 	config_trap(ptree);

Index: src/external/bsd/ntp/dist/ntpd/ntp_parser.y
diff -u src/external/bsd/ntp/dist/ntpd/ntp_parser.y:1.6 src/external/bsd/ntp/dist/ntpd/ntp_parser.y:1.7
--- src/external/bsd/ntp/dist/ntpd/ntp_parser.y:1.6	Fri Dec 27 22:20:14 2013
+++ src/external/bsd/ntp/dist/ntpd/ntp_parser.y	Mon Dec 30 12:42:19 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_parser.y,v 1.6 2013/12/28 03:20:14 christos Exp $	*/
+/*	$NetBSD: ntp_parser.y,v 1.7 2013/12/30 17:42:19 christos Exp $	*/
 
 /* ntp_parser.y
  *
@@ -156,6 +156,7 @@
 %token	Integer	T_Maxdist
 %token	Integer	T_Maxmem
 %token	Integer	T_Maxpoll
+%token	Integer	T_Mdnstries
 %token	Integer	T_Mem
 %token	Integer	T_Memlock
 %token	Integer	T_Minclock
@@ -523,6 +524,8 @@ other_mode_command
 			{ CONCAT_G_FIFOS(cfgt.manycastserver, $2); }
 	|	T_Multicastclient address_list
 			{ CONCAT_G_FIFOS(cfgt.multicastclient, $2); }
+	|	T_Mdnstries T_Integer
+			{ cfgt.mdnstries = $2; }
 	;
 
 



CVS commit: src/external/bsd/ntp/dist/ntpd

2013-12-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Dec 30 17:41:57 UTC 2013

Modified Files:
src/external/bsd/ntp/dist/ntpd: ntp_scanner.c

Log Message:
prevent coredumps from syntax errors in the config file causing negative
include indexes


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/ntp/dist/ntpd/ntp_scanner.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/ntp_scanner.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_scanner.c:1.5 src/external/bsd/ntp/dist/ntpd/ntp_scanner.c:1.6
--- src/external/bsd/ntp/dist/ntpd/ntp_scanner.c:1.5	Fri Dec 27 22:20:14 2013
+++ src/external/bsd/ntp/dist/ntpd/ntp_scanner.c	Mon Dec 30 12:41:57 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_scanner.c,v 1.5 2013/12/28 03:20:14 christos Exp $	*/
+/*	$NetBSD: ntp_scanner.c,v 1.6 2013/12/30 17:41:57 christos Exp $	*/
 
 
 /* ntp_scanner.c
@@ -504,7 +504,7 @@ yylex(
 
 		if (EOF == ch) {
 
-			if (!input_from_file || !curr_include_level) 
+			if (!input_from_file || curr_include_level = 0) 
 return 0;
 
 			FCLOSE(fp[curr_include_level]);



CVS commit: src/external/bsd/ntp/dist

2013-12-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Dec 30 01:34:23 UTC 2013

Modified Files:
src/external/bsd/ntp/dist/ntpd: ntp_config.c
src/external/bsd/ntp/dist/ntpq: ntpq-subs.c
src/external/bsd/ntp/dist/sntp: main.c

Log Message:
remove unused variables


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/ntp/dist/ntpd/ntp_config.c
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/ntp/dist/ntpq/ntpq-subs.c
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/ntp/dist/sntp/main.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/ntp_config.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_config.c:1.6 src/external/bsd/ntp/dist/ntpd/ntp_config.c:1.7
--- src/external/bsd/ntp/dist/ntpd/ntp_config.c:1.6	Fri Dec 27 22:20:14 2013
+++ src/external/bsd/ntp/dist/ntpd/ntp_config.c	Sun Dec 29 20:34:22 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_config.c,v 1.6 2013/12/28 03:20:14 christos Exp $	*/
+/*	$NetBSD: ntp_config.c,v 1.7 2013/12/30 01:34:22 christos Exp $	*/
 
 /* ntp_config.c
  *
@@ -2595,9 +2595,7 @@ config_rlimit(
 	)
 {
 	attr_val *	rlimit_av;
-	int		item;
 
-	item = -1;	/* quiet warning */
 	rlimit_av = HEAD_PFIFO(ptree-rlimit);
 	for (; rlimit_av != NULL; rlimit_av = rlimit_av-link) {
 		switch (rlimit_av-attr) {

Index: src/external/bsd/ntp/dist/ntpq/ntpq-subs.c
diff -u src/external/bsd/ntp/dist/ntpq/ntpq-subs.c:1.5 src/external/bsd/ntp/dist/ntpq/ntpq-subs.c:1.6
--- src/external/bsd/ntp/dist/ntpq/ntpq-subs.c:1.5	Fri Dec 27 22:20:14 2013
+++ src/external/bsd/ntp/dist/ntpq/ntpq-subs.c	Sun Dec 29 20:34:22 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntpq-subs.c,v 1.5 2013/12/28 03:20:14 christos Exp $	*/
+/*	$NetBSD: ntpq-subs.c,v 1.6 2013/12/30 01:34:22 christos Exp $	*/
 
 /*
  * ntpq-subs.c - subroutines which are called to perform ntpq commands.
@@ -3174,7 +3174,6 @@ ifstats(
 	char *		tag;
 	char *		val;
 	int		fields;
-	u_int		ifnum;
 	u_int		ui;
 	ifstats_row	row;
 	int		comprende;
@@ -3193,7 +3192,6 @@ ifstats(
 
 	ZERO(row);
 	fields = 0;
-	ifnum = 0;
 	ui = 0;
 	while (nextvar(dsize, datap, tag, val)) {
 		if (debug  1)
@@ -3391,7 +3389,6 @@ reslist(
 	char *		tag;
 	char *		val;
 	int		fields;
-	u_int		idx;
 	u_int		ui;
 	reslist_row	row;
 	int		comprende;
@@ -3410,7 +3407,6 @@ reslist(
 
 	ZERO(row);
 	fields = 0;
-	idx = 0;
 	ui = 0;
 	while (nextvar(dsize, datap, tag, val)) {
 		if (debug  1)

Index: src/external/bsd/ntp/dist/sntp/main.c
diff -u src/external/bsd/ntp/dist/sntp/main.c:1.9 src/external/bsd/ntp/dist/sntp/main.c:1.10
--- src/external/bsd/ntp/dist/sntp/main.c:1.9	Sat Dec 28 22:26:07 2013
+++ src/external/bsd/ntp/dist/sntp/main.c	Sun Dec 29 20:34:23 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.9 2013/12/29 03:26:07 christos Exp $	*/
+/*	$NetBSD: main.c,v 1.10 2013/12/30 01:34:23 christos Exp $	*/
 
 #include config.h
 
@@ -297,9 +297,7 @@ open_sockets(
 	)
 {
 	sockaddr_u	name;
-	int		one_fam_works;
 
-	one_fam_works = FALSE;
 	if (-1 == sock4) {
 		sock4 = socket(PF_INET, SOCK_DGRAM, 0);
 		if (-1 == sock4) {
@@ -330,7 +328,6 @@ open_sockets(
 			msyslog(LOG_ERR,
 open_sockets: event_new(base, sock4) failed!);
 		} else {
-			one_fam_works = TRUE;
 			event_add(ev_sock4, wakeup_tv);
 		}
 	}
@@ -365,7 +362,6 @@ open_sockets(
 			msyslog(LOG_ERR,
 open_sockets: event_new(base, sock6) failed!);
 		} else {
-			one_fam_works = TRUE;
 			event_add(ev_sock6, wakeup_tv);
 		}
 	}



CVS commit: src/external/bsd/ntp/dist/util

2013-12-28 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Dec 28 13:27:39 UTC 2013

Modified Files:
src/external/bsd/ntp/dist/util: ntp-keygen-opts.c

Log Message:
remove (void *) casts when passing const pointers to a const void *
taking function.  ...


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/ntp/dist/util/ntp-keygen-opts.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/util/ntp-keygen-opts.c
diff -u src/external/bsd/ntp/dist/util/ntp-keygen-opts.c:1.5 src/external/bsd/ntp/dist/util/ntp-keygen-opts.c:1.6
--- src/external/bsd/ntp/dist/util/ntp-keygen-opts.c:1.5	Sat Dec 28 03:20:15 2013
+++ src/external/bsd/ntp/dist/util/ntp-keygen-opts.c	Sat Dec 28 13:27:39 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp-keygen-opts.c,v 1.5 2013/12/28 03:20:15 christos Exp $	*/
+/*	$NetBSD: ntp-keygen-opts.c,v 1.6 2013/12/28 13:27:39 mrg Exp $	*/
 
 /*
  *  EDIT THIS FILE WITH CAUTION  (ntp-keygen-opts.c)
@@ -1076,7 +1076,7 @@ doOptImbits(tOptions* pOptions, tOptDesc
 option_usage_fp = stderr;
 
  emit_ranges:
-optionShowRange(pOptions, pOptDesc, (void *)rng, 1);
+optionShowRange(pOptions, pOptDesc, rng, 1);
 }
 #endif /* defined AUTOKEY */
 
@@ -1138,7 +1138,7 @@ doOptModulus(tOptions* pOptions, tOptDes
 option_usage_fp = stderr;
 
  emit_ranges:
-optionShowRange(pOptions, pOptDesc, (void *)rng, 1);
+optionShowRange(pOptions, pOptDesc, rng, 1);
 }
 #endif /* defined AUTOKEY */
 /* extracted from optmain.tlib near line 46 */



CVS commit: src/external/bsd/ntp/dist/ntpd

2013-12-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Dec 28 17:00:50 UTC 2013

Modified Files:
src/external/bsd/ntp/dist/ntpd: ntp_io.c

Log Message:
32 bit build fixes.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/bsd/ntp/dist/ntpd/ntp_io.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/ntp_io.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.11 src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.12
--- src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.11	Fri Dec 27 22:20:14 2013
+++ src/external/bsd/ntp/dist/ntpd/ntp_io.c	Sat Dec 28 12:00:50 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_io.c,v 1.11 2013/12/28 03:20:14 christos Exp $	*/
+/*	$NetBSD: ntp_io.c,v 1.12 2013/12/28 17:00:50 christos Exp $	*/
 
 /*
  * ntp_io.c - input/output routines for ntpd.	The socket-opening code
@@ -3307,8 +3307,8 @@ fetch_timestamp(
 	tvp-tv_usec = (long)(ticks * 1e6 *
 			  sys_tick);
 }
-DPRINTF(4, (fetch_timestamp: system usec network time stamp: %ld.%06ld\n,
-	tvp-tv_sec, (long)tvp-tv_usec));
+DPRINTF(4, (fetch_timestamp: system usec network time stamp: %jd.%06ld\n,
+	(intmax_t)tvp-tv_sec, (long)tvp-tv_usec));
 nts = tval_stamp_to_lfp(*tvp);
 break;
 #endif  /* HAVE_TIMESTAMP */



CVS commit: src/external/bsd/ntp/dist/sntp

2013-12-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 29 03:26:07 UTC 2013

Modified Files:
src/external/bsd/ntp/dist/sntp: main.c

Log Message:
not all characters are born signed.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/ntp/dist/sntp/main.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/sntp/main.c
diff -u src/external/bsd/ntp/dist/sntp/main.c:1.8 src/external/bsd/ntp/dist/sntp/main.c:1.9
--- src/external/bsd/ntp/dist/sntp/main.c:1.8	Fri Dec 27 22:20:15 2013
+++ src/external/bsd/ntp/dist/sntp/main.c	Sat Dec 28 22:26:07 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.8 2013/12/28 03:20:15 christos Exp $	*/
+/*	$NetBSD: main.c,v 1.9 2013/12/29 03:26:07 christos Exp $	*/
 
 #include config.h
 
@@ -1398,7 +1398,7 @@ set_li_vn_mode (
 		leap = 3;
 	}
 
-	if (version  0 || version  7) {
+	if ((unsigned char)version  7) {
 		msyslog(LOG_DEBUG, set_li_vn_mode: version  0 or  7, using 4);
 		version = 4;
 	}



CVS commit: src/external/bsd/ntp/dist

2013-12-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Dec 28 03:20:15 UTC 2013

Modified Files:
src/external/bsd/ntp/dist/include: ntp_config.h ntp_filegen.h ntp_fp.h
ntp_request.h ntp_stdlib.h ntpd.h refclock_atom.h
src/external/bsd/ntp/dist/lib/isc: backtrace.c event.c inet_ntop.c
inet_pton.c log.c netaddr.c result.c sockaddr.c
src/external/bsd/ntp/dist/lib/isc/include/isc: util.h
src/external/bsd/ntp/dist/lib/isc/unix: file.c ifiter_getifaddrs.c
net.c socket.c time.c
src/external/bsd/ntp/dist/libntp: atoint.c atolfp.c atouint.c audio.c
authkeys.c authreadkeys.c hextoint.c hextolfp.c humandate.c
modetoa.c mstolfp.c ntp_calendar.c ntp_lineedit.c octtoint.c
prettydate.c ssl_init.c
src/external/bsd/ntp/dist/libparse: clk_rawdcf.c data_mbg.c
info_trimble.c
src/external/bsd/ntp/dist/ntpd: keyword-gen.c ntp_config.c
ntp_control.c ntp_crypto.c ntp_filegen.c ntp_io.c ntp_keyword.h
ntp_loopfilter.c ntp_parser.c ntp_parser.h ntp_parser.y ntp_peer.c
ntp_proto.c ntp_refclock.c ntp_request.c ntp_restrict.c
ntp_scanner.c ntp_util.c ntpd-opts.h ntpd.c refclock_acts.c
refclock_arc.c refclock_chu.c refclock_datum.c refclock_heath.c
refclock_irig.c refclock_jjy.c refclock_jupiter.c
refclock_neoclock4x.c refclock_nmea.c refclock_oncore.c
refclock_parse.c refclock_pcf.c refclock_shm.c refclock_wwvb.c
src/external/bsd/ntp/dist/ntpdate: ntpdate.c
src/external/bsd/ntp/dist/ntpdc: nl.pl ntpdc.c ntpdc.h ntpdc_ops.c
src/external/bsd/ntp/dist/ntpq: ntpq-subs.c ntpq.c ntpq.h
src/external/bsd/ntp/dist/sntp: crypto.c kod_management.c log.c log.h
main.c networking.c networking.h sntp-opts.c
src/external/bsd/ntp/dist/sntp/libopts: autoopts.c autoopts.h
configfile.c enum.c file.c find.c init.c load.c makeshell.c
nested.c numeric.c parse-duration.c pgusage.c putshell.c reset.c
save.c stack.c streqvcmp.c tokenize.c usage.c
src/external/bsd/ntp/dist/sntp/libopts/autoopts: options.h
src/external/bsd/ntp/dist/sntp/libopts/compat: pathfind.c
src/external/bsd/ntp/dist/util: ntp-keygen-opts.c ntp-keygen.c
ntptime.c
Removed Files:
src/external/bsd/ntp/dist: compile config.guess config.sub depcomp
excludes ltmain.sh missing version version.m4 ylwrap
src/external/bsd/ntp/dist/ElectricFence: CHANGES COPYING Makefile.am
Makefile.in README efence.c efence.h eftest.c libefence.3 page.c
print.c tstheap.c
src/external/bsd/ntp/dist/arlib: COPYING INSTALL Makefile.am
Makefile.in README UNSHAR.HDR aclocal.m4 arlib.3 arlib.c arlib.h
arplib.h configure configure.in depcomp install-sh missing sample.c
src/external/bsd/ntp/dist/clockstuff: clktest.c
src/external/bsd/ntp/dist/html: gadget.html manyopt.html
src/external/bsd/ntp/dist/html/description_files: description.jpg
src/external/bsd/ntp/dist/html/drivers: driver2.html
src/external/bsd/ntp/dist/include: autogen-version.def copyright.def
debug-opt.def homerc.def ntp_data_structures.h ntp_sprintf.h
version.def version.texi
src/external/bsd/ntp/dist/kernel: README chuinit.c clkinit.c tty_chu.c
tty_chu_STREAMS.c tty_clk.c tty_clk_STREAMS.c
src/external/bsd/ntp/dist/kernel/sys: chudefs.h clkdefs.h
src/external/bsd/ntp/dist/libntp: fptoa.c fptoms.c inttoa.c memmove.c
mfptoa.c mfptoms.c msutotsf.c strstr.c tsftomsu.c tstotv.c tvtots.c
uinttoa.c
src/external/bsd/ntp/dist/libopts: COPYING.gplv3 COPYING.lgplv3
COPYING.mbsd MakeDefs.inc Makefile.am Makefile.in README
ag-char-map.h autoopts.c autoopts.h boolean.c configfile.c cook.c
enumeration.c environment.c file.c genshell.c genshell.h libopts.c
load.c makeshell.c nested.c numeric.c parse-duration.c
parse-duration.h pgusage.c proto.h putshell.c reset.c restore.c
save.c sort.c stack.c streqvcmp.c text_mmap.c time.c tokenize.c
usage.c value-type.c value-type.h version.c xat-attribute.c
xat-attribute.h
src/external/bsd/ntp/dist/libopts/autoopts: options.h usage-txt.h
src/external/bsd/ntp/dist/libopts/compat: compat.h pathfind.c
snprintf.c strchr.c strdup.c windows-config.h
src/external/bsd/ntp/dist/libopts/m4: libopts.m4 liboptschk.m4
src/external/bsd/ntp/dist/m4: define_dir.m4 libtool.m4 ltoptions.m4
ltsugar.m4 ltversion.m4 lt~obsolete.m4 ntp_cacheversion.m4
ntp_dir_sep.m4 ntp_lib_m.m4 ntp_lineeditlibs.m4 ntp_openssl.m4
ntp_vpathhack.m4 os_cflags.m4
src/external/bsd/ntp/dist/ntpd: .deps-ver complete.conf
   

CVS commit: src/external/bsd/ntp/dist

2013-10-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Oct 20 02:47:38 UTC 2013

Modified Files:
src/external/bsd/ntp/dist/libntp: icom.c
src/external/bsd/ntp/dist/ntpd: ntp_crypto.c ntp_proto.c
refclock_acts.c refclock_chu.c refclock_irig.c refclock_oncore.c
src/external/bsd/ntp/dist/sntp: main.c

Log Message:
fix unused variable warnings


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/ntp/dist/libntp/icom.c
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/ntp/dist/ntpd/ntp_crypto.c \
src/external/bsd/ntp/dist/ntpd/refclock_acts.c
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/ntp/dist/ntpd/ntp_proto.c
cvs rdiff -u -r1.1.1.2 -r1.2 src/external/bsd/ntp/dist/ntpd/refclock_chu.c \
src/external/bsd/ntp/dist/ntpd/refclock_irig.c
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/ntp/dist/ntpd/refclock_oncore.c
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/ntp/dist/sntp/main.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/libntp/icom.c
diff -u src/external/bsd/ntp/dist/libntp/icom.c:1.3 src/external/bsd/ntp/dist/libntp/icom.c:1.4
--- src/external/bsd/ntp/dist/libntp/icom.c:1.3	Wed Feb  1 02:46:22 2012
+++ src/external/bsd/ntp/dist/libntp/icom.c	Sat Oct 19 22:47:38 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: icom.c,v 1.3 2012/02/01 07:46:22 kardel Exp $	*/
+/*	$NetBSD: icom.c,v 1.4 2013/10/20 02:47:38 christos Exp $	*/
 
 /*
  * Program to control ICOM radios
@@ -129,11 +129,9 @@ icom_init(
 {
 	TTY ttyb;
 	int fd;
-	int flags;
 	int rc;
 	int saved_errno;
 
-	flags = trace;
 	fd = tty_open(device, O_RDWR, 0777);
 	if (fd  0)
 		return -1;

Index: src/external/bsd/ntp/dist/ntpd/ntp_crypto.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_crypto.c:1.4 src/external/bsd/ntp/dist/ntpd/ntp_crypto.c:1.5
--- src/external/bsd/ntp/dist/ntpd/ntp_crypto.c:1.4	Wed Feb  1 02:46:22 2012
+++ src/external/bsd/ntp/dist/ntpd/ntp_crypto.c	Sat Oct 19 22:47:38 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_crypto.c,v 1.4 2012/02/01 07:46:22 kardel Exp $	*/
+/*	$NetBSD: ntp_crypto.c,v 1.5 2013/10/20 02:47:38 christos Exp $	*/
 
 /*
  * ntp_crypto.c - NTP version 4 public key routines
@@ -393,7 +393,6 @@ crypto_recv(
 	int	has_mac;	/* length of MAC field */
 	int	authlen;	/* offset of MAC field */
 	associd_t associd;	/* association ID */
-	tstamp_t tstamp = 0;	/* timestamp */
 	tstamp_t fstamp = 0;	/* filestamp */
 	u_int	len;		/* extension field length */
 	u_int	code;		/* extension field opcode */
@@ -443,7 +442,6 @@ crypto_recv(
 		}
 
 		if (len = VALUE_LEN) {
-			tstamp = ntohl(ep-tstamp);
 			fstamp = ntohl(ep-fstamp);
 			vallen = ntohl(ep-vallen);
 		}
Index: src/external/bsd/ntp/dist/ntpd/refclock_acts.c
diff -u src/external/bsd/ntp/dist/ntpd/refclock_acts.c:1.4 src/external/bsd/ntp/dist/ntpd/refclock_acts.c:1.5
--- src/external/bsd/ntp/dist/ntpd/refclock_acts.c:1.4	Wed Feb  1 02:46:22 2012
+++ src/external/bsd/ntp/dist/ntpd/refclock_acts.c	Sat Oct 19 22:47:38 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: refclock_acts.c,v 1.4 2012/02/01 07:46:22 kardel Exp $	*/
+/*	$NetBSD: refclock_acts.c,v 1.5 2013/10/20 02:47:38 christos Exp $	*/
 
 /*
  * refclock_acts - clock driver for the NIST/USNO/PTB/NPL Computer Time
@@ -638,7 +638,6 @@ acts_poll (
 	struct peer *peer
 	)
 {
-	struct actsunit *up;
 	struct refclockproc *pp;
 
 	/*
@@ -647,7 +646,6 @@ acts_poll (
 	 * the timeout routine and state machine.
 	 */
 	pp = peer-procptr;
-	up = (struct actsunit *)pp-unitptr;
 	switch (peer-ttl) {
 
 	/*

Index: src/external/bsd/ntp/dist/ntpd/ntp_proto.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_proto.c:1.3 src/external/bsd/ntp/dist/ntpd/ntp_proto.c:1.4
--- src/external/bsd/ntp/dist/ntpd/ntp_proto.c:1.3	Wed Feb  1 02:46:22 2012
+++ src/external/bsd/ntp/dist/ntpd/ntp_proto.c	Sat Oct 19 22:47:38 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_proto.c,v 1.3 2012/02/01 07:46:22 kardel Exp $	*/
+/*	$NetBSD: ntp_proto.c,v 1.4 2013/10/20 02:47:38 christos Exp $	*/
 
 /*
  * ntp_proto.c - NTP version 4 protocol machinery
@@ -2220,7 +2220,7 @@ clock_select(void)
 	struct peer *peer;
 	int	i, j, k, n;
 	int	nlist, nl3;
-	int	allow, osurv;
+	int	allow;
 	double	d, e, f, g;
 	double	high, low;
 	double	seljitter;
@@ -2249,7 +2249,6 @@ clock_select(void)
 	 * enough to handle all associations.
 	 */
 	osys_peer = sys_peer;
-	osurv = sys_survivors;
 	sys_survivors = 0;
 #ifdef LOCKCLOCK
 	sys_leap = LEAP_NOTINSYNC;

Index: src/external/bsd/ntp/dist/ntpd/refclock_chu.c
diff -u src/external/bsd/ntp/dist/ntpd/refclock_chu.c:1.1.1.2 src/external/bsd/ntp/dist/ntpd/refclock_chu.c:1.2
--- src/external/bsd/ntp/dist/ntpd/refclock_chu.c:1.1.1.2	Tue Jan 31 16:25:55 2012
+++ src/external/bsd/ntp/dist/ntpd/refclock_chu.c	Sat Oct 19 22:47:38 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: refclock_chu.c,v 1.1.1.2 2012/01/31 21:25:55 kardel Exp $	*/
+/*	$NetBSD: refclock_chu.c,v 1.2 2013/10/20 02:47:38 christos Exp $	*/
 
 /*
  * refclock_chu - 

CVS commit: src/external/bsd/ntp/dist/ntpd

2012-08-17 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Fri Aug 17 22:37:26 UTC 2012

Modified Files:
src/external/bsd/ntp/dist/ntpd: ntp_io.c

Log Message:
re-enable broadcast client config after interface re-scanning
make broadcast transmission work again


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/ntp/dist/ntpd/ntp_io.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/ntp_io.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.9 src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.10
--- src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.9	Wed Feb  1 21:21:25 2012
+++ src/external/bsd/ntp/dist/ntpd/ntp_io.c	Fri Aug 17 22:37:26 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_io.c,v 1.9 2012/02/01 21:21:25 kardel Exp $	*/
+/*	$NetBSD: ntp_io.c,v 1.10 2012/08/17 22:37:26 kardel Exp $	*/
 
 /*
  * ntp_io.c - input/output routines for ntpd.	The socket-opening code
@@ -1592,9 +1592,11 @@ refresh_interface(
 {
 #ifdef  OS_MISSES_SPECIFIC_ROUTE_UPDATES
 	if (interface-fd != INVALID_SOCKET) {
+		int bcast = (interface-flags  INT_BCASTOPEN) != 0;
 		close_and_delete_fd_from_list(interface-fd);
+		interface-flags = ~INT_BCASTOPEN;
 		interface-fd = open_socket(interface-sin,
-	0, 0, interface);
+	bcast, 0, interface);
 		 /*
 		  * reset TTL indication so TTL is is set again 
 		  * next time around
@@ -2047,6 +2049,9 @@ update_interfaces(
 		msyslog(LOG_INFO, peers refreshed);
 	}
 
+	if (sys_bclient)
+		io_setbclient();
+
 	return new_interface_found;
 }
 
@@ -2074,9 +2079,6 @@ create_sockets(
 
 	update_interfaces(port, NULL, NULL);
 
-	if (sys_bclient)
-		io_setbclient();
-
 	/*
 	 * Now that we have opened all the sockets, turn off the reuse
 	 * flag for security.



CVS commit: src/external/bsd/ntp/dist/ntpd

2012-08-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 12 06:16:51 UTC 2012

Modified Files:
src/external/bsd/ntp/dist/ntpd: refclock_parse.c

Log Message:
- make the append function to not append past the end of the string
- use the append function some more


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/ntp/dist/ntpd/refclock_parse.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/refclock_parse.c
diff -u src/external/bsd/ntp/dist/ntpd/refclock_parse.c:1.7 src/external/bsd/ntp/dist/ntpd/refclock_parse.c:1.8
--- src/external/bsd/ntp/dist/ntpd/refclock_parse.c:1.7	Sat Aug 11 16:09:08 2012
+++ src/external/bsd/ntp/dist/ntpd/refclock_parse.c	Sun Aug 12 02:16:51 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: refclock_parse.c,v 1.7 2012/08/11 20:09:08 kardel Exp $	*/
+/*	$NetBSD: refclock_parse.c,v 1.8 2012/08/12 06:16:51 christos Exp $	*/
 
 /*
  * /src/NTP/REPOSITORY/ntp4-dev/ntpd/refclock_parse.c,v 4.81 2009/05/01 10:15:29 kardel RELEASE_20090105_A
@@ -2423,12 +2423,23 @@ ap(char *buffer, size_t len, char *pos, 
 {
 	va_list va;
 	int l;
+	size_t rem = len - (pos - buffer);
+
+	if (rem == 0)
+		return pos;
 
 	va_start(va, fmt);
-	l = vsnprintf(pos, len - (pos - buffer), fmt, va);
+	l = vsnprintf(pos, rem, fmt, va);
 	va_end(va);
-	if (l != -1)
-		pos += l;
+
+	if (l != -1) {
+		rem--;
+		if (rem = l)
+			pos += l;
+		else
+			pos += rem;
+	}
+
 	return pos;
 }
 
@@ -5419,7 +5430,7 @@ trimbletsip_message(
 		
 		if (s)
 		{
-			snprintf(t, BUFFER_SIZE(pbuffer, t), %s=\, s-varname);
+			t = ap(pbuffer, sizeof(pbuffer), t, %s=\, s-varname);
 		}
 		else
 		{
@@ -5429,12 +5440,10 @@ trimbletsip_message(
 
 		var_flag = s-varmode;
 
-		t += strlen(t);
-		
 		switch(cmd)
 		{
 		case CMD_RCURTIME:
-			snprintf(t, BUFFER_SIZE(pbuffer, t), %f, %d, %f,
+			t = ap(pbuffer, sizeof(pbuffer), t, %f, %d, %f,
  getflt((unsigned char *)mb(0)), getshort((unsigned char *)mb(4)),
  getflt((unsigned char *)mb(6)));
 			break;



CVS commit: src/external/bsd/ntp/dist/ntpd

2012-08-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 12 07:22:24 UTC 2012

Modified Files:
src/external/bsd/ntp/dist/ntpd: refclock_parse.c

Log Message:
add cast.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/ntp/dist/ntpd/refclock_parse.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/refclock_parse.c
diff -u src/external/bsd/ntp/dist/ntpd/refclock_parse.c:1.8 src/external/bsd/ntp/dist/ntpd/refclock_parse.c:1.9
--- src/external/bsd/ntp/dist/ntpd/refclock_parse.c:1.8	Sun Aug 12 02:16:51 2012
+++ src/external/bsd/ntp/dist/ntpd/refclock_parse.c	Sun Aug 12 03:22:24 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: refclock_parse.c,v 1.8 2012/08/12 06:16:51 christos Exp $	*/
+/*	$NetBSD: refclock_parse.c,v 1.9 2012/08/12 07:22:24 christos Exp $	*/
 
 /*
  * /src/NTP/REPOSITORY/ntp4-dev/ntpd/refclock_parse.c,v 4.81 2009/05/01 10:15:29 kardel RELEASE_20090105_A
@@ -2434,7 +2434,7 @@ ap(char *buffer, size_t len, char *pos, 
 
 	if (l != -1) {
 		rem--;
-		if (rem = l)
+		if (rem = (size_t)l)
 			pos += l;
 		else
 			pos += rem;



CVS commit: src/external/bsd/ntp/dist/ntpd

2012-08-11 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sat Aug 11 20:09:08 UTC 2012

Modified Files:
src/external/bsd/ntp/dist/ntpd: refclock_parse.c

Log Message:
fix some fallout from append correction


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/ntp/dist/ntpd/refclock_parse.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/refclock_parse.c
diff -u src/external/bsd/ntp/dist/ntpd/refclock_parse.c:1.6 src/external/bsd/ntp/dist/ntpd/refclock_parse.c:1.7
--- src/external/bsd/ntp/dist/ntpd/refclock_parse.c:1.6	Fri Aug 10 08:22:49 2012
+++ src/external/bsd/ntp/dist/ntpd/refclock_parse.c	Sat Aug 11 20:09:08 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: refclock_parse.c,v 1.6 2012/08/10 08:22:49 christos Exp $	*/
+/*	$NetBSD: refclock_parse.c,v 1.7 2012/08/11 20:09:08 kardel Exp $	*/
 
 /*
  * /src/NTP/REPOSITORY/ntp4-dev/ntpd/refclock_parse.c,v 4.81 2009/05/01 10:15:29 kardel RELEASE_20090105_A
@@ -3527,7 +3527,9 @@ parse_control(
 			tmpctl.parsegettc.parse_state |= parse-timedata.parse_state 
 (PARSEB_PPS|PARSEB_S_PPS);
 
-			(void) parsestate(tmpctl.parsegettc.parse_state, tt, BUFFER_SIZES(start, tt, 512));
+			(void)parsestate(tmpctl.parsegettc.parse_state, tt, BUFFER_SIZES(start, tt, 512));
+
+			tt += strlen(tt);
 
 			tt = ap(start, 512, tt, \);
 
@@ -3546,13 +3548,18 @@ parse_control(
 		}
 		else
 		{
+			int count = tmpctl.parseformat.parse_count - 1;
+
 			start = tt = add_var(out-kv_list, 80, RO|DEF);
 			tt = ap(start, 80, tt, refclock_format=\);
 
-			tt = ap(start, 80, tt, *.*s, 
-			tmpctl.parseformat.parse_count,
-			tmpctl.parseformat.parse_count,
-			tmpctl.parseformat.parse_buffer);
+			if (count  0) {
+tt = ap(start, 80, tt, %*.*s, 
+				count,
+				count,
+				tmpctl.parseformat.parse_buffer);
+			}
+
 			tt = ap(start, 80, tt, \);
 		}
 
@@ -4535,8 +4542,8 @@ gps16x_message(
 	if (utc.valid)
 	{
 		p = ap(buffer, sizeof(buffer), p, gps_utc_correction=\);
-		p += strlen(p);
 		mk_utcinfo(p, utc.t0t.wn, utc.WNlsf, utc.DNt, utc.delta_tls, utc.delta_tlsf, BUFFER_SIZE(buffer, p));
+		p += strlen(p);
 		p = ap(buffer, sizeof(buffer), p, \);
 	}
 	else
@@ -5457,7 +5464,6 @@ trimbletsip_message(
 t = ap(pbuffer, sizeof(pbuffer), t, -MANUAL, );
 			else
 t = ap(pbuffer, sizeof(pbuffer), t, -AUTO, );
-			t += strlen(t);
 			
 			t = ap(pbuffer, sizeof(pbuffer), t, satellites %02d %02d %02d %02d, PDOP %.2f, HDOP %.2f, VDOP %.2f, TDOP %.2f,
 mb(1), mb(2), mb(3), mb(4),



CVS commit: src/external/bsd/ntp/dist/ntpd

2012-08-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Aug 10 08:22:49 UTC 2012

Modified Files:
src/external/bsd/ntp/dist/ntpd: refclock_parse.c

Log Message:
Homogenize all strn{cpy,cat} and snprintf() to a single append function to
prevent incorrect usage and buffer overflow.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/ntp/dist/ntpd/refclock_parse.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/refclock_parse.c
diff -u src/external/bsd/ntp/dist/ntpd/refclock_parse.c:1.5 src/external/bsd/ntp/dist/ntpd/refclock_parse.c:1.6
--- src/external/bsd/ntp/dist/ntpd/refclock_parse.c:1.5	Wed Feb  1 02:46:22 2012
+++ src/external/bsd/ntp/dist/ntpd/refclock_parse.c	Fri Aug 10 04:22:49 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: refclock_parse.c,v 1.5 2012/02/01 07:46:22 kardel Exp $	*/
+/*	$NetBSD: refclock_parse.c,v 1.6 2012/08/10 08:22:49 christos Exp $	*/
 
 /*
  * /src/NTP/REPOSITORY/ntp4-dev/ntpd/refclock_parse.c,v 4.81 2009/05/01 10:15:29 kardel RELEASE_20090105_A
@@ -2418,6 +2418,20 @@ init_iobinding(
  ** support routines
  **/
 
+static char *
+ap(char *buffer, size_t len, char *pos, const char *fmt, ...)
+{
+	va_list va;
+	int l;
+
+	va_start(va, fmt);
+	l = vsnprintf(pos, len - (pos - buffer), fmt, va);
+	va_end(va);
+	if (l != -1)
+		pos += l;
+	return pos;
+}
+
 /*--
  * convert a flag field to a string
  */
@@ -2464,8 +2478,6 @@ parsestate(
 	int i;
 	char *s, *t;
 
-
-	*buffer = '\0';
 	s = t = buffer;
 
 	i = 0;
@@ -2474,9 +2486,8 @@ parsestate(
 		if (flagstrings[i].bit  lstate)
 		{
 			if (s != t)
-strncpy(t, ; , BUFFER_SIZES(buffer, t, size));
-			strncat(t, flagstrings[i].name, BUFFER_SIZES(buffer, t, size));
-			t += strlen(t);
+t = ap(buffer, size, t, ; );
+			t = ap(buffer, size, t, %s, flagstrings[i].name);
 		}
 		i++;
 	}
@@ -2484,13 +2495,11 @@ parsestate(
 	if (lstate  (PARSEB_S_LEAP|PARSEB_S_ANTENNA|PARSEB_S_PPS|PARSEB_S_POSITION))
 	{
 		if (s != t)
-			strncpy(t, ; , BUFFER_SIZES(buffer, t, size));
-
-		t += strlen(t);
+			t = ap(buffer, size, t, ; );
 
-		strncpy(t, (, BUFFER_SIZES(buffer, t, size));
+		t = ap(buffer, size, t, ();
 
-		s = t = t + strlen(t);
+		s = t;
 
 		i = 0;
 		while (sflagstrings[i].bit)
@@ -2499,16 +2508,15 @@ parsestate(
 			{
 if (t != s)
 {
-	strncpy(t, ; , BUFFER_SIZES(buffer, t, size));
-	t += 2;
+	t = ap(buffer, size, t, ; );
 }
 	
-strncpy(t, sflagstrings[i].name, BUFFER_SIZES(buffer, t, size));
-t += strlen(t);
+t = ap(buffer, size, t, %s,
+sflagstrings[i].name);
 			}
 			i++;
 		}
-		strncpy(t, ), BUFFER_SIZES(buffer, t, size));
+		t = ap(buffer, size, t, ));
 	}
 	return buffer;
 }
@@ -2539,7 +2547,9 @@ parsestatus(
 		  { 0,		 NULL }
 	  };
 	int i;
+	char *t;
 
+	t = buffer;
 	*buffer = '\0';
 
 	i = 0;
@@ -2547,9 +2557,9 @@ parsestatus(
 	{
 		if (flagstrings[i].bit  lstate)
 		{
-			if (buffer[0])
-strncat(buffer, ; , size);
-			strncat(buffer, flagstrings[i].name, size - 2);
+			if (t == buffer)
+t = ap(buffer, size, t, ; );
+			t = ap(buffer, size, t, %s, flagstrings[i].name);
 		}
 		i++;
 	}
@@ -2612,10 +2622,11 @@ l_mktime(
 	char *t;
 
 	buffer[0] = '\0';
+	t = buffer;
 
 	if ((tmp = delta / (60*60*24)) != 0)
 	{
-		snprintf(buffer, BUFFER_SIZE(buffer, buffer), %ldd+, (u_long)tmp);
+		t = ap(buffer, sizeof(buffer), t, %ldd+, (u_long)tmp);
 		delta -= tmp * 60*60*24;
 	}
 
@@ -2624,10 +2635,8 @@ l_mktime(
 	m = delta % 60;
 	delta /= 60;
 
-	t = buffer + strlen(buffer);
-
-	snprintf(t, BUFFER_SIZE(buffer, t), %02d:%02d:%02d,
-		 (int)delta, (int)m, (int)s);
+	t = ap(buffer, sizeof(buffer), t, %02d:%02d:%02d,
+	 (int)delta, (int)m, (int)s);
 
 	return buffer;
 }
@@ -3206,7 +3215,7 @@ parse_start(
 		return 0;			/* well, ok - special initialisation broke */
 	}
   
-	strncpy(tmp_ctl.parseformat.parse_buffer, parse-parse_type-cl_format, sizeof(tmp_ctl.parseformat.parse_buffer));
+	strlcpy(tmp_ctl.parseformat.parse_buffer, parse-parse_type-cl_format, sizeof(tmp_ctl.parseformat.parse_buffer));
 	tmp_ctl.parseformat.parse_count = strlen(tmp_ctl.parseformat.parse_buffer);
 
 	if (!PARSE_SETFMT(parse, tmp_ctl))
@@ -3490,16 +3499,16 @@ parse_control(
 		}
 
 		start = tt = add_var(out-kv_list, 128, RO|DEF);
-		snprintf(tt, 128, refclock_time=\);
-		tt += strlen(tt);
+		tt = ap(start, 128, tt, refclock_time=\);
 
 		if (parse-timedata.parse_time.fp.l_ui == 0)
 		{
-			strncpy(tt, UNDEFINED\, BUFFER_SIZES(start, tt, 128));
+			tt = ap(start, 128, tt, UNDEFINED\);
 		}
 		else
 		{
-			snprintf(tt, 128, %s\, gmprettydate(parse-timedata.parse_time.fp));
+			tt = ap(start, 128, tt, %s\,
+			gmprettydate(parse-timedata.parse_time.fp));
 		}
 
 		if (!PARSE_GETTIMECODE(parse, tmpctl))
@@ -3510,8 +3519,7 @@ parse_control(
 		else
 		{
 			start = tt = add_var(out-kv_list, 512, 

CVS commit: src/external/bsd/ntp/dist/ntpdc

2012-06-25 Thread John Nemeth
Module Name:src
Committed By:   jnemeth
Date:   Mon Jun 25 20:23:43 UTC 2012

Modified Files:
src/external/bsd/ntp/dist/ntpdc: ntpdc.c

Log Message:
PR/46612 - Lloyd Parkes -- add a terminating newline to error messages


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/ntp/dist/ntpdc/ntpdc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpdc/ntpdc.c
diff -u src/external/bsd/ntp/dist/ntpdc/ntpdc.c:1.5 src/external/bsd/ntp/dist/ntpdc/ntpdc.c:1.6
--- src/external/bsd/ntp/dist/ntpdc/ntpdc.c:1.5	Wed Feb  1 22:48:15 2012
+++ src/external/bsd/ntp/dist/ntpdc/ntpdc.c	Mon Jun 25 20:23:43 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntpdc.c,v 1.5 2012/02/01 22:48:15 kardel Exp $	*/
+/*	$NetBSD: ntpdc.c,v 1.6 2012/06/25 20:23:43 jnemeth Exp $	*/
 
 /*
  * ntpdc - control and monitor your ntpd daemon
@@ -1932,7 +1932,7 @@ vwarning(const char *fmt, va_list ap)
 	int serrno = errno;
 	(void) fprintf(stderr, %s: , progname);
 	vfprintf(stderr, fmt, ap);
-	(void) fprintf(stderr, : %s, strerror(serrno));
+	(void) fprintf(stderr, : %s\n, strerror(serrno));
 }
 
 /*



CVS commit: src/external/bsd/ntp/dist/util

2012-02-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb  9 17:53:56 UTC 2012

Modified Files:
src/external/bsd/ntp/dist/util: ntp-keygen.c

Log Message:
fix printf format.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/ntp/dist/util/ntp-keygen.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/util/ntp-keygen.c
diff -u src/external/bsd/ntp/dist/util/ntp-keygen.c:1.3 src/external/bsd/ntp/dist/util/ntp-keygen.c:1.4
--- src/external/bsd/ntp/dist/util/ntp-keygen.c:1.3	Wed Feb  1 02:46:30 2012
+++ src/external/bsd/ntp/dist/util/ntp-keygen.c	Thu Feb  9 12:53:56 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp-keygen.c,v 1.3 2012/02/01 07:46:30 kardel Exp $	*/
+/*	$NetBSD: ntp-keygen.c,v 1.4 2012/02/09 17:53:56 christos Exp $	*/
 
 /*
  * Program to generate cryptographic keys for ntp clients and servers
@@ -2068,8 +2068,8 @@ fheader	(
 	char	linkname[MAXFILENAME]; /* link name */
 	int	temp;
 
-	sprintf(filename, ntpkey_%s_%s.%lu, file, owner, epoch +
-	JAN_1970);
+	snprintf(filename, sizeof(filename), ntpkey_%s_%s.%lld, file, owner,
+	(long long)(epoch + JAN_1970));
 	if ((str = fopen(filename, w)) == NULL) {
 		perror(Write);
 		exit (-1);



CVS commit: src/external/bsd/ntp/dist/include

2012-02-04 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Sat Feb  4 14:56:58 UTC 2012

Modified Files:
src/external/bsd/ntp/dist/include: ntp_stdlib.h

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/ntp/dist/include/ntp_stdlib.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/include/ntp_stdlib.h
diff -u src/external/bsd/ntp/dist/include/ntp_stdlib.h:1.3 src/external/bsd/ntp/dist/include/ntp_stdlib.h:1.4
--- src/external/bsd/ntp/dist/include/ntp_stdlib.h:1.3	Wed Feb  1 07:46:21 2012
+++ src/external/bsd/ntp/dist/include/ntp_stdlib.h	Sat Feb  4 14:56:58 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_stdlib.h,v 1.3 2012/02/01 07:46:21 kardel Exp $	*/
+/*	$NetBSD: ntp_stdlib.h,v 1.4 2012/02/04 14:56:58 he Exp $	*/
 
 /*
  * ntp_stdlib.h - Prototypes for NTP lib.
@@ -90,6 +90,7 @@ extern	u_int32	addr2refid	(sockaddr_u *)
 #ifndef EREALLOC_CALLSITE	/* ntp_malloc.h defines */
 extern	void *	ereallocz	(void *, size_t, size_t, int);
 #define	erealloczsite(p, n, o, z, f, l) ereallocz(p, n, o, (z))
+#define emalloc(arg)		ntp_emalloc(arg)
 extern	void *	emalloc		(size_t);
 #define	emalloc_zero(c)		ereallocz(NULL, (c), 0, TRUE)
 #define	erealloc(p, c)		ereallocz(p, (c), 0, FALSE)



CVS commit: src/external/bsd/ntp/dist

2012-02-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Feb  4 16:31:02 UTC 2012

Modified Files:
src/external/bsd/ntp/dist/include: ntp_stdlib.h
src/external/bsd/ntp/dist/libntp: emalloc.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/ntp/dist/include/ntp_stdlib.h
cvs rdiff -u -r1.1.1.2 -r1.2 src/external/bsd/ntp/dist/libntp/emalloc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/include/ntp_stdlib.h
diff -u src/external/bsd/ntp/dist/include/ntp_stdlib.h:1.4 src/external/bsd/ntp/dist/include/ntp_stdlib.h:1.5
--- src/external/bsd/ntp/dist/include/ntp_stdlib.h:1.4	Sat Feb  4 09:56:58 2012
+++ src/external/bsd/ntp/dist/include/ntp_stdlib.h	Sat Feb  4 11:31:02 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_stdlib.h,v 1.4 2012/02/04 14:56:58 he Exp $	*/
+/*	$NetBSD: ntp_stdlib.h,v 1.5 2012/02/04 16:31:02 christos Exp $	*/
 
 /*
  * ntp_stdlib.h - Prototypes for NTP lib.
@@ -90,8 +90,7 @@ extern	u_int32	addr2refid	(sockaddr_u *)
 #ifndef EREALLOC_CALLSITE	/* ntp_malloc.h defines */
 extern	void *	ereallocz	(void *, size_t, size_t, int);
 #define	erealloczsite(p, n, o, z, f, l) ereallocz(p, n, o, (z))
-#define emalloc(arg)		ntp_emalloc(arg)
-extern	void *	emalloc		(size_t);
+#define	emalloc(n)		ereallocz(NULL, n, 0, FALSE)
 #define	emalloc_zero(c)		ereallocz(NULL, (c), 0, TRUE)
 #define	erealloc(p, c)		ereallocz(p, (c), 0, FALSE)
 #define erealloc_zero(p, n, o)	ereallocz(p, n, (o), TRUE)

Index: src/external/bsd/ntp/dist/libntp/emalloc.c
diff -u src/external/bsd/ntp/dist/libntp/emalloc.c:1.1.1.2 src/external/bsd/ntp/dist/libntp/emalloc.c:1.2
--- src/external/bsd/ntp/dist/libntp/emalloc.c:1.1.1.2	Tue Jan 31 16:24:16 2012
+++ src/external/bsd/ntp/dist/libntp/emalloc.c	Sat Feb  4 11:31:02 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: emalloc.c,v 1.1.1.2 2012/01/31 21:24:16 kardel Exp $	*/
+/*	$NetBSD: emalloc.c,v 1.2 2012/02/04 16:31:02 christos Exp $	*/
 
 /*
  * emalloc - return new memory obtained from the system.  Belch if none.
@@ -88,6 +88,7 @@ estrdup_impl(
 }
 
 
+#if 0
 #ifndef EREALLOC_CALLSITE
 void *
 emalloc(size_t newsz)
@@ -95,4 +96,5 @@ emalloc(size_t newsz)
 	return ereallocz(NULL, newsz, 0, FALSE);
 }
 #endif
+#endif
 



CVS commit: src/external/bsd/ntp/dist/ntpq

2012-02-03 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Fri Feb  3 10:20:29 UTC 2012

Modified Files:
src/external/bsd/ntp/dist/ntpq: ntpq.c

Log Message:
Clang compile fix from Joerg Sonneberger approved by releng.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/ntp/dist/ntpq/ntpq.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpq/ntpq.c
diff -u src/external/bsd/ntp/dist/ntpq/ntpq.c:1.6 src/external/bsd/ntp/dist/ntpq/ntpq.c:1.7
--- src/external/bsd/ntp/dist/ntpq/ntpq.c:1.6	Wed Feb  1 22:48:15 2012
+++ src/external/bsd/ntp/dist/ntpq/ntpq.c	Fri Feb  3 10:20:29 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntpq.c,v 1.6 2012/02/01 22:48:15 kardel Exp $	*/
+/*	$NetBSD: ntpq.c,v 1.7 2012/02/03 10:20:29 kardel Exp $	*/
 
 /*
  * ntpq - query an NTP server using mode 6 commands
@@ -1080,7 +1080,7 @@ getresponse(
 
 		if (debug = 2)
 			printf(Got packet, size = %d\n, n);
-		if ((int)count  (n - CTL_HEADER_LEN)) {
+		if ((int)count  (n - (int)CTL_HEADER_LEN)) {
 			if (debug)
 printf(Received count of %d octets, 
 	data in packet is %u\n,



CVS commit: src/external/bsd/ntp/dist/ntpq

2012-02-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Feb  3 14:36:51 UTC 2012

Modified Files:
src/external/bsd/ntp/dist/ntpq: ntpq.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/ntp/dist/ntpq/ntpq.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpq/ntpq.c
diff -u src/external/bsd/ntp/dist/ntpq/ntpq.c:1.7 src/external/bsd/ntp/dist/ntpq/ntpq.c:1.8
--- src/external/bsd/ntp/dist/ntpq/ntpq.c:1.7	Fri Feb  3 05:20:29 2012
+++ src/external/bsd/ntp/dist/ntpq/ntpq.c	Fri Feb  3 09:36:51 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntpq.c,v 1.7 2012/02/03 10:20:29 kardel Exp $	*/
+/*	$NetBSD: ntpq.c,v 1.8 2012/02/03 14:36:51 christos Exp $	*/
 
 /*
  * ntpq - query an NTP server using mode 6 commands
@@ -1080,7 +1080,7 @@ getresponse(
 
 		if (debug = 2)
 			printf(Got packet, size = %d\n, n);
-		if ((int)count  (n - (int)CTL_HEADER_LEN)) {
+		if (count  (u_int)(n - CTL_HEADER_LEN)) {
 			if (debug)
 printf(Received count of %d octets, 
 	data in packet is %u\n,



CVS commit: src/external/bsd/ntp/dist/sntp

2012-02-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Feb  3 21:35:55 UTC 2012

Modified Files:
src/external/bsd/ntp/dist/sntp: main.c

Log Message:
don't bother with ifdef's, just grab the biggest type you can.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/ntp/dist/sntp/main.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/sntp/main.c
diff -u src/external/bsd/ntp/dist/sntp/main.c:1.5 src/external/bsd/ntp/dist/sntp/main.c:1.6
--- src/external/bsd/ntp/dist/sntp/main.c:1.5	Fri Feb  3 11:33:10 2012
+++ src/external/bsd/ntp/dist/sntp/main.c	Fri Feb  3 16:35:55 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.5 2012/02/03 16:33:10 christos Exp $	*/
+/*	$NetBSD: main.c,v 1.6 2012/02/03 21:35:55 christos Exp $	*/
 
 #include config.h
 
@@ -203,7 +203,6 @@ handle_pkt (
 	double offset, precision, root_dispersion;
 	char addr_buf[INET6_ADDRSTRLEN];
 	char *p_SNTP_PRETEND_TIME;
-	time_t pretend_time;
 
 	if(rpktl  0)
 		sw_case = 1;
@@ -251,14 +250,9 @@ handle_pkt (
 
 		p_SNTP_PRETEND_TIME = getenv(SNTP_PRETEND_TIME);
 		if (p_SNTP_PRETEND_TIME) {
-#if SIZEOF_TIME_T == 4
-			sscanf(p_SNTP_PRETEND_TIME, %ld, pretend_time);
-#elif SIZEOF_TIME_T == 8
-			sscanf(p_SNTP_PRETEND_TIME, %zd, pretend_time);
-#else
-# include GRONK: unexpected value for SIZEOF_TIME_T
-#endif
-			tv_dst.tv_sec = pretend_time;
+			long long input_time;
+			sscanf(p_SNTP_PRETEND_TIME, %lld, input_time);
+			tv_dst.tv_sec = (time_t)input_time;
 		}
 
 		offset_calculation(rpkt, rpktl, tv_dst, offset,



CVS commit: src/external/bsd/ntp/dist

2012-02-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Feb  3 21:36:41 UTC 2012

Modified Files:
src/external/bsd/ntp/dist/libopts: autoopts.h
src/external/bsd/ntp/dist/sntp/libopts: autoopts.c autoopts.h
configfile.c enumeration.c file.c load.c makeshell.c nested.c
parse-duration.c putshell.c reset.c save.c streqvcmp.c tokenize.c
src/external/bsd/ntp/dist/sntp/libopts/autoopts: options.h
src/external/bsd/ntp/dist/sntp/libopts/compat: pathfind.c

Log Message:
cleanup compilation (not TRT, but the expedient way)


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/ntp/dist/libopts/autoopts.h
cvs rdiff -u -r1.1.1.2 -r1.2 \
src/external/bsd/ntp/dist/sntp/libopts/autoopts.c \
src/external/bsd/ntp/dist/sntp/libopts/configfile.c \
src/external/bsd/ntp/dist/sntp/libopts/enumeration.c \
src/external/bsd/ntp/dist/sntp/libopts/file.c \
src/external/bsd/ntp/dist/sntp/libopts/load.c \
src/external/bsd/ntp/dist/sntp/libopts/makeshell.c \
src/external/bsd/ntp/dist/sntp/libopts/putshell.c \
src/external/bsd/ntp/dist/sntp/libopts/reset.c \
src/external/bsd/ntp/dist/sntp/libopts/streqvcmp.c \
src/external/bsd/ntp/dist/sntp/libopts/tokenize.c
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/ntp/dist/sntp/libopts/autoopts.h \
src/external/bsd/ntp/dist/sntp/libopts/nested.c \
src/external/bsd/ntp/dist/sntp/libopts/save.c
cvs rdiff -u -r1.2 -r1.3 \
src/external/bsd/ntp/dist/sntp/libopts/parse-duration.c
cvs rdiff -u -r1.4 -r1.5 \
src/external/bsd/ntp/dist/sntp/libopts/autoopts/options.h
cvs rdiff -u -r1.1.1.2 -r1.2 \
src/external/bsd/ntp/dist/sntp/libopts/compat/pathfind.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/libopts/autoopts.h
diff -u src/external/bsd/ntp/dist/libopts/autoopts.h:1.2 src/external/bsd/ntp/dist/libopts/autoopts.h:1.3
--- src/external/bsd/ntp/dist/libopts/autoopts.h:1.2	Sat Dec  4 18:08:34 2010
+++ src/external/bsd/ntp/dist/libopts/autoopts.h	Fri Feb  3 16:36:40 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoopts.h,v 1.2 2010/12/04 23:08:34 christos Exp $	*/
+/*	$NetBSD: autoopts.h,v 1.3 2012/02/03 21:36:40 christos Exp $	*/
 
 
 /*
@@ -215,10 +215,7 @@ typedef struct {
 
 #define AGALOC( c, w )  ao_malloc((size_t)c)
 #define AGREALOC( p, c, w ) ao_realloc((void*)p, (size_t)c)
-#define AGFREE(_p)  do{ \
-void *X = (void*)(intptr_t)_p; \
-ao_free(X);\
-} while (/*CONSTCOND*/0)
+#define AGFREE(_p)  ao_free((void*)(intptr_t)(p))
 #define AGDUPSTR( p, s, w ) (p = ao_strdup(s))
 
 static void *

Index: src/external/bsd/ntp/dist/sntp/libopts/autoopts.c
diff -u src/external/bsd/ntp/dist/sntp/libopts/autoopts.c:1.1.1.2 src/external/bsd/ntp/dist/sntp/libopts/autoopts.c:1.2
--- src/external/bsd/ntp/dist/sntp/libopts/autoopts.c:1.1.1.2	Tue Jan 31 16:27:48 2012
+++ src/external/bsd/ntp/dist/sntp/libopts/autoopts.c	Fri Feb  3 16:36:40 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoopts.c,v 1.1.1.2 2012/01/31 21:27:48 kardel Exp $	*/
+/*	$NetBSD: autoopts.c,v 1.2 2012/02/03 21:36:40 christos Exp $	*/
 
 
 /**
@@ -37,7 +37,7 @@
 #endif
 
 static char const   zNil[] = ;
-static arg_types_t  argTypes = { NULL };
+static arg_types_t  argTypes = { .pzStr = NULL };
 static char zOptFmtLine[16]  = { NUL };
 static ag_bool  displayEnum  = AG_FALSE;
 static char const   pkgdatadir_default[] = PKGDATADIR;
@@ -180,7 +180,8 @@ handle_opt(tOptions* pOpts, tOptState* p
  *  THEN we have a usage problem.
  */
 if (p-optActualIndex != pOD-optIndex) {
-fprintf(stderr, (char*)zMultiEquiv, p-pz_Name, pOD-pz_Name,
+fprintf(stderr, (const char*)zMultiEquiv, p-pz_Name,
+			pOD-pz_Name,
 (pOpts-pOptDesc + p-optActualIndex)-pz_Name);
 return FAILURE;
 }
@@ -273,7 +274,7 @@ longOptionFind(tOptions* pOpts, char* pz
 intidxLim   = pOpts-optCt;
 intmatchCt  = 0;
 intmatchIdx = 0;
-intnameLen;
+size_t nameLen;
 char   opt_name_buf[128];
 
 /*
@@ -281,7 +282,7 @@ longOptionFind(tOptions* pOpts, char* pz
  *  copy it off so we can NUL terminate.
  */
 if (pzEq != NULL) {
-nameLen = (int)(pzEq - pzOptName);
+nameLen = (size_t)(pzEq - pzOptName);
 if (nameLen = sizeof(opt_name_buf))
 return FAILURE;
 memcpy(opt_name_buf, pzOptName, nameLen);
@@ -517,7 +518,7 @@ findOptDesc(tOptions* pOpts, tOptState* 
  *  strip off the const quality of the default_opt field.
  */
 while (*(++pz) == '-')   ;
-def_opt = (void *)(pOpts-specOptIdx.default_opt);
+def_opt = (void *)(intptr_t)(pOpts-specOptIdx.default_opt);
 def = *def_opt;
 

CVS commit: src/external/bsd/ntp/dist/ntpd

2012-02-01 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Wed Feb  1 21:21:26 UTC 2012

Modified Files:
src/external/bsd/ntp/dist/ntpd: ntp_io.c

Log Message:
initialize min_dist


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/ntp/dist/ntpd/ntp_io.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/ntp_io.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.8 src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.9
--- src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.8	Wed Feb  1 20:48:01 2012
+++ src/external/bsd/ntp/dist/ntpd/ntp_io.c	Wed Feb  1 21:21:25 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_io.c,v 1.8 2012/02/01 20:48:01 kardel Exp $	*/
+/*	$NetBSD: ntp_io.c,v 1.9 2012/02/01 21:21:25 kardel Exp $	*/
 
 /*
  * ntp_io.c - input/output routines for ntpd.	The socket-opening code
@@ -3801,7 +3801,9 @@ findclosestinterface(
 	sockaddr_u	addr_dist;
 	sockaddr_u	min_dist;
 
+	
 	winner = NULL;
+	min_dist = *addr;
 	
 	for (ep = ep_list; ep != NULL; ep = ep-elink) {
 		if (ep-ignore_packets ||



CVS commit: src/external/bsd/ntp/dist

2012-02-01 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Wed Feb  1 22:48:16 UTC 2012

Modified Files:
src/external/bsd/ntp/dist/ntpd: ntp_request.c
src/external/bsd/ntp/dist/ntpdc: ntpdc.c
src/external/bsd/ntp/dist/ntpq: ntpq.c

Log Message:
cleanup printf fmt differences between i386/amd64


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/ntp/dist/ntpd/ntp_request.c
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/ntp/dist/ntpdc/ntpdc.c
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/ntp/dist/ntpq/ntpq.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/ntp_request.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_request.c:1.6 src/external/bsd/ntp/dist/ntpd/ntp_request.c:1.7
--- src/external/bsd/ntp/dist/ntpd/ntp_request.c:1.6	Wed Feb  1 07:46:22 2012
+++ src/external/bsd/ntp/dist/ntpd/ntp_request.c	Wed Feb  1 22:48:15 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_request.c,v 1.6 2012/02/01 07:46:22 kardel Exp $	*/
+/*	$NetBSD: ntp_request.c,v 1.7 2012/02/01 22:48:15 kardel Exp $	*/
 
 /*
  * ntp_request.c - respond to information requests
@@ -584,13 +584,13 @@ process_private(
 		 */
 		if (!INFO_IS_AUTH(inpkt-auth_seq) || !info_auth_keyid
 		|| ntohl(tailinpkt-keyid) != info_auth_keyid) {
-			DPRINTF(5, (failed auth %d info_auth_keyid %u pkt keyid %u maclen %zu\n,
+			DPRINTF(5, (failed auth %d info_auth_keyid %u pkt keyid %u maclen %lu\n,
 INFO_IS_AUTH(inpkt-auth_seq),
 info_auth_keyid,
 ntohl(tailinpkt-keyid), (u_long)mac_len));
 #ifdef DEBUG
 			msyslog(LOG_DEBUG,
-process_private: failed auth %d info_auth_keyid %u pkt keyid %u maclen %zu\n,
+process_private: failed auth %d info_auth_keyid %u pkt keyid %u maclen %lu\n,
 INFO_IS_AUTH(inpkt-auth_seq),
 info_auth_keyid,
 ntohl(tailinpkt-keyid), (u_long)mac_len);

Index: src/external/bsd/ntp/dist/ntpdc/ntpdc.c
diff -u src/external/bsd/ntp/dist/ntpdc/ntpdc.c:1.4 src/external/bsd/ntp/dist/ntpdc/ntpdc.c:1.5
--- src/external/bsd/ntp/dist/ntpdc/ntpdc.c:1.4	Wed Feb  1 07:46:23 2012
+++ src/external/bsd/ntp/dist/ntpdc/ntpdc.c	Wed Feb  1 22:48:15 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntpdc.c,v 1.4 2012/02/01 07:46:23 kardel Exp $	*/
+/*	$NetBSD: ntpdc.c,v 1.5 2012/02/01 22:48:15 kardel Exp $	*/
 
 /*
  * ntpdc - control and monitor your ntpd daemon
@@ -1782,7 +1782,7 @@ keytype(
 	int		key_type;
 
 	if (!pcmd-nargs) {
-		fprintf(fp, keytype is %s with %zu octet digests\n,
+		fprintf(fp, keytype is %s with %lu octet digests\n,
 			keytype_name(info_auth_keytype),
 			(u_long)info_auth_hashlen);
 		return;

Index: src/external/bsd/ntp/dist/ntpq/ntpq.c
diff -u src/external/bsd/ntp/dist/ntpq/ntpq.c:1.5 src/external/bsd/ntp/dist/ntpq/ntpq.c:1.6
--- src/external/bsd/ntp/dist/ntpq/ntpq.c:1.5	Wed Feb  1 20:48:01 2012
+++ src/external/bsd/ntp/dist/ntpq/ntpq.c	Wed Feb  1 22:48:15 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntpq.c,v 1.5 2012/02/01 20:48:01 kardel Exp $	*/
+/*	$NetBSD: ntpq.c,v 1.6 2012/02/01 22:48:15 kardel Exp $	*/
 
 /*
  * ntpq - query an NTP server using mode 6 commands
@@ -1031,9 +1031,9 @@ getresponse(
 
 		if (n  shouldbesize) {
 			printf(Response packet claims %u octets 
-payload, above %ld received\n,
+payload, above %u received\n,
 count,
-n - CTL_HEADER_LEN
+(u_int)(n - CTL_HEADER_LEN)
 );
 			return ERR_INCOMPLETE;
 		}
@@ -1083,8 +1083,8 @@ getresponse(
 		if ((int)count  (n - CTL_HEADER_LEN)) {
 			if (debug)
 printf(Received count of %d octets, 
-	data in packet is %lu\n,
-	count, n-CTL_HEADER_LEN);
+	data in packet is %u\n,
+	count, (u_int)(n-CTL_HEADER_LEN));
 			continue;
 		}
 		if (count == 0  CTL_ISMORE(rpkt.r_m_e_op)) {
@@ -2448,7 +2448,7 @@ keytype(
 	int		key_type;
 
 	if (!pcmd-nargs) {
-		fprintf(fp, keytype is %s with %zu octet digests\n,
+		fprintf(fp, keytype is %s with %lu octet digests\n,
 			keytype_name(info_auth_keytype),
 			(u_long)info_auth_hashlen);
 		return;



CVS commit: src/external/bsd/ntp/dist

2012-01-31 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Tue Jan 31 21:29:40 UTC 2012

Update of /cvsroot/src/external/bsd/ntp/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv2606

Log Message:
Import ntp 4.2.6p5

Status:

Vendor Tag: UDEL
Release Tags:   ntp-4-2-6p5

U src/external/bsd/ntp/dist/CommitLog-4.1.0
U src/external/bsd/ntp/dist/COPYRIGHT
U src/external/bsd/ntp/dist/ChangeLog
U src/external/bsd/ntp/dist/CommitLog
U src/external/bsd/ntp/dist/Makefile.am
U src/external/bsd/ntp/dist/INSTALL
U src/external/bsd/ntp/dist/NOTES.y2kfixes
U src/external/bsd/ntp/dist/Makefile.in
U src/external/bsd/ntp/dist/NEWS
U src/external/bsd/ntp/dist/README.bk
U src/external/bsd/ntp/dist/README
U src/external/bsd/ntp/dist/bincheck.mf
U src/external/bsd/ntp/dist/README.hackers
U src/external/bsd/ntp/dist/README.patches
U src/external/bsd/ntp/dist/README.refclocks
U src/external/bsd/ntp/dist/README.versions
U src/external/bsd/ntp/dist/TODO
U src/external/bsd/ntp/dist/WHERE-TO-START
U src/external/bsd/ntp/dist/aclocal.m4
U src/external/bsd/ntp/dist/bootstrap
U src/external/bsd/ntp/dist/build
U src/external/bsd/ntp/dist/compile
U src/external/bsd/ntp/dist/config.guess
U src/external/bsd/ntp/dist/config.h.in
U src/external/bsd/ntp/dist/config.sub
U src/external/bsd/ntp/dist/configure
U src/external/bsd/ntp/dist/configure.ac
U src/external/bsd/ntp/dist/depcomp
U src/external/bsd/ntp/dist/deps-ver
U src/external/bsd/ntp/dist/depsver.mf
U src/external/bsd/ntp/dist/dot.emacs
U src/external/bsd/ntp/dist/excludes
U src/external/bsd/ntp/dist/flock-build
U src/external/bsd/ntp/dist/install-sh
U src/external/bsd/ntp/dist/ltmain.sh
U src/external/bsd/ntp/dist/missing
U src/external/bsd/ntp/dist/packageinfo.sh
U src/external/bsd/ntp/dist/readme.y2kfixes
U src/external/bsd/ntp/dist/results.y2kfixes
U src/external/bsd/ntp/dist/version.m4
U src/external/bsd/ntp/dist/version
U src/external/bsd/ntp/dist/ylwrap
U src/external/bsd/ntp/dist/ElectricFence/tstheap.c
U src/external/bsd/ntp/dist/ElectricFence/efence.c
U src/external/bsd/ntp/dist/ElectricFence/eftest.c
U src/external/bsd/ntp/dist/ElectricFence/README
U src/external/bsd/ntp/dist/ElectricFence/page.c
U src/external/bsd/ntp/dist/ElectricFence/libefence.3
U src/external/bsd/ntp/dist/ElectricFence/Makefile.in
U src/external/bsd/ntp/dist/ElectricFence/print.c
U src/external/bsd/ntp/dist/ElectricFence/CHANGES
U src/external/bsd/ntp/dist/ElectricFence/Makefile.am
U src/external/bsd/ntp/dist/ElectricFence/COPYING
U src/external/bsd/ntp/dist/ElectricFence/efence.h
U src/external/bsd/ntp/dist/adjtimed/adjtimed.c
U src/external/bsd/ntp/dist/adjtimed/README
U src/external/bsd/ntp/dist/adjtimed/Makefile.in
U src/external/bsd/ntp/dist/adjtimed/Makefile.am
U src/external/bsd/ntp/dist/clockstuff/clktest.c
U src/external/bsd/ntp/dist/clockstuff/propdelay.c
U src/external/bsd/ntp/dist/clockstuff/chutest.c
U src/external/bsd/ntp/dist/clockstuff/Makefile.am
U src/external/bsd/ntp/dist/clockstuff/Makefile.in
U src/external/bsd/ntp/dist/clockstuff/README
U src/external/bsd/ntp/dist/conf/beauregard.conf
U src/external/bsd/ntp/dist/conf/malarky.conf
U src/external/bsd/ntp/dist/conf/pogo.conf
U src/external/bsd/ntp/dist/conf/rackety.conf
U src/external/bsd/ntp/dist/conf/grundoon.conf
U src/external/bsd/ntp/dist/conf/baldwin.conf
U src/external/bsd/ntp/dist/conf/README
U src/external/bsd/ntp/dist/html/ntptrace.html
U src/external/bsd/ntp/dist/html/kern.html
U src/external/bsd/ntp/dist/html/copyright.html
U src/external/bsd/ntp/dist/html/release.html
U src/external/bsd/ntp/dist/html/xleave.html
U src/external/bsd/ntp/dist/html/sntp.html
U src/external/bsd/ntp/dist/html/rate.html
U src/external/bsd/ntp/dist/html/accopt.html
U src/external/bsd/ntp/dist/html/config.html
U src/external/bsd/ntp/dist/html/ntpdc.html
U src/external/bsd/ntp/dist/html/rdebug.html
U src/external/bsd/ntp/dist/html/refclock.html
U src/external/bsd/ntp/dist/html/comdex.html
U src/external/bsd/ntp/dist/html/miscopt.html
U src/external/bsd/ntp/dist/html/ntp_conf.html
U src/external/bsd/ntp/dist/html/quick.html
U src/external/bsd/ntp/dist/html/manyopt.html
U src/external/bsd/ntp/dist/html/parsedata.html
U src/external/bsd/ntp/dist/html/extern.html
U src/external/bsd/ntp/dist/html/decode.html
U src/external/bsd/ntp/dist/html/howto.html
N src/external/bsd/ntp/dist/html/ntp-wait.html
U src/external/bsd/ntp/dist/html/build.html
U src/external/bsd/ntp/dist/html/ntpdsim.html
U src/external/bsd/ntp/dist/html/authopt.html
U src/external/bsd/ntp/dist/html/pps.html
U src/external/bsd/ntp/dist/html/parsenew.html
U src/external/bsd/ntp/dist/html/ntpdate.html
U src/external/bsd/ntp/dist/html/kernpps.html
U src/external/bsd/ntp/dist/html/gadget.html
U src/external/bsd/ntp/dist/html/msyslog.html
U src/external/bsd/ntp/dist/html/assoc.html
U src/external/bsd/ntp/dist/html/tickadj.html
U src/external/bsd/ntp/dist/html/ntpq.html
U src/external/bsd/ntp/dist/html/hints.html
U src/external/bsd/ntp/dist/html/clockopt.html
U 

CVS commit: src/external/bsd/ntp/dist/libopts/compat

2011-09-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep 22 12:40:48 UTC 2011

Modified Files:
src/external/bsd/ntp/dist/libopts/compat: pathfind.c

Log Message:
Check result of malloc (Maksymilian Arciemowicz)


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/ntp/dist/libopts/compat/pathfind.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/libopts/compat/pathfind.c
diff -u src/external/bsd/ntp/dist/libopts/compat/pathfind.c:1.2 src/external/bsd/ntp/dist/libopts/compat/pathfind.c:1.3
--- src/external/bsd/ntp/dist/libopts/compat/pathfind.c:1.2	Sat Dec  4 18:08:34 2010
+++ src/external/bsd/ntp/dist/libopts/compat/pathfind.c	Thu Sep 22 08:40:48 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pathfind.c,v 1.2 2010/12/04 23:08:34 christos Exp $	*/
+/*	$NetBSD: pathfind.c,v 1.3 2011/09/22 12:40:48 christos Exp $	*/
 
 /*  -*- Mode: C -*-  */
 
@@ -15,6 +15,7 @@
 /* Code: */
 
 #include compat.h
+
 #ifndef HAVE_PATHFIND
 #if defined(__windows__)  !defined(__CYGWIN__)
 char*
@@ -175,6 +176,8 @@
 } else {
 if (dot_path  dot_path[0]) {
 result = malloc( 2 + strlen( dot_path ) + strlen( string ) );
+	if (result == NULL)
+		err(1, malloc);
 strcpy( result, dot_path );
 result_len = strlen( result );
 if (result[result_len - 1] != '/') {
@@ -183,6 +186,8 @@
 }
 } else {
 result = malloc( 3 + strlen( string ) );
+	if (result == NULL)
+		err(1, malloc);
 result[0] = '.'; result[1] = '/'; result[2] = '\0';
 result_len = 2;
 }



CVS commit: src/external/bsd/ntp/dist/libopts

2011-09-22 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Thu Sep 22 16:05:11 UTC 2011

Modified Files:
src/external/bsd/ntp/dist/libopts: configfile.c
src/external/bsd/ntp/dist/libopts/compat: pathfind.c

Log Message:
Make this build again: include err.h when needed, and don't
shadow err() with a local variable called err...


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/ntp/dist/libopts/configfile.c
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/ntp/dist/libopts/compat/pathfind.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/libopts/configfile.c
diff -u src/external/bsd/ntp/dist/libopts/configfile.c:1.2 src/external/bsd/ntp/dist/libopts/configfile.c:1.3
--- src/external/bsd/ntp/dist/libopts/configfile.c:1.2	Sat Dec  4 23:08:34 2010
+++ src/external/bsd/ntp/dist/libopts/configfile.c	Thu Sep 22 16:05:11 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: configfile.c,v 1.2 2010/12/04 23:08:34 christos Exp $	*/
+/*	$NetBSD: configfile.c,v 1.3 2011/09/22 16:05:11 he Exp $	*/
 
 /*
  *  Id: f1650b45a91ec95af830ff76041cc4f0048e60f0
@@ -131,9 +131,9 @@
 pRes = optionLoadNested(pzText, pzFile, strlen(pzFile));
 
 if (pRes == NULL) {
-int err = errno;
+int e = errno;
 text_munmap( cfgfile );
-errno = err;
+errno = e;
 } else
 text_munmap( cfgfile );
 
@@ -376,7 +376,7 @@
 {
 tArgList* pAL;
 tOptionValue* pRes = NULL;
-int   err  = EINVAL;
+int   e  = EINVAL;
 
 if ((pOVList == NULL) || (pOVList-valType != OPARG_TYPE_HIERARCHY)) {
 errno = EINVAL;
@@ -391,18 +391,18 @@
 tOptionValue* pNV = *(papNV++);
 if (pNV == pOldOV) {
 if (ct == 0) {
-err = ENOENT;
+e = ENOENT;
 
 } else {
-err  = 0;
+e  = 0;
 pRes = (tOptionValue*)*papNV;
 }
 break;
 }
 }
 }
-if (err != 0)
-errno = err;
+if (e != 0)
+errno = e;
 return pRes;
 }
 

Index: src/external/bsd/ntp/dist/libopts/compat/pathfind.c
diff -u src/external/bsd/ntp/dist/libopts/compat/pathfind.c:1.3 src/external/bsd/ntp/dist/libopts/compat/pathfind.c:1.4
--- src/external/bsd/ntp/dist/libopts/compat/pathfind.c:1.3	Thu Sep 22 12:40:48 2011
+++ src/external/bsd/ntp/dist/libopts/compat/pathfind.c	Thu Sep 22 16:05:11 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pathfind.c,v 1.3 2011/09/22 12:40:48 christos Exp $	*/
+/*	$NetBSD: pathfind.c,v 1.4 2011/09/22 16:05:11 he Exp $	*/
 
 /*  -*- Mode: C -*-  */
 
@@ -14,6 +14,8 @@
 
 /* Code: */
 
+#include err.h
+
 #include compat.h
 
 #ifndef HAVE_PATHFIND



CVS commit: src/external/bsd/ntp/dist/ntpd

2011-09-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Sep 14 16:18:29 UTC 2011

Modified Files:
src/external/bsd/ntp/dist/ntpd: ntp_io.c

Log Message:
PR/45308: Manuel Bouyer: Update list of broadcast addresses after updating
interfaces.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/ntp/dist/ntpd/ntp_io.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/ntp_io.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.5 src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.6
--- src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.5	Sun Jan  9 09:49:40 2011
+++ src/external/bsd/ntp/dist/ntpd/ntp_io.c	Wed Sep 14 12:18:29 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_io.c,v 1.5 2011/01/09 14:49:40 kardel Exp $	*/
+/*	$NetBSD: ntp_io.c,v 1.6 2011/09/14 16:18:29 christos Exp $	*/
 
 /*
  * ntp_io.c - input/output routines for ntpd.	The socket-opening code
@@ -1782,7 +1782,10 @@
 	create_wildcards(port);
 
 	update_interfaces(port, NULL, NULL);
-	
+
+	if (sys_bclient)
+		io_setbclient();
+
 	/*
 	 * Now that we have opened all the sockets, turn off the reuse
 	 * flag for security.



CVS commit: src/external/bsd/ntp/dist/ntpdc

2011-08-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 16 05:24:20 UTC 2011

Modified Files:
src/external/bsd/ntp/dist/ntpdc: ntpdc.c

Log Message:
- it is not the 80's anymore, use proper varargs
- no need to exit again, error does


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/ntp/dist/ntpdc/ntpdc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpdc/ntpdc.c
diff -u src/external/bsd/ntp/dist/ntpdc/ntpdc.c:1.2 src/external/bsd/ntp/dist/ntpdc/ntpdc.c:1.3
--- src/external/bsd/ntp/dist/ntpdc/ntpdc.c:1.2	Sat Dec  4 18:08:35 2010
+++ src/external/bsd/ntp/dist/ntpdc/ntpdc.c	Tue Aug 16 01:24:20 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntpdc.c,v 1.2 2010/12/04 23:08:35 christos Exp $	*/
+/*	$NetBSD: ntpdc.c,v 1.3 2011/08/16 05:24:20 christos Exp $	*/
 
 /*
  * ntpdc - control and monitor your ntpd daemon
@@ -102,8 +102,10 @@
 static	void	setdebug	(struct parse *, FILE *);
 static	void	quit		(struct parse *, FILE *);
 static	void	version		(struct parse *, FILE *);
-static	void	warning		(const char *, const char *, const char *);
-static	void	error		(const char *, const char *, const char *);
+static	void	warning		(const char *, ...)
+__attribute__((__format__(__printf__, 1, 2)));
+static	void	error		(const char *, ...)
+__attribute__((__format__(__printf__, 1, 2)));
 static	u_long	getkeyid	(const char *);
 
 
@@ -571,14 +573,12 @@
 	}
 
 	sockfd = socket(ai-ai_family, SOCK_DGRAM, 0);
-	if (sockfd == INVALID_SOCKET) {
-		error(socket, , );
-		exit(-1);
-	}
+	if (sockfd == INVALID_SOCKET)
+		error(socket);
 #else
 	sockfd = socket(ai-ai_family, SOCK_DGRAM, 0);
 	if (sockfd == -1)
-	error(socket, , );
+	error(socket);
 #endif /* SYS_WINNT */
 
 	
@@ -589,7 +589,7 @@
 
 		if (setsockopt(sockfd, SOL_SOCKET, SO_RCVBUF,
 			   rbufsize, sizeof(int)) == -1)
-		error(setsockopt, , );
+		error(setsockopt);
 	}
 # endif
 #endif
@@ -601,7 +601,7 @@
 	if (connect(sockfd, (struct sockaddr *)ai-ai_addr,
 		ai-ai_addrlen) == -1)
 #endif /* SYS_VXWORKS */
-	error(connect, , );
+	error(connect);
 
 	freeaddrinfo(ai);
 	havehost = 1;
@@ -622,7 +622,7 @@
 	)
 {
 	if (send(sockfd, xdata, xdatalen, 0) == -1) {
-		warning(write to %s failed, currenthost, );
+		warning(write to %s failed, currenthost);
 		return -1;
 	}
 
@@ -697,7 +697,7 @@
 	n = select(sockfd+1, fds, (fd_set *)0, (fd_set *)0, tvo);
 
 	if (n == -1) {
-		warning(select fails, , );
+		warning(select fails);
 		return -1;
 	}
 	if (n == 0) {
@@ -728,7 +728,7 @@
 
 	n = recv(sockfd, (char *)rpkt, sizeof(rpkt), 0);
 	if (n == -1) {
-		warning(read, , );
+		warning(read);
 		return -1;
 	}
 
@@ -1046,7 +1046,7 @@
 		res = select(sockfd+1, fds, (fd_set *)0, (fd_set *)0, tvzero);
 
 		if (res == -1) {
-			warning(polling select, , );
+			warning(polling select);
 			return -1;
 		} else if (res  0)
 
@@ -1951,34 +1951,44 @@
 }
 
 
+static void __attribute__((__format__(__printf__, 1, 0)))
+vwarning(const char *fmt, va_list ap)
+{
+	int serrno = errno;
+	(void) fprintf(stderr, %s: , progname);
+	vfprintf(stderr, fmt, ap);
+	(void) fprintf(stderr, : %s, strerror(serrno));
+}
+
 /*
  * warning - print a warning message
  */
-static void
+static void __attribute__((__format__(__printf__, 1, 2)))
 warning(
 	const char *fmt,
-	const char *st1,
-	const char *st2
+	...
 	)
 {
-	(void) fprintf(stderr, %s: , progname);
-	(void) fprintf(stderr, fmt, st1, st2);
-	(void) fprintf(stderr, : );
-	perror();
+	va_list ap;
+	va_start(ap, fmt);
+	vwarning(fmt, ap);
+	va_end(ap);
 }
 
 
 /*
  * error - print a message and exit
  */
-static void
+static void __attribute__((__format__(__printf__, 1, 2)))
 error(
 	const char *fmt,
-	const char *st1,
-	const char *st2
+	...
 	)
 {
-	warning(fmt, st1, st2);
+	va_list ap;
+	va_start(ap, fmt);
+	vwarning(fmt, ap);
+	va_end(ap);
 	exit(1);
 }
 



CVS commit: src/external/bsd/ntp/dist

2011-08-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 16 05:28:44 UTC 2011

Modified Files:
src/external/bsd/ntp/dist/ntpq: ntpq.c
src/external/bsd/ntp/dist/sntp: log.c

Log Message:
- proper varyadic warning and error
- don't call syslog with a buffer, use %s first.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/ntp/dist/ntpq/ntpq.c
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/ntp/dist/sntp/log.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpq/ntpq.c
diff -u src/external/bsd/ntp/dist/ntpq/ntpq.c:1.2 src/external/bsd/ntp/dist/ntpq/ntpq.c:1.3
--- src/external/bsd/ntp/dist/ntpq/ntpq.c:1.2	Sat Dec  4 18:08:35 2010
+++ src/external/bsd/ntp/dist/ntpq/ntpq.c	Tue Aug 16 01:28:44 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntpq.c,v 1.2 2010/12/04 23:08:35 christos Exp $	*/
+/*	$NetBSD: ntpq.c,v 1.3 2011/08/16 05:28:44 christos Exp $	*/
 
 /*
  * ntpq - query an NTP server using mode 6 commands
@@ -291,8 +291,10 @@
 static	void	cooked		(struct parse *, FILE *);
 static	void	authenticate	(struct parse *, FILE *);
 static	void	ntpversion	(struct parse *, FILE *);
-static	void	warning		(const char *, const char *, const char *);
-static	void	error		(const char *, const char *, const char *);
+static	void	warning		(const char *, ...)
+__attribute__((__format__(__printf__, 1, 2)));
+static	void	error		(const char *, ...)
+__attribute__((__format__(__printf__, 1, 2)));
 static	u_long	getkeyid	(const char *);
 static	void	atoascii	(const char *, size_t, char *, size_t);
 static	void	makeascii	(int, char *, FILE *);
@@ -757,7 +759,7 @@
 
 	sockfd = socket(ai-ai_family, SOCK_DGRAM, 0);
 	if (sockfd == INVALID_SOCKET) {
-		error(socket, , );
+		error(socket);
 	}
 
 	
@@ -766,7 +768,7 @@
 	{ int rbufsize = DATASIZE + 2048;	/* 2K for slop */
 	if (setsockopt(sockfd, SOL_SOCKET, SO_RCVBUF,
 		   rbufsize, sizeof(int)) == -1)
-	error(setsockopt, , );
+	error(setsockopt);
 	}
 # endif
 #endif
@@ -778,7 +780,7 @@
 	if (connect(sockfd, (struct sockaddr *)ai-ai_addr,
 		ai-ai_addrlen) == -1)
 #endif /* SYS_VXWORKS */
-	error(connect, , );
+	error(connect);
 	if (a_info == 0)
 		freeaddrinfo(ai);
 	havehost = 1;
@@ -800,7 +802,7 @@
 		printf(Sending %zu octets\n, xdatalen);
 
 	if (send(sockfd, xdata, (size_t)xdatalen, 0) == -1) {
-		warning(write to %s failed, currenthost, );
+		warning(write to %s failed, currenthost);
 		return -1;
 	}
 
@@ -880,7 +882,7 @@
 		n = select(sockfd+1, fds, (fd_set *)0, (fd_set *)0, tvo);
 
 		if (n == -1) {
-			warning(select fails, , );
+			warning(select fails);
 			return -1;
 		}
 		if (n == 0) {
@@ -914,7 +916,7 @@
 
 		n = recv(sockfd, (char *)rpkt, sizeof(rpkt), 0);
 		if (n == -1) {
-			warning(read, , );
+			warning(read);
 			return -1;
 		}
 
@@ -2616,37 +2618,46 @@
 }
 
 
+static void __attribute__((__format__(__printf__, 1, 0)))
+vwarning(const char *fmt, va_list ap)
+{
+	int serrno = errno;
+	(void) fprintf(stderr, %s: , progname);
+	vfprintf(stderr, fmt, ap);
+	(void) fprintf(stderr, : %s, strerror(serrno));
+}
+
 /*
  * warning - print a warning message
  */
-static void
+static void __attribute__((__format__(__printf__, 1, 2)))
 warning(
 	const char *fmt,
-	const char *st1,
-	const char *st2
+	...
 	)
 {
-	(void) fprintf(stderr, %s: , progname);
-	(void) fprintf(stderr, fmt, st1, st2);
-	(void) fprintf(stderr, : );
-	perror();
+	va_list ap;
+	va_start(ap, fmt);
+	vwarning(fmt, ap);
+	va_end(ap);
 }
 
 
 /*
  * error - print a message and exit
  */
-static void
+static void __attribute__((__format__(__printf__, 1, 2)))
 error(
 	const char *fmt,
-	const char *st1,
-	const char *st2
+	...
 	)
 {
-	warning(fmt, st1, st2);
+	va_list ap;
+	va_start(ap, fmt);
+	vwarning(fmt, ap);
+	va_end(ap);
 	exit(1);
 }
-
 /*
  * getkeyid - prompt the user for a keyid to use
  */

Index: src/external/bsd/ntp/dist/sntp/log.c
diff -u src/external/bsd/ntp/dist/sntp/log.c:1.2 src/external/bsd/ntp/dist/sntp/log.c:1.3
--- src/external/bsd/ntp/dist/sntp/log.c:1.2	Sat Dec  4 18:08:36 2010
+++ src/external/bsd/ntp/dist/sntp/log.c	Tue Aug 16 01:28:44 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: log.c,v 1.2 2010/12/04 23:08:36 christos Exp $	*/
+/*	$NetBSD: log.c,v 1.3 2011/08/16 05:28:44 christos Exp $	*/
 
 #include log.h
 #include sntp-opts.h
@@ -32,7 +32,7 @@
 break;
 		}
 
-		syslog(type, message);
+		syslog(type, %s, message);
 	}
 }
 
@@ -48,7 +48,7 @@
 #ifdef LOG_PERROR
 			| LOG_PERROR
 #endif
-			| LOG_CONS, message);
+			| LOG_CONS, %s, message);
 	}
 }
 



CVS commit: src/external/bsd/ntp/dist/ntpd

2011-06-30 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Jul  1 02:18:37 UTC 2011

Modified Files:
src/external/bsd/ntp/dist/ntpd: refclock_oncore.c

Log Message:
avoid a potential uninitialised variable problem.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/ntp/dist/ntpd/refclock_oncore.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/refclock_oncore.c
diff -u src/external/bsd/ntp/dist/ntpd/refclock_oncore.c:1.3 src/external/bsd/ntp/dist/ntpd/refclock_oncore.c:1.4
--- src/external/bsd/ntp/dist/ntpd/refclock_oncore.c:1.3	Sat Dec  4 23:08:35 2010
+++ src/external/bsd/ntp/dist/ntpd/refclock_oncore.c	Fri Jul  1 02:18:37 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: refclock_oncore.c,v 1.3 2010/12/04 23:08:35 christos Exp $	*/
+/*	$NetBSD: refclock_oncore.c,v 1.4 2011/07/01 02:18:37 mrg Exp $	*/
 
 
 /*
@@ -2488,7 +2488,7 @@
 {
 	int	chan, id, subframe, valid, page, i, j, tow;
 	int	day_now, day_lsf;
-	const char *cp;
+	const char *cp = NULL /* XXX gcc */;
 	char Msg[120];
 	enum {
 		WARN_NOT_YET,



CVS commit: src/external/bsd/ntp/dist/ntpd

2011-06-30 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Jul  1 02:18:54 UTC 2011

Modified Files:
src/external/bsd/ntp/dist/ntpd: ntp_control.c

Log Message:
avoid an overflow condition.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/ntp/dist/ntpd/ntp_control.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/ntp_control.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_control.c:1.2 src/external/bsd/ntp/dist/ntpd/ntp_control.c:1.3
--- src/external/bsd/ntp/dist/ntpd/ntp_control.c:1.2	Sat Dec  4 23:08:35 2010
+++ src/external/bsd/ntp/dist/ntpd/ntp_control.c	Fri Jul  1 02:18:54 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_control.c,v 1.2 2010/12/04 23:08:35 christos Exp $	*/
+/*	$NetBSD: ntp_control.c,v 1.3 2011/07/01 02:18:54 mrg Exp $	*/
 
 /*
  * ntp_control.c - respond to control messages and send async traps
@@ -527,7 +527,7 @@
 	 */
 	rpkt.r_m_e_op = (u_char) (CTL_RESPONSE|CTL_ERROR|(res_opcode 
 			  CTL_OP_MASK));
-	rpkt.status = htons((u_short) ((errcode8)  0xff00));
+	rpkt.status = htons((u_short) ((errcode  0xff)  8));
 	rpkt.count = 0;
 
 	/*



CVS commit: src/external/bsd/ntp/dist/lib/isc/include/isc

2011-06-28 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Jun 29 02:41:03 UTC 2011

Modified Files:
src/external/bsd/ntp/dist/lib/isc/include/isc: util.h

Log Message:
use __unused instead of having a function call itself, to provide an
empty translation unit.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/bsd/ntp/dist/lib/isc/include/isc/util.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/lib/isc/include/isc/util.h
diff -u src/external/bsd/ntp/dist/lib/isc/include/isc/util.h:1.1.1.1 src/external/bsd/ntp/dist/lib/isc/include/isc/util.h:1.2
--- src/external/bsd/ntp/dist/lib/isc/include/isc/util.h:1.1.1.1	Sun Dec 13 16:54:25 2009
+++ src/external/bsd/ntp/dist/lib/isc/include/isc/util.h	Wed Jun 29 02:41:03 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: util.h,v 1.1.1.1 2009/12/13 16:54:25 kardel Exp $	*/
+/*	$NetBSD: util.h,v 1.2 2011/06/29 02:41:03 mrg Exp $	*/
 
 /*
  * Copyright (C) 2004-2007  Internet Systems Consortium, Inc. (ISC)
@@ -72,7 +72,7 @@
  * Use this in translation units that would otherwise be empty, to
  * suppress compiler warnings.
  */
-#define EMPTY_TRANSLATION_UNIT static void isc__empty(void) { isc__empty(); }
+#define EMPTY_TRANSLATION_UNIT static void __unused isc__empty(void) { } 
 
 /*%
  * We use macros instead of calling the routines directly because



CVS commit: src/external/bsd/ntp/dist/ntpd

2011-06-21 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Jun 22 03:59:50 UTC 2011

Modified Files:
src/external/bsd/ntp/dist/ntpd: refclock_parse.c

Log Message:
fix a potential off-by-two array overflow found by GCC 4.5.3.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/ntp/dist/ntpd/refclock_parse.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/refclock_parse.c
diff -u src/external/bsd/ntp/dist/ntpd/refclock_parse.c:1.3 src/external/bsd/ntp/dist/ntpd/refclock_parse.c:1.4
--- src/external/bsd/ntp/dist/ntpd/refclock_parse.c:1.3	Sat Dec  4 23:08:35 2010
+++ src/external/bsd/ntp/dist/ntpd/refclock_parse.c	Wed Jun 22 03:59:49 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: refclock_parse.c,v 1.3 2010/12/04 23:08:35 christos Exp $	*/
+/*	$NetBSD: refclock_parse.c,v 1.4 2011/06/22 03:59:49 mrg Exp $	*/
 
 /*
  * /src/NTP/REPOSITORY/ntp4-dev/ntpd/refclock_parse.c,v 4.81 2009/05/01 10:15:29 kardel RELEASE_20090105_A
@@ -2455,7 +2455,7 @@
 		{
 			if (buffer[0])
 strncat(buffer, ; , size);
-			strncat(buffer, flagstrings[i].name, size);
+			strncat(buffer, flagstrings[i].name, size - 2);
 		}
 		i++;
 	}



CVS commit: src/external/bsd/ntp/dist/libntp

2011-06-19 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sun Jun 19 15:58:07 UTC 2011

Modified Files:
src/external/bsd/ntp/dist/libntp: ntp_lineedit.c

Log Message:
fix lineedit functionality. ntpq and friends would just exit on empty lines
which is not intended - there is a quit command for that purpose.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/ntp/dist/libntp/ntp_lineedit.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/libntp/ntp_lineedit.c
diff -u src/external/bsd/ntp/dist/libntp/ntp_lineedit.c:1.1.1.1 src/external/bsd/ntp/dist/libntp/ntp_lineedit.c:1.2
--- src/external/bsd/ntp/dist/libntp/ntp_lineedit.c:1.1.1.1	Sun Dec 13 16:55:02 2009
+++ src/external/bsd/ntp/dist/libntp/ntp_lineedit.c	Sun Jun 19 15:58:07 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_lineedit.c,v 1.1.1.1 2009/12/13 16:55:02 kardel Exp $	*/
+/*	$NetBSD: ntp_lineedit.c,v 1.2 2011/06/19 15:58:07 kardel Exp $	*/
 
 /*
  * ntp_lineedit.c - generic interface to various line editing libs
@@ -174,11 +174,8 @@
 	if (NULL != line) {
 		if (*line) {
 			add_history(line);
-			*pcount = strlen(line);
-		} else {
-			free(line);
-			line = NULL;
 		}
+		*pcount = strlen(line);
 	}
 
 #endif	/* HAVE_READLINE_HISTORY */
@@ -187,12 +184,14 @@
 
 	cline = el_gets(ntp_el, pcount);
 
-	if (NULL != cline  *cline) {
+	if (NULL != cline) {
 		history(ntp_hist, hev, H_ENTER, cline);
-		*pcount = strlen(cline);
 		line = estrdup(cline);
-	} else
+	} else if (*pcount == -1) {
 		line = NULL;
+	} else {
+		line = estrdup();
+	}
 
 #endif	/* !HAVE_READLINE_HISTORY  HAVE_HISTEDIT_H */
 



CVS commit: src/external/bsd/ntp/dist/ntpd

2011-02-27 Thread Iain Hibbert
Module Name:src
Committed By:   plunky
Date:   Sun Feb 27 12:10:18 UTC 2011

Modified Files:
src/external/bsd/ntp/dist/ntpd: ntp_util.c

Log Message:
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)


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/ntp/dist/ntpd/ntp_util.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/ntp_util.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_util.c:1.1.1.1 src/external/bsd/ntp/dist/ntpd/ntp_util.c:1.2
--- src/external/bsd/ntp/dist/ntpd/ntp_util.c:1.1.1.1	Sun Dec 13 16:55:42 2009
+++ src/external/bsd/ntp/dist/ntpd/ntp_util.c	Sun Feb 27 12:10:18 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_util.c,v 1.1.1.1 2009/12/13 16:55:42 kardel Exp $	*/
+/*	$NetBSD: ntp_util.c,v 1.2 2011/02/27 12:10:18 plunky Exp $	*/
 
 /*
  * ntp_util.c - stuff I didn't have any other place for
@@ -358,6 +358,11 @@
 	int	len;
 	char	tbuf[80];
 	char	str1[20], str2[20];
+#ifndef VMS
+	const char temp_ext[] = .TEMP;
+#else
+	const char temp_ext[] = -TEMP;
+#endif
 
 	/*
 	 * Expand environment strings under Windows NT, since the
@@ -412,14 +417,10 @@
 		stats_temp_file = erealloc(stats_temp_file, 
 	   len + sizeof(.TEMP));
 
-		memmove(stats_drift_file, value, (unsigned)(len+1));
-		memmove(stats_temp_file, value, (unsigned)len);
-		memmove(stats_temp_file + len,
-#if !defined(VMS)
-			.TEMP, sizeof(.TEMP));
-#else
-			-TEMP, sizeof(-TEMP));
-#endif /* VMS */
+		memcpy(stats_drift_file, value, (unsigned)(len+1));
+		memcpy(stats_temp_file, value, (unsigned)len);
+		memcpy(stats_temp_file + len, temp_ext,
+		   sizeof(temp_ext));
 
 		/*
 		 * Open drift file and read frequency. If the file is



CVS commit: src/external/bsd/ntp/dist

2011-01-09 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sun Jan  9 14:49:40 UTC 2011

Modified Files:
src/external/bsd/ntp/dist/lib/isc/unix: net.c
src/external/bsd/ntp/dist/ntpd: ntp_io.c

Log Message:
make ntp compile for MKINET6=no


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/ntp/dist/lib/isc/unix/net.c
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/ntp/dist/ntpd/ntp_io.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/lib/isc/unix/net.c
diff -u src/external/bsd/ntp/dist/lib/isc/unix/net.c:1.1.1.1 src/external/bsd/ntp/dist/lib/isc/unix/net.c:1.2
--- src/external/bsd/ntp/dist/lib/isc/unix/net.c:1.1.1.1	Sun Dec 13 16:54:38 2009
+++ src/external/bsd/ntp/dist/lib/isc/unix/net.c	Sun Jan  9 14:49:39 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: net.c,v 1.1.1.1 2009/12/13 16:54:38 kardel Exp $	*/
+/*	$NetBSD: net.c,v 1.2 2011/01/09 14:49:39 kardel Exp $	*/
 
 /*
  * Copyright (C) 2004, 2005, 2007, 2008  Internet Systems Consortium, Inc. (ISC)
@@ -106,11 +106,11 @@
 
 # if defined(WANT_IPV6)
 static isc_once_t 	once_ipv6only = ISC_ONCE_INIT;
-# endif
 
 # if defined(ISC_PLATFORM_HAVEIN6PKTINFO)
 static isc_once_t 	once_ipv6pktinfo = ISC_ONCE_INIT;
 # endif
+# endif
 #endif /* ISC_PLATFORM_HAVEIPV6 */
 
 static isc_once_t 	once = ISC_ONCE_INIT;
@@ -319,7 +319,6 @@
 	RUNTIME_CHECK(isc_once_do(once_ipv6only,
   try_ipv6only) == ISC_R_SUCCESS);
 }
-#endif /* WANT_IPV6 */
 
 #ifdef ISC_PLATFORM_HAVEIN6PKTINFO
 static void
@@ -376,6 +375,7 @@
 }
 #endif /* ISC_PLATFORM_HAVEIN6PKTINFO */
 #endif /* ISC_PLATFORM_HAVEIPV6 */
+#endif /* WANT_IPV6 */
 
 isc_result_t
 isc_net_probe_ipv6only(void) {

Index: src/external/bsd/ntp/dist/ntpd/ntp_io.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.4 src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.5
--- src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.4	Sat Dec  4 23:08:35 2010
+++ src/external/bsd/ntp/dist/ntpd/ntp_io.c	Sun Jan  9 14:49:40 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_io.c,v 1.4 2010/12/04 23:08:35 christos Exp $	*/
+/*	$NetBSD: ntp_io.c,v 1.5 2011/01/09 14:49:40 kardel Exp $	*/
 
 /*
  * ntp_io.c - input/output routines for ntpd.	The socket-opening code
@@ -923,7 +923,10 @@
 	u_short	port
 	)
 {
-	int			v4wild, v6wild;
+	int			v4wild;
+#ifdef INCLUDE_IPV6_SUPPORT
+	int v6wild;
+#endif
 	sockaddr_u		wildaddr;
 	isc_netaddr_t		wnaddr;
 	nic_rule_action		action;
@@ -2902,7 +2905,9 @@
 		 */
 		int	rtc;
 		u_char	cttl;
+#ifdef INCLUDE_IPV6_SUPPORT
 		u_int	uttl;
+#endif
 		
 		switch (AF(inter-sin)) {
 			



CVS commit: src/external/bsd/ntp/dist/ntpd

2010-11-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Nov  6 20:40:12 UTC 2010

Modified Files:
src/external/bsd/ntp/dist/ntpd: ntp_io.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/ntp/dist/ntpd/ntp_io.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/ntp_io.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.2 src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.3
--- src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.2	Sun Dec 13 19:43:58 2009
+++ src/external/bsd/ntp/dist/ntpd/ntp_io.c	Sat Nov  6 16:40:12 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_io.c,v 1.2 2009/12/14 00:43:58 christos Exp $	*/
+/*	$NetBSD: ntp_io.c,v 1.3 2010/11/06 20:40:12 christos Exp $	*/
 
 /*
  * ntp_io.c - input/output routines for ntpd.	The socket-opening code
@@ -3355,11 +3355,14 @@
 	asyncio_reader = asyncio_reader_list;
 
 	while (asyncio_reader != NULL) {
+		struct asyncio_reader *next = asyncio_reader-link;
+
 		if (FD_ISSET(asyncio_reader-fd, fds)) {
 			++select_count;
 			(asyncio_reader-receiver)(asyncio_reader);
 		}
-		asyncio_reader = asyncio_reader-link;
+
+		asyncio_reader = next;
 	}
 #endif /* HAS_ROUTING_SOCKET */
 	



CVS commit: src/external/bsd/ntp/dist/ntpd

2010-09-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Sep 22 14:37:08 UTC 2010

Modified Files:
src/external/bsd/ntp/dist/ntpd: ntpd.c

Log Message:
fix typo. From Anon Ymous


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/ntp/dist/ntpd/ntpd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/ntpd.c
diff -u src/external/bsd/ntp/dist/ntpd/ntpd.c:1.2 src/external/bsd/ntp/dist/ntpd/ntpd.c:1.3
--- src/external/bsd/ntp/dist/ntpd/ntpd.c:1.2	Sun Dec 13 19:42:47 2009
+++ src/external/bsd/ntp/dist/ntpd/ntpd.c	Wed Sep 22 10:37:08 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntpd.c,v 1.2 2009/12/14 00:42:47 christos Exp $	*/
+/*	$NetBSD: ntpd.c,v 1.3 2010/09/22 14:37:08 christos Exp $	*/
 
 /*
  * ntpd.c - main program for the fixed point NTP daemon
@@ -1179,7 +1179,7 @@
 #ifdef HAVE_DNSREGISTRATION
 		if (mdnsreg  (current_time - mdnsreg )  60  mdnstries  sys_leap != LEAP_NOTINSYNC) {
 			mdnsreg = current_time;
-			msyslog(LOG_INFO, Attemping to register mDNS);
+			msyslog(LOG_INFO, Attempting to register mDNS);
 			if ( DNSServiceRegister (mdns, 0, 0, NULL, _ntp._udp, NULL, NULL, 
 			htons(NTP_PORT), 0, NULL, NULL, NULL) != kDNSServiceErr_NoError ) {
 if (!--mdnstries) {



CVS commit: src/external/bsd/ntp/dist/ntpd

2010-08-29 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sun Aug 29 18:54:30 UTC 2010

Modified Files:
src/external/bsd/ntp/dist/ntpd: ntp_intres.c

Log Message:
make IPV6 support decision consistent with code in ntp_io.c


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/ntp/dist/ntpd/ntp_intres.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/ntp_intres.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_intres.c:1.1.1.1 src/external/bsd/ntp/dist/ntpd/ntp_intres.c:1.2
--- src/external/bsd/ntp/dist/ntpd/ntp_intres.c:1.1.1.1	Sun Dec 13 16:55:34 2009
+++ src/external/bsd/ntp/dist/ntpd/ntp_intres.c	Sun Aug 29 18:54:30 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_intres.c,v 1.1.1.1 2009/12/13 16:55:34 kardel Exp $	*/
+/*	$NetBSD: ntp_intres.c,v 1.2 2010/08/29 18:54:30 kardel Exp $	*/
 
 /*
  * ripped off from ../ntpres/ntpres.c by Greg Troxel 4/2/92
@@ -472,7 +472,7 @@
 	ce = emalloc(sizeof(*ce));
 	ce-ce_name = estrdup(name);
 	ce-ce_peeraddr = 0;
-#ifdef ISC_PLATFORM_HAVEIPV6
+#ifdef INCLUDE_IPV6_SUPPORT
 	ce-ce_peeraddr6 = in6addr_any;
 #endif
 	ZERO_SOCK(ce-peer_store);



CVS commit: src/external/bsd/ntp/dist/sntp

2010-08-28 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sat Aug 28 15:38:55 UTC 2010

Modified Files:
src/external/bsd/ntp/dist/sntp: kod_management.c

Log Message:
remove uncondition #define DEBUG


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/ntp/dist/sntp/kod_management.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/sntp/kod_management.c
diff -u src/external/bsd/ntp/dist/sntp/kod_management.c:1.1.1.1 src/external/bsd/ntp/dist/sntp/kod_management.c:1.2
--- src/external/bsd/ntp/dist/sntp/kod_management.c:1.1.1.1	Sun Dec 13 16:57:10 2009
+++ src/external/bsd/ntp/dist/sntp/kod_management.c	Sat Aug 28 15:38:55 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: kod_management.c,v 1.1.1.1 2009/12/13 16:57:10 kardel Exp $	*/
+/*	$NetBSD: kod_management.c,v 1.2 2010/08/28 15:38:55 kardel Exp $	*/
 
 #include string.h
 #include sys/types.h
@@ -8,7 +8,6 @@
 #include log.h
 #include sntp-opts.h
 #include ntp_stdlib.h
-#define DEBUG
 
 int kod_init = 0, kod_db_cnt = 0;
 const char *kod_db_file;



CVS commit: src/external/bsd/ntp/dist/sntp

2010-08-28 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sat Aug 28 15:39:25 UTC 2010

Modified Files:
src/external/bsd/ntp/dist/sntp: networking.c

Log Message:
fix DEBUG compilation


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/ntp/dist/sntp/networking.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/sntp/networking.c
diff -u src/external/bsd/ntp/dist/sntp/networking.c:1.1.1.1 src/external/bsd/ntp/dist/sntp/networking.c:1.2
--- src/external/bsd/ntp/dist/sntp/networking.c:1.1.1.1	Sun Dec 13 16:57:11 2009
+++ src/external/bsd/ntp/dist/sntp/networking.c	Sat Aug 28 15:39:25 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: networking.c,v 1.1.1.1 2009/12/13 16:57:11 kardel Exp $	*/
+/*	$NetBSD: networking.c,v 1.2 2010/08/28 15:39:25 kardel Exp $	*/
 
 #include networking.h
 
@@ -62,6 +62,8 @@
 			free(logmsg);
 		} else {
 #ifdef DEBUG
+			struct addrinfo *dres;
+
 			for (dres = tres[resc]; dres; dres = dres-ai_next) {
 getnameinfo(dres-ai_addr, dres-ai_addrlen, adr_buf, sizeof(adr_buf), NULL, 0, NI_NUMERICHOST);
 STDLINE
@@ -160,7 +162,7 @@
 		pkt_output((struct pkt *) rdata, recvc, stdout);
 	}
 	else {
-		saved_errno = errno;
+		int saved_errno = errno;
 		printf(recvfrom error %d (%s)\n, errno, strerror(errno));
 		errno = saved_errno;
 	}



CVS commit: src/external/bsd/ntp/dist/ntpq

2010-08-28 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sat Aug 28 15:40:24 UTC 2010

Modified Files:
src/external/bsd/ntp/dist/ntpq: ntpq.1

Log Message:
.sp only takes a single arg


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/ntp/dist/ntpq/ntpq.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpq/ntpq.1
diff -u src/external/bsd/ntp/dist/ntpq/ntpq.1:1.1.1.1 src/external/bsd/ntp/dist/ntpq/ntpq.1:1.2
--- src/external/bsd/ntp/dist/ntpq/ntpq.1:1.1.1.1	Sun Dec 13 16:56:32 2009
+++ src/external/bsd/ntp/dist/ntpq/ntpq.1	Sat Aug 28 15:40:24 2010
@@ -96,7 +96,7 @@
 These are described following.
 .sp
 .IR ? [command_keyword]
-.sp 1x help [command_keyword]
+.sp 1x help [command_keyword]
 A
 .Ql \?
 by itself will print a list of all the command



CVS commit: src/external/bsd/ntp/dist/ntpd

2010-08-28 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sat Aug 28 20:52:55 UTC 2010

Modified Files:
src/external/bsd/ntp/dist/ntpd: ntp_scanner.c

Log Message:
don't return an int casted pointer as 'boolean' value - compare result of 
strchr with NULL


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/ntp/dist/ntpd/ntp_scanner.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/ntp_scanner.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_scanner.c:1.1.1.1 src/external/bsd/ntp/dist/ntpd/ntp_scanner.c:1.2
--- src/external/bsd/ntp/dist/ntpd/ntp_scanner.c:1.1.1.1	Sun Dec 13 16:56:14 2009
+++ src/external/bsd/ntp/dist/ntpd/ntp_scanner.c	Sat Aug 28 20:52:55 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_scanner.c,v 1.1.1.1 2009/12/13 16:56:14 kardel Exp $	*/
+/*	$NetBSD: ntp_scanner.c,v 1.2 2010/08/28 20:52:55 kardel Exp $	*/
 
 
 /* ntp_scanner.c
@@ -353,7 +353,7 @@
 	int ch
 	)
 {
-	return (int)strchr(special_chars, ch);
+	return strchr(special_chars, ch) != NULL;
 }
 
 



CVS commit: src/external/bsd/ntp/dist/sntp

2010-08-28 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sat Aug 28 20:54:24 UTC 2010

Modified Files:
src/external/bsd/ntp/dist/sntp: networking.c

Log Message:
using a char * as timeout value is a unique concept - atol() the string


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/ntp/dist/sntp/networking.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/sntp/networking.c
diff -u src/external/bsd/ntp/dist/sntp/networking.c:1.2 src/external/bsd/ntp/dist/sntp/networking.c:1.3
--- src/external/bsd/ntp/dist/sntp/networking.c:1.2	Sat Aug 28 15:39:25 2010
+++ src/external/bsd/ntp/dist/sntp/networking.c	Sat Aug 28 20:54:24 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: networking.c,v 1.2 2010/08/28 15:39:25 kardel Exp $	*/
+/*	$NetBSD: networking.c,v 1.3 2010/08/28 20:54:24 kardel Exp $	*/
 
 #include networking.h
 
@@ -280,7 +280,7 @@
 	FD_SET(rsock, bcst_fd);
 
 	if(ENABLED_OPT(TIMEOUT)) 
-		timeout_tv.tv_sec = (int) OPT_ARG(TIMEOUT);
+		timeout_tv.tv_sec = atol(OPT_ARG(TIMEOUT));
 	else 
 		timeout_tv.tv_sec = 68; /* ntpd broadcasts every 64s */
 	



CVS commit: src/external/bsd/ntp/dist/ntpd

2010-04-25 Thread Tonnerre Lombard
Module Name:src
Committed By:   tonnerre
Date:   Sun Apr 25 22:50:11 UTC 2010

Modified Files:
src/external/bsd/ntp/dist/ntpd: ntp_request.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/ntp/dist/ntpd/ntp_request.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/ntp_request.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_request.c:1.2 src/external/bsd/ntp/dist/ntpd/ntp_request.c:1.3
--- src/external/bsd/ntp/dist/ntpd/ntp_request.c:1.2	Mon Dec 14 00:46:21 2009
+++ src/external/bsd/ntp/dist/ntpd/ntp_request.c	Sun Apr 25 22:50:11 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_request.c,v 1.2 2009/12/14 00:46:21 christos Exp $	*/
+/*	$NetBSD: ntp_request.c,v 1.3 2010/04/25 22:50:11 tonnerre Exp $	*/
 
 /*
  * ntp_request.c - respond to information requests
@@ -411,6 +411,7 @@
 	int mod_okay
 	)
 {
+	static u_long quiet_until;
 	struct req_pkt *inpkt;
 	struct req_pkt_tail *tailinpkt;
 	sockaddr_u *srcadr;
@@ -449,8 +450,14 @@
 	|| (++ec, INFO_MBZ(inpkt-mbz_itemsize) != 0)
 	|| (++ec, rbufp-recv_length  REQ_LEN_HDR)
 		) {
-		msyslog(LOG_ERR, process_private: INFO_ERR_FMT: test %d failed, pkt from %s, ec, stoa(srcadr));
-		req_ack(srcadr, inter, inpkt, INFO_ERR_FMT);
+		NLOG(NLOG_SYSEVENT)
+			if (current_time = quiet_until) {
+msyslog(LOG_ERR,
+	process_private: drop test %d
+	 failed, pkt from %s,
+	ec, stoa(srcadr));
+quiet_until = current_time + 60;
+			}
 		return;
 	}
 



CVS commit: src/external/bsd/ntp/dist

2009-12-13 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sun Dec 13 16:57:37 UTC 2009

Update of /cvsroot/src/external/bsd/ntp/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv28166

Log Message:
Import ntp 4.2.6

Status:

Vendor Tag: UDEL
Release Tags:   ntp-4-2-6

N src/external/bsd/ntp/dist/CommitLog-4.1.0
N src/external/bsd/ntp/dist/COPYRIGHT
N src/external/bsd/ntp/dist/ChangeLog
N src/external/bsd/ntp/dist/CommitLog
N src/external/bsd/ntp/dist/Makefile.am
N src/external/bsd/ntp/dist/INSTALL
N src/external/bsd/ntp/dist/NOTES.y2kfixes
N src/external/bsd/ntp/dist/Makefile.in
N src/external/bsd/ntp/dist/NEWS
N src/external/bsd/ntp/dist/README.bk
N src/external/bsd/ntp/dist/README
N src/external/bsd/ntp/dist/README.hackers
N src/external/bsd/ntp/dist/README.patches
N src/external/bsd/ntp/dist/README.refclocks
N src/external/bsd/ntp/dist/README.versions
N src/external/bsd/ntp/dist/TODO
N src/external/bsd/ntp/dist/WHERE-TO-START
N src/external/bsd/ntp/dist/aclocal.m4
N src/external/bsd/ntp/dist/bincheck.mf
N src/external/bsd/ntp/dist/bootstrap
N src/external/bsd/ntp/dist/build
N src/external/bsd/ntp/dist/compile
N src/external/bsd/ntp/dist/config.guess
N src/external/bsd/ntp/dist/config.h.in
N src/external/bsd/ntp/dist/config.sub
N src/external/bsd/ntp/dist/configure
N src/external/bsd/ntp/dist/configure.ac
N src/external/bsd/ntp/dist/depcomp
N src/external/bsd/ntp/dist/deps-ver
N src/external/bsd/ntp/dist/depsver.mf
N src/external/bsd/ntp/dist/dot.emacs
N src/external/bsd/ntp/dist/excludes
N src/external/bsd/ntp/dist/flock-build
N src/external/bsd/ntp/dist/install-sh
N src/external/bsd/ntp/dist/ltmain.sh
N src/external/bsd/ntp/dist/missing
N src/external/bsd/ntp/dist/packageinfo.sh
N src/external/bsd/ntp/dist/readme.y2kfixes
N src/external/bsd/ntp/dist/results.y2kfixes
N src/external/bsd/ntp/dist/version.m4
N src/external/bsd/ntp/dist/version
N src/external/bsd/ntp/dist/ylwrap
N src/external/bsd/ntp/dist/ElectricFence/efence.h
N src/external/bsd/ntp/dist/ElectricFence/Makefile.am
N src/external/bsd/ntp/dist/ElectricFence/README
N src/external/bsd/ntp/dist/ElectricFence/Makefile.in
N src/external/bsd/ntp/dist/ElectricFence/COPYING
N src/external/bsd/ntp/dist/ElectricFence/efence.c
N src/external/bsd/ntp/dist/ElectricFence/page.c
N src/external/bsd/ntp/dist/ElectricFence/print.c
N src/external/bsd/ntp/dist/ElectricFence/eftest.c
N src/external/bsd/ntp/dist/ElectricFence/tstheap.c
N src/external/bsd/ntp/dist/ElectricFence/libefence.3
N src/external/bsd/ntp/dist/ElectricFence/CHANGES
N src/external/bsd/ntp/dist/adjtimed/adjtimed.c
N src/external/bsd/ntp/dist/adjtimed/Makefile.am
N src/external/bsd/ntp/dist/adjtimed/README
N src/external/bsd/ntp/dist/adjtimed/Makefile.in
N src/external/bsd/ntp/dist/clockstuff/chutest.c
N src/external/bsd/ntp/dist/clockstuff/Makefile.am
N src/external/bsd/ntp/dist/clockstuff/README
N src/external/bsd/ntp/dist/clockstuff/Makefile.in
N src/external/bsd/ntp/dist/clockstuff/clktest.c
N src/external/bsd/ntp/dist/clockstuff/propdelay.c
N src/external/bsd/ntp/dist/arlib/arlib.h
N src/external/bsd/ntp/dist/arlib/configure.in
N src/external/bsd/ntp/dist/arlib/README
N src/external/bsd/ntp/dist/arlib/aclocal.m4
N src/external/bsd/ntp/dist/arlib/arlib.c
N src/external/bsd/ntp/dist/arlib/Makefile.am
N src/external/bsd/ntp/dist/arlib/Makefile.in
N src/external/bsd/ntp/dist/arlib/configure
N src/external/bsd/ntp/dist/arlib/COPYING
N src/external/bsd/ntp/dist/arlib/INSTALL
N src/external/bsd/ntp/dist/arlib/depcomp
N src/external/bsd/ntp/dist/arlib/install-sh
N src/external/bsd/ntp/dist/arlib/missing
N src/external/bsd/ntp/dist/arlib/arplib.h
N src/external/bsd/ntp/dist/arlib/sample.c
N src/external/bsd/ntp/dist/arlib/arlib.3
N src/external/bsd/ntp/dist/arlib/UNSHAR.HDR
N src/external/bsd/ntp/dist/conf/beauregard.conf
N src/external/bsd/ntp/dist/conf/baldwin.conf
N src/external/bsd/ntp/dist/conf/README
N src/external/bsd/ntp/dist/conf/grundoon.conf
N src/external/bsd/ntp/dist/conf/malarky.conf
N src/external/bsd/ntp/dist/conf/pogo.conf
N src/external/bsd/ntp/dist/conf/rackety.conf
N src/external/bsd/ntp/dist/html/copyright.html
N src/external/bsd/ntp/dist/html/extern.html
N src/external/bsd/ntp/dist/html/sntp.html
N src/external/bsd/ntp/dist/html/prefer.html
N src/external/bsd/ntp/dist/html/ntptrace.html
N src/external/bsd/ntp/dist/html/debug.html
N src/external/bsd/ntp/dist/html/comdex.html
N src/external/bsd/ntp/dist/html/config.html
N src/external/bsd/ntp/dist/html/manyopt.html
N src/external/bsd/ntp/dist/html/assoc.html
N src/external/bsd/ntp/dist/html/sitemap.html
N src/external/bsd/ntp/dist/html/keygen.html
N src/external/bsd/ntp/dist/html/ntpd.html
N src/external/bsd/ntp/dist/html/release.html
N src/external/bsd/ntp/dist/html/ntpdc.html
N src/external/bsd/ntp/dist/html/audio.html
N src/external/bsd/ntp/dist/html/xleave.html
N src/external/bsd/ntp/dist/html/hints.html
N src/external/bsd/ntp/dist/html/howto.html
N src/external/bsd/ntp/dist/html/quick.html
N 

  1   2   >