CVS commit: src/sys/netinet6

2016-12-18 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Mon Dec 19 07:51:34 UTC 2016

Modified Files:
src/sys/netinet6: in6.c nd6.c nd6.h nd6_nbr.c nd6_rtr.c

Log Message:
Protect IPv6 default router and prefix lists with coarse-grained rwlock

in6_purgeaddr (in6_unlink_ifa) itself unrefernces a prefix entry and calls
nd6_prelist_remove if the counter becomes 0, so callers doesn't need to
handle the reference counting.

Performance-sensitive paths (sending/forwarding packets) call just one
reader lock. This is a trade-off between performance impact vs. the amount
of efforts; if we want to remove the reader lock, we need huge amount of
works including destroying objects with psz/psref in softint, for example.


To generate a diff of this commit:
cvs rdiff -u -r1.224 -r1.225 src/sys/netinet6/in6.c
cvs rdiff -u -r1.219 -r1.220 src/sys/netinet6/nd6.c
cvs rdiff -u -r1.80 -r1.81 src/sys/netinet6/nd6.h
cvs rdiff -u -r1.133 -r1.134 src/sys/netinet6/nd6_nbr.c
cvs rdiff -u -r1.127 -r1.128 src/sys/netinet6/nd6_rtr.c

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

Modified files:

Index: src/sys/netinet6/in6.c
diff -u src/sys/netinet6/in6.c:1.224 src/sys/netinet6/in6.c:1.225
--- src/sys/netinet6/in6.c:1.224	Mon Dec 12 03:55:57 2016
+++ src/sys/netinet6/in6.c	Mon Dec 19 07:51:34 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: in6.c,v 1.224 2016/12/12 03:55:57 ozaki-r Exp $	*/
+/*	$NetBSD: in6.c,v 1.225 2016/12/19 07:51:34 ozaki-r Exp $	*/
 /*	$KAME: in6.c,v 1.198 2001/07/18 09:12:38 itojun Exp $	*/
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.224 2016/12/12 03:55:57 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.225 2016/12/19 07:51:34 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -709,23 +709,11 @@ in6_control1(struct socket *so, u_long c
 	}
 
 	case SIOCDIFADDR_IN6:
-	{
-		struct nd_prefix *pr;
-
-		/*
-		 * If the address being deleted is the only one that owns
-		 * the corresponding prefix, expire the prefix as well.
-		 * Note that in6_purgeaddr() will decrement ndpr_refcnt.
-		 */
-		pr = ia->ia6_ndpr;
 		ia6_release(ia, &psref);
 		in6_purgeaddr(&ia->ia_ifa);
 		ia = NULL;
-		if (pr && pr->ndpr_refcnt == 0)
-			nd6_prelist_remove(pr);
 		run_hooks = true;
 		break;
-	}
 
 	default:
 		error = ENOTTY;
@@ -1388,7 +1376,7 @@ in6_unlink_ifa(struct in6_ifaddr *ia, st
 	 * Release the reference to the ND prefix.
 	 */
 	if (ia->ia6_ndpr != NULL) {
-		ia->ia6_ndpr->ndpr_refcnt--;
+		nd6_prefix_unref(ia->ia6_ndpr);
 		ia->ia6_ndpr = NULL;
 	}
 
@@ -1397,8 +1385,11 @@ in6_unlink_ifa(struct in6_ifaddr *ia, st
 	 * nd6_pfxlist_onlink_check() since the release might affect the status of
 	 * other (detached) addresses.
 	 */
-	if ((ia->ia6_flags & IN6_IFF_AUTOCONF) != 0)
+	if ((ia->ia6_flags & IN6_IFF_AUTOCONF) != 0) {
+		ND6_WLOCK();
 		nd6_pfxlist_onlink_check();
+		ND6_UNLOCK();
+	}
 
 	IN6_ADDRLIST_ENTRY_DESTROY(ia);
 
@@ -2153,7 +2144,9 @@ in6_if_link_up(struct ifnet *ifp)
 	curlwp_bindx(bound);
 
 	/* Restore any detached prefixes */
+	ND6_WLOCK();
 	nd6_pfxlist_onlink_check();
+	ND6_UNLOCK();
 }
 
 void
@@ -2180,7 +2173,9 @@ in6_if_link_down(struct ifnet *ifp)
 	int s, bound;
 
 	/* Any prefixes on this interface should be detached as well */
+	ND6_WLOCK();
 	nd6_pfxlist_onlink_check();
+	ND6_UNLOCK();
 
 	bound = curlwp_bind();
 	s = pserialize_read_enter();

Index: src/sys/netinet6/nd6.c
diff -u src/sys/netinet6/nd6.c:1.219 src/sys/netinet6/nd6.c:1.220
--- src/sys/netinet6/nd6.c:1.219	Mon Dec 19 04:52:17 2016
+++ src/sys/netinet6/nd6.c	Mon Dec 19 07:51:34 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: nd6.c,v 1.219 2016/12/19 04:52:17 ozaki-r Exp $	*/
+/*	$NetBSD: nd6.c,v 1.220 2016/12/19 07:51:34 ozaki-r Exp $	*/
 /*	$KAME: nd6.c,v 1.279 2002/06/08 11:16:51 itojun Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.219 2016/12/19 04:52:17 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.220 2016/12/19 07:51:34 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -103,6 +103,8 @@ int nd6_debug = 1;
 int nd6_debug = 0;
 #endif
 
+krwlock_t nd6_lock __cacheline_aligned;
+
 struct nd_drhead nd_defrouter;
 struct nd_prhead nd_prefix = { 0 };
 
@@ -138,6 +140,8 @@ nd6_init(void)
 {
 	int error;
 
+	rw_init(&nd6_lock);
+
 	/* initialization of the default router list */
 	ND_DEFROUTER_LIST_INIT();
 
@@ -595,12 +599,14 @@ nd6_timer_work(struct work *wk, void *ar
 #endif
 
 	/* expire default router list */
-	
+
+	ND6_WLOCK();
 	ND_DEFROUTER_LIST_FOREACH_SAFE(dr, next_dr) {
 		if (dr->expire && dr->expire < time_uptime) {
 			nd6_defrtrlist_del(dr, NULL);
 		}
 	}
+	ND6_UNLOCK();
 
 	/*
 	 * expire interface addresses.
@@ -695,6 +701,7 @@ nd6_timer_work(struct work *wk, void *ar
 	curlwp_bindx(bound);
 
 	/* expire prefix list */
+	ND6_WLOCK();
 	ND_PREFIX_LIST_FOREACH_SAFE(pr, next_pr) {
 		/*
 		 * check prefix lifetime.
@@ -712,6 +719,7 @@ nd6_

CVS commit: src/lib/libc/sys

2016-12-18 Thread Abhinav Upadhyay
Module Name:src
Committed By:   abhinav
Date:   Mon Dec 19 07:48:35 UTC 2016

Modified Files:
src/lib/libc/sys: kqueue.2

Log Message:
Use markup for errno
Also remove a .Pp before .Bl while there


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/lib/libc/sys/kqueue.2

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

Modified files:

Index: src/lib/libc/sys/kqueue.2
diff -u src/lib/libc/sys/kqueue.2:1.35 src/lib/libc/sys/kqueue.2:1.36
--- src/lib/libc/sys/kqueue.2:1.35	Tue Dec  8 14:52:06 2015
+++ src/lib/libc/sys/kqueue.2	Mon Dec 19 07:48:35 2016
@@ -1,4 +1,4 @@
-.\"	$NetBSD: kqueue.2,v 1.35 2015/12/08 14:52:06 christos Exp $
+.\"	$NetBSD: kqueue.2,v 1.36 2016/12/19 07:48:35 abhinav Exp $
 .\"
 .\" Copyright (c) 2000 Jonathan Lemon
 .\" All rights reserved.
@@ -299,7 +299,6 @@ Takes a descriptor as the identifier, an
 there is data available to read.
 The behavior of the filter is slightly different depending
 on the descriptor type.
-.Pp
 .Bl -tag -width 2n
 .It Sockets
 Sockets which have previously been passed to
@@ -487,7 +486,9 @@ This filter automatically sets the EV_CL
 .Fn kqueue
 creates a new kernel event queue and returns a file descriptor.
 If there was an error creating the kernel event queue, a value of \-1 is
-returned and errno set.
+returned and
+.Dv errno
+is set.
 .Pp
 .Fn kevent
 returns the number of events placed in the



CVS commit: src/lib/libc/sys

2016-12-18 Thread Abhinav Upadhyay
Module Name:src
Committed By:   abhinav
Date:   Mon Dec 19 07:17:45 UTC 2016

Modified Files:
src/lib/libc/sys: ptrace.2

Log Message:
Be consistent in using process' (vs process's).


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/lib/libc/sys/ptrace.2

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

Modified files:

Index: src/lib/libc/sys/ptrace.2
diff -u src/lib/libc/sys/ptrace.2:1.44 src/lib/libc/sys/ptrace.2:1.45
--- src/lib/libc/sys/ptrace.2:1.44	Thu Dec 15 15:03:17 2016
+++ src/lib/libc/sys/ptrace.2	Mon Dec 19 07:17:45 2016
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ptrace.2,v 1.44 2016/12/15 15:03:17 kamil Exp $
+.\"	$NetBSD: ptrace.2,v 1.45 2016/12/19 07:17:45 abhinav Exp $
 .\"
 .\" This file is in the public domain.
 .Dd November 1, 2016
@@ -143,8 +143,8 @@ Second, no process may trace the process
 .Xr init 8 .
 Third, if a process has its root directory set with
 .Xr chroot 2 ,
-it may not trace another process unless that process's root directory
-is at or below the tracing process's root.
+it may not trace another process unless that process' root directory
+is at or below the tracing process' root.
 .It Dv PT_DETACH
 This request is like PT_CONTINUE, except that after it
 succeeds, the traced process is no longer traced and continues



CVS commit: src/lib/libc/sys

2016-12-18 Thread Abhinav Upadhyay
Module Name:src
Committed By:   abhinav
Date:   Mon Dec 19 06:45:29 UTC 2016

Modified Files:
src/lib/libc/sys: posix_fadvise.2

Log Message:
Fix sentence.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libc/sys/posix_fadvise.2

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

Modified files:

Index: src/lib/libc/sys/posix_fadvise.2
diff -u src/lib/libc/sys/posix_fadvise.2:1.5 src/lib/libc/sys/posix_fadvise.2:1.6
--- src/lib/libc/sys/posix_fadvise.2:1.5	Mon Feb  4 20:03:11 2013
+++ src/lib/libc/sys/posix_fadvise.2	Mon Dec 19 06:45:29 2016
@@ -1,4 +1,4 @@
-.\"	$NetBSD: posix_fadvise.2,v 1.5 2013/02/04 20:03:11 wiz Exp $
+.\"	$NetBSD: posix_fadvise.2,v 1.6 2016/12/19 06:45:29 abhinav Exp $
 .\"
 .\" Copyright (c)2006,2009 YAMAMOTO Takashi,
 .\" All rights reserved.
@@ -55,7 +55,7 @@ If
 is zero, it means to the end of file.
 .Pp
 .Fa hint
-should be one of the followings.
+should be one of the following:
 .Pp
 .Bl -tag -offset indent -width POSIX_FADV_SEQUENTIAL -compact
 .It POSIX_FADV_NORMAL



CVS commit: src/external/gpl2/xcvs/dist/src

2016-12-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Dec 19 04:54:49 UTC 2016

Modified Files:
src/external/gpl2/xcvs/dist/src: update.c

Log Message:
remove obsolete comment, flip polarity.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/gpl2/xcvs/dist/src/update.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/gpl2/xcvs/dist/src/update.c
diff -u src/external/gpl2/xcvs/dist/src/update.c:1.8 src/external/gpl2/xcvs/dist/src/update.c:1.9
--- src/external/gpl2/xcvs/dist/src/update.c:1.8	Sun Dec 18 23:44:35 2016
+++ src/external/gpl2/xcvs/dist/src/update.c	Sun Dec 18 23:54:49 2016
@@ -38,7 +38,7 @@
  * as well.
  */
 #include 
-__RCSID("$NetBSD: update.c,v 1.8 2016/12/19 04:44:35 christos Exp $");
+__RCSID("$NetBSD: update.c,v 1.9 2016/12/19 04:54:49 christos Exp $");
 
 #include "cvs.h"
 #include 
@@ -1373,11 +1373,7 @@ VERS: ", 0);
 	/* set the time from the RCS file iff it was unknown before */
 	set_time =
 		(!noexec
-		/*
-		 * always pass the time to the client, and let it decide
-		 * if it is going to set the time
-		 */
-		 && (!preserve_timestamps_on_update ||
+		 && (preserve_timestamps_on_update ||
 		 vers_ts->vn_user == NULL ||
 		 strncmp (vers_ts->ts_rcs, "Initial", 7) == 0)
 		 && !file_is_dead);



CVS commit: src/sys/netinet6

2016-12-18 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Mon Dec 19 04:52:17 UTC 2016

Modified Files:
src/sys/netinet6: nd6.c

Log Message:
Kill pr->ndpr_refcnt = 0

The reference counter represents the numuber of references from IPv6
addresses to a prefix entry. If all IPv6 addresses assigned to an
interface are purged, all references to a prefix for the interface are
also released. For now nd6_purge is always called after purging all IPv6
addresses, so we can get rid of clearing pr->ndpr_refcnt from nd6_purge
and instead we can assert it's 0 there.

Note that nd6_ifdetach is only called via dom_ifdetach when processing
if_detach where dom_ifdetach is called after pr_purgeif that eventually
calls in6_ifdetach. So in the call path nd6_purge in nd6_ifdetach does
nothing. That said, we should explicitly make it sure to purge all
IPv6 addresses before nd6_purge for future changes (or the case I missed
something). So if_purgeaddrs is added to nd6_ifdetach.


To generate a diff of this commit:
cvs rdiff -u -r1.218 -r1.219 src/sys/netinet6/nd6.c

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

Modified files:

Index: src/sys/netinet6/nd6.c
diff -u src/sys/netinet6/nd6.c:1.218 src/sys/netinet6/nd6.c:1.219
--- src/sys/netinet6/nd6.c:1.218	Mon Dec 19 03:32:54 2016
+++ src/sys/netinet6/nd6.c	Mon Dec 19 04:52:17 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: nd6.c,v 1.218 2016/12/19 03:32:54 ozaki-r Exp $	*/
+/*	$NetBSD: nd6.c,v 1.219 2016/12/19 04:52:17 ozaki-r Exp $	*/
 /*	$KAME: nd6.c,v 1.279 2002/06/08 11:16:51 itojun Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.218 2016/12/19 03:32:54 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.219 2016/12/19 04:52:17 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -196,6 +196,8 @@ void
 nd6_ifdetach(struct ifnet *ifp, struct in6_ifextra *ext)
 {
 
+	/* Ensure all IPv6 addresses are purged before calling nd6_purge */
+	if_purgeaddrs(ifp, AF_INET6, in6_purgeaddr);
 	nd6_purge(ifp, ext);
 	free(ext->nd_ifinfo, M_IP6NDP);
 }
@@ -863,20 +865,9 @@ nd6_purge(struct ifnet *ifp, struct in6_
 	ND_PREFIX_LIST_FOREACH_SAFE(pr, npr) {
 		if (pr->ndpr_ifp == ifp) {
 			/*
-			 * Because if_detach() does *not* release prefixes
-			 * while purging addresses the reference count will
-			 * still be above zero. We therefore reset it to
-			 * make sure that the prefix really gets purged.
-			 */
-			pr->ndpr_refcnt = 0;
-			/*
-			 * Previously, pr->ndpr_addr is removed as well,
-			 * but I strongly believe we don't have to do it.
-			 * nd6_purge() is only called from in6_ifdetach(),
-			 * which removes all the associated interface addresses
-			 * by itself.
-			 * (jin...@kame.net 20010129)
+			 * All addresses referencing pr should be already freed.
 			 */
+			KASSERT(pr->ndpr_refcnt == 0);
 			nd6_prelist_remove(pr);
 		}
 	}



CVS commit: src/external/gpl2/xcvs/dist/src

2016-12-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Dec 19 04:44:35 UTC 2016

Modified Files:
src/external/gpl2/xcvs/dist/src: update.c

Log Message:
fix reversed logic


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/gpl2/xcvs/dist/src/update.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/gpl2/xcvs/dist/src/update.c
diff -u src/external/gpl2/xcvs/dist/src/update.c:1.7 src/external/gpl2/xcvs/dist/src/update.c:1.8
--- src/external/gpl2/xcvs/dist/src/update.c:1.7	Sun Dec 18 23:37:13 2016
+++ src/external/gpl2/xcvs/dist/src/update.c	Sun Dec 18 23:44:35 2016
@@ -38,7 +38,7 @@
  * as well.
  */
 #include 
-__RCSID("$NetBSD: update.c,v 1.7 2016/12/19 04:37:13 christos Exp $");
+__RCSID("$NetBSD: update.c,v 1.8 2016/12/19 04:44:35 christos Exp $");
 
 #include "cvs.h"
 #include 
@@ -1377,7 +1377,7 @@ VERS: ", 0);
 		 * always pass the time to the client, and let it decide
 		 * if it is going to set the time
 		 */
-		 && (preserve_timestamps_on_update ||
+		 && (!preserve_timestamps_on_update ||
 		 vers_ts->vn_user == NULL ||
 		 strncmp (vers_ts->ts_rcs, "Initial", 7) == 0)
 		 && !file_is_dead);



CVS commit: src/external/gpl2/xcvs/dist/src

2016-12-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Dec 19 04:37:13 UTC 2016

Modified Files:
src/external/gpl2/xcvs/dist/src: update.c

Log Message:
add -t to preserve timestamps.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/gpl2/xcvs/dist/src/update.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/gpl2/xcvs/dist/src/update.c
diff -u src/external/gpl2/xcvs/dist/src/update.c:1.6 src/external/gpl2/xcvs/dist/src/update.c:1.7
--- src/external/gpl2/xcvs/dist/src/update.c:1.6	Sun Dec 18 22:15:31 2016
+++ src/external/gpl2/xcvs/dist/src/update.c	Sun Dec 18 23:37:13 2016
@@ -38,7 +38,7 @@
  * as well.
  */
 #include 
-__RCSID("$NetBSD: update.c,v 1.6 2016/12/19 03:15:31 christos Exp $");
+__RCSID("$NetBSD: update.c,v 1.7 2016/12/19 04:37:13 christos Exp $");
 
 #include "cvs.h"
 #include 
@@ -106,6 +106,7 @@ static int toss_local_changes = 0;
 static int force_tag_match = 1;
 static int update_build_dirs = 0;
 static int update_prune_dirs = 0;
+static int preserve_timestamps_on_update = 0;
 static int pipeout = 0;
 static int dotemplate = 0;
 #ifdef SERVER_SUPPORT
@@ -131,6 +132,7 @@ static const char *const update_usage[] 
 "\t-D date\tSet date to update from (is sticky).\n",
 "\t-j rev\tMerge in changes made between current revision and rev.\n",
 "\t-I ign\tMore files to ignore (! to reset).\n",
+"\t-t Preserve timestamps on update.\n",
 "\t-W spec\tWrappers specification line.\n",
 "(Specify the --help global option for a list of other help options)\n",
 NULL
@@ -162,7 +164,7 @@ update (int argc, char **argv)
 
 /* parse the args */
 getoptreset ();
-while ((c = getopt (argc, argv, "+ApCPflRQqduk:r:D:j:I:W:")) != -1)
+while ((c = getopt (argc, argv, "+ApCPflRQqduk:r:tD:j:I:W:")) != -1)
 {
 	switch (c)
 	{
@@ -218,6 +220,9 @@ update (int argc, char **argv)
 		pipeout = 1;
 		noexec = 1;		/* so no locks will be created */
 		break;
+	case 't':
+		preserve_timestamps_on_update = 1;
+		break;
 	case 'j':
 		if (join_orig2)
 		error (1, 0, "only two -j options can be specified");
@@ -281,6 +286,8 @@ update (int argc, char **argv)
 		send_arg("-C");
 	if (update_prune_dirs)
 		send_arg("-P");
+	if (preserve_timestamps_on_update)
+		send_arg("-t");
 	client_prune_dirs = update_prune_dirs;
 	option_with_arg ("-r", tag);
 	if (options && options[0] != '\0')
@@ -1366,18 +1373,20 @@ VERS: ", 0);
 	/* set the time from the RCS file iff it was unknown before */
 	set_time =
 		(!noexec
-#if 0
 		/*
 		 * always pass the time to the client, and let it decide
 		 * if it is going to set the time
 		 */
-		 && (vers_ts->vn_user == NULL ||
+		 && (preserve_timestamps_on_update ||
+		 vers_ts->vn_user == NULL ||
 		 strncmp (vers_ts->ts_rcs, "Initial", 7) == 0)
-#endif
 		 && !file_is_dead);
+
 	wrap_fromcvs_process_file (finfo->file);
+
 	xvers_ts = Version_TS (finfo, options, tag, date, 
    force_tag_match, set_time);
+
 	if (strcmp (xvers_ts->options, "-V4") == 0)
 		xvers_ts->options[0] = '\0';
 



CVS commit: src/sys/netinet6

2016-12-18 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Mon Dec 19 03:32:54 UTC 2016

Modified Files:
src/sys/netinet6: in6_ifattach.c nd6.c nd6.h

Log Message:
Get rid of extra nd6_purge from in6_ifdetach

There were two nd6_purge in in6_ifdetach for some reason, but at least now
We don't need extra nd6_purge. Remove it and instead add assertions that
check if surely purged.


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.108 src/sys/netinet6/in6_ifattach.c
cvs rdiff -u -r1.217 -r1.218 src/sys/netinet6/nd6.c
cvs rdiff -u -r1.79 -r1.80 src/sys/netinet6/nd6.h

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

Modified files:

Index: src/sys/netinet6/in6_ifattach.c
diff -u src/sys/netinet6/in6_ifattach.c:1.107 src/sys/netinet6/in6_ifattach.c:1.108
--- src/sys/netinet6/in6_ifattach.c:1.107	Wed Nov 30 02:08:57 2016
+++ src/sys/netinet6/in6_ifattach.c	Mon Dec 19 03:32:54 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: in6_ifattach.c,v 1.107 2016/11/30 02:08:57 ozaki-r Exp $	*/
+/*	$NetBSD: in6_ifattach.c,v 1.108 2016/12/19 03:32:54 ozaki-r Exp $	*/
 /*	$KAME: in6_ifattach.c,v 1.124 2001/07/18 08:32:51 jinmei Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: in6_ifattach.c,v 1.107 2016/11/30 02:08:57 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6_ifattach.c,v 1.108 2016/12/19 03:32:54 ozaki-r Exp $");
 
 #include 
 #include 
@@ -815,21 +815,13 @@ in6_ifdetach(struct ifnet *ifp)
 	/* remove ip6_mrouter stuff */
 	ip6_mrouter_detach(ifp);
 
-	/* remove neighbor management table */
-	nd6_purge(ifp, NULL);
-
 	/* cleanup multicast address kludge table, if there is any */
 	in6_purgemkludge(ifp);
 
-	/*
-	 * remove neighbor management table.  we call it twice just to make
-	 * sure we nuke everything.  maybe we need just one call.
-	 * XXX: since the first call did not release addresses, some prefixes
-	 * might remain.  We should call nd6_purge() again to release the
-	 * prefixes after removing all addresses above.
-	 * (Or can we just delay calling nd6_purge until at this point?)
-	 */
+	/* remove neighbor management table */
 	nd6_purge(ifp, NULL);
+
+	nd6_assert_purged(ifp);
 }
 
 int

Index: src/sys/netinet6/nd6.c
diff -u src/sys/netinet6/nd6.c:1.217 src/sys/netinet6/nd6.c:1.218
--- src/sys/netinet6/nd6.c:1.217	Wed Dec 14 04:05:11 2016
+++ src/sys/netinet6/nd6.c	Mon Dec 19 03:32:54 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: nd6.c,v 1.217 2016/12/14 04:05:11 ozaki-r Exp $	*/
+/*	$NetBSD: nd6.c,v 1.218 2016/12/19 03:32:54 ozaki-r Exp $	*/
 /*	$KAME: nd6.c,v 1.279 2002/06/08 11:16:51 itojun Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.217 2016/12/14 04:05:11 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.218 2016/12/19 03:32:54 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -906,6 +906,26 @@ nd6_purge(struct ifnet *ifp, struct in6_
 		lltable_purge_entries(ext->lltable);
 }
 
+void
+nd6_assert_purged(struct ifnet *ifp)
+{
+	struct nd_defrouter *dr;
+	struct nd_prefix *pr;
+
+	ND_DEFROUTER_LIST_FOREACH(dr) {
+		KASSERTMSG(dr->ifp != ifp,
+		"defrouter %s remains on %s",
+		ip6_sprintf(&dr->rtaddr), ifp->if_xname);
+	}
+
+	ND_PREFIX_LIST_FOREACH(pr) {
+		KASSERTMSG(pr->ndpr_ifp != ifp,
+		"prefix %s/%d remains on %s",
+		ip6_sprintf(&pr->ndpr_prefix.sin6_addr),
+		pr->ndpr_plen, ifp->if_xname);
+	}
+}
+
 struct llentry *
 nd6_lookup(const struct in6_addr *addr6, const struct ifnet *ifp, bool wlock)
 {

Index: src/sys/netinet6/nd6.h
diff -u src/sys/netinet6/nd6.h:1.79 src/sys/netinet6/nd6.h:1.80
--- src/sys/netinet6/nd6.h:1.79	Wed Dec 14 04:05:11 2016
+++ src/sys/netinet6/nd6.h	Mon Dec 19 03:32:54 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: nd6.h,v 1.79 2016/12/14 04:05:11 ozaki-r Exp $	*/
+/*	$NetBSD: nd6.h,v 1.80 2016/12/19 03:32:54 ozaki-r Exp $	*/
 /*	$KAME: nd6.h,v 1.95 2002/06/08 11:31:06 itojun Exp $	*/
 
 /*
@@ -428,6 +428,7 @@ struct llentry *nd6_create(const struct 
 void nd6_setmtu(struct ifnet *);
 void nd6_llinfo_settimer(struct llentry *, time_t);
 void nd6_purge(struct ifnet *, struct in6_ifextra *);
+void nd6_assert_purged(struct ifnet *);
 void nd6_nud_hint(struct rtentry *);
 int nd6_resolve(struct ifnet *, struct rtentry *,
 	struct mbuf *, struct sockaddr *, u_char *);



CVS commit: src/doc

2016-12-18 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Dec 19 03:19:37 UTC 2016

Modified Files:
src/doc: TODO.ptrace

Log Message:
TODO.ptrace: Update notes about MD documentation

Currently all the MD interfaces are documented, remove this line from TODO.
Add new note:
once the API for hardware watchpoints will stabilize, document it

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/doc/TODO.ptrace

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

Modified files:

Index: src/doc/TODO.ptrace
diff -u src/doc/TODO.ptrace:1.4 src/doc/TODO.ptrace:1.5
--- src/doc/TODO.ptrace:1.4	Thu Dec 15 12:42:38 2016
+++ src/doc/TODO.ptrace	Mon Dec 19 03:19:37 2016
@@ -1,4 +1,4 @@
-$NetBSD: TODO.ptrace,v 1.4 2016/12/15 12:42:38 kamil Exp $
+$NetBSD: TODO.ptrace,v 1.5 2016/12/19 03:19:37 kamil Exp $
 
 Items we (currently) plan to finish in the ptrace(2) field:
 
@@ -9,8 +9,7 @@ Items we (currently) plan to finish in t
  - add PT_DUMPCORE tests in the ATF framework
  - add ATF tests for PT_WRITE_I and PIOD_WRITE_I - test mprotect restrictions
  - add ATF tests for PIOD_READ_AUXV
- - document all MD specific ptrace(2) interfaces
-   (PT_GETXMMREGS, PT_SETXMMREGS, ...)
+ - once the API for hardware watchpoints will stabilize, document it
  - add tests for the procfs interface covering all functions available on the
same level as ptrace(2)
  - add support for PT_STEP, PT_GETREGS, PT_SETREGS, PT_GETFPREGS, PT_SETFPREGS



CVS commit: src/external/gpl2/xcvs/dist/src

2016-12-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Dec 19 03:15:31 UTC 2016

Modified Files:
src/external/gpl2/xcvs/dist/src: update.c

Log Message:
Always pass the modification time of the file to the client and let it decide
if it is going to use it to set the time. This makes update work like checkout
with respect to time setting. The time of the updated file is set to the
repository modification time of the file as opposed to the the time that the
file was checked out.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/gpl2/xcvs/dist/src/update.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/gpl2/xcvs/dist/src/update.c
diff -u src/external/gpl2/xcvs/dist/src/update.c:1.5 src/external/gpl2/xcvs/dist/src/update.c:1.6
--- src/external/gpl2/xcvs/dist/src/update.c:1.5	Tue May 17 10:00:09 2016
+++ src/external/gpl2/xcvs/dist/src/update.c	Sun Dec 18 22:15:31 2016
@@ -38,7 +38,7 @@
  * as well.
  */
 #include 
-__RCSID("$NetBSD: update.c,v 1.5 2016/05/17 14:00:09 christos Exp $");
+__RCSID("$NetBSD: update.c,v 1.6 2016/12/19 03:15:31 christos Exp $");
 
 #include "cvs.h"
 #include 
@@ -1366,12 +1366,16 @@ VERS: ", 0);
 	/* set the time from the RCS file iff it was unknown before */
 	set_time =
 		(!noexec
+#if 0
+		/*
+		 * always pass the time to the client, and let it decide
+		 * if it is going to set the time
+		 */
 		 && (vers_ts->vn_user == NULL ||
 		 strncmp (vers_ts->ts_rcs, "Initial", 7) == 0)
+#endif
 		 && !file_is_dead);
-
 	wrap_fromcvs_process_file (finfo->file);
-
 	xvers_ts = Version_TS (finfo, options, tag, date, 
    force_tag_match, set_time);
 	if (strcmp (xvers_ts->options, "-V4") == 0)
@@ -1768,7 +1772,7 @@ patch_file (struct file_info *finfo, Ver
 /* This stuff is just copied blindly from checkout_file.  I
 	   don't really know what it does.  */
 xvers_ts = Version_TS (finfo, options, tag, date,
-			   force_tag_match, 0);
+			   force_tag_match, 1);
 	if (strcmp (xvers_ts->options, "-V4") == 0)
 	xvers_ts->options[0] = '\0';
 



CVS commit: src/tests/net/ndp

2016-12-18 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Mon Dec 19 03:07:05 UTC 2016

Modified Files:
src/tests/net/ndp: t_ra.sh

Log Message:
Add a test case for exceeding the number of maximum prefixes

The test case pinpoints purge_detached.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/tests/net/ndp/t_ra.sh

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

Modified files:

Index: src/tests/net/ndp/t_ra.sh
diff -u src/tests/net/ndp/t_ra.sh:1.14 src/tests/net/ndp/t_ra.sh:1.15
--- src/tests/net/ndp/t_ra.sh:1.14	Mon Dec 19 02:27:02 2016
+++ src/tests/net/ndp/t_ra.sh	Mon Dec 19 03:07:05 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: t_ra.sh,v 1.14 2016/12/19 02:27:02 ozaki-r Exp $
+#	$NetBSD: t_ra.sh,v 1.15 2016/12/19 03:07:05 ozaki-r Exp $
 #
 # Copyright (c) 2015 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -29,15 +29,19 @@ RUMPSRV=unix://r1
 RUMPSRV1_2=unix://r12
 RUMPCLI=unix://r2
 RUMPSRV3=unix://r3
+RUMPSRV4=unix://r4
 IP6SRV=fc00:1::1
 IP6SRV1_2=fc00:1::2
 IP6SRV_PREFIX=fc00:1:
 IP6CLI=fc00:2::2
 IP6SRV3=fc00:3::1
 IP6SRV3_PREFIX=fc00:3:
+IP6SRV4=fc00:4::1
+IP6SRV4_PREFIX=fc00:4:
 PIDFILE=./rump.rtadvd.pid
 PIDFILE1_2=./rump.rtadvd.pid12
 PIDFILE3=./rump.rtadvd.pid3
+PIDFILE4=./rump.rtadvd.pid4
 CONFIG=./rtadvd.conf
 DEBUG=${DEBUG:-true}
 
@@ -481,16 +485,82 @@ ra_multiple_routers_single_prefix_body()
 	rump_server_destroy_ifaces
 }
 
-ra_multiple_routers_single_prefix_cleanup()
+atf_test_case ra_multiple_routers_maxifprefixes cleanup
+ra_multiple_routers_maxifprefixes_head()
+{
+
+	atf_set "descr" "Tests for exceeding the number of maximum prefixes"
+	atf_set "require.progs" "rump_server rump.rtadvd rump.ndp rump.ifconfig"
+}
+
+ra_multiple_routers_maxifprefixes_body()
+{
+	local n=
+
+	rump_server_fs_start $RUMPSRV netinet6
+	rump_server_fs_start $RUMPSRV3 netinet6
+	rump_server_fs_start $RUMPSRV4 netinet6
+	rump_server_start $RUMPCLI netinet6
+
+	setup_shmif0 ${RUMPSRV} ${IP6SRV}
+	setup_shmif0 ${RUMPSRV3} ${IP6SRV3}
+	setup_shmif0 ${RUMPSRV4} ${IP6SRV4}
+	setup_shmif0 ${RUMPCLI} ${IP6CLI}
+
+	init_server $RUMPSRV
+	init_server $RUMPSRV3
+	init_server $RUMPSRV4
+
+	create_rtadvdconfig
+
+	export RUMP_SERVER=${RUMPCLI}
+	atf_check -s exit:0 -o match:'0.->.1' \
+	rump.sysctl -w net.inet6.ip6.accept_rtadv=1
+	# Limit the maximum number of prefix entries to 2
+	atf_check -s exit:0 -o match:'16.->.2' \
+	rump.sysctl -w net.inet6.ip6.maxifprefixes=2
+	unset RUMP_SERVER
+
+	start_rtadvd $RUMPSRV $PIDFILE
+	start_rtadvd $RUMPSRV3 $PIDFILE3
+
+	check_entries $RUMPCLI $RUMPSRV $IP6SRV_PREFIX
+	check_entries $RUMPCLI $RUMPSRV3 $IP6SRV3_PREFIX
+
+	start_rtadvd $RUMPSRV4 $PIDFILE4
+
+	export RUMP_SERVER=${RUMPCLI}
+	$DEBUG && dump_entries
+	# There should remain two prefixes
+	n=$(rump.ndp -p |grep 'advertised by' |wc -l)
+	atf_check_equal $n 2
+	# TODO check other conditions
+	unset RUMP_SERVER
+
+	atf_check -s exit:0 kill -TERM `cat ${PIDFILE}`
+	wait_term ${PIDFILE}
+	atf_check -s exit:0 kill -TERM `cat ${PIDFILE3}`
+	wait_term ${PIDFILE3}
+	atf_check -s exit:0 kill -TERM `cat ${PIDFILE4}`
+	wait_term ${PIDFILE4}
+
+	rump_server_destroy_ifaces
+}
+
+ra_multiple_routers_maxifprefixes_cleanup()
 {
 
 	if [ -f ${PIDFILE} ]; then
 		kill -TERM `cat ${PIDFILE}`
 		wait_term ${PIDFILE}
 	fi
-	if [ -f ${PIDFILE1_2} ]; then
-		kill -TERM `cat ${PIDFILE1_2}`
-		wait_term ${PIDFILE1_2}
+	if [ -f ${PIDFILE3} ]; then
+		kill -TERM `cat ${PIDFILE3}`
+		wait_term ${PIDFILE3}
+	fi
+	if [ -f ${PIDFILE4} ]; then
+		kill -TERM `cat ${PIDFILE4}`
+		wait_term ${PIDFILE4}
 	fi
 
 	$DEBUG && dump
@@ -506,4 +576,5 @@ atf_init_test_cases()
 	atf_add_test_case ra_delete_address
 	atf_add_test_case ra_multiple_routers
 	atf_add_test_case ra_multiple_routers_single_prefix
+	atf_add_test_case ra_multiple_routers_maxifprefixes
 }



CVS commit: src/tests/net/ndp

2016-12-18 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Mon Dec 19 02:27:03 UTC 2016

Modified Files:
src/tests/net/ndp: t_ra.sh

Log Message:
Add tests for multiple routers with a single prefix


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/tests/net/ndp/t_ra.sh

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

Modified files:

Index: src/tests/net/ndp/t_ra.sh
diff -u src/tests/net/ndp/t_ra.sh:1.13 src/tests/net/ndp/t_ra.sh:1.14
--- src/tests/net/ndp/t_ra.sh:1.13	Mon Dec 19 01:37:30 2016
+++ src/tests/net/ndp/t_ra.sh	Mon Dec 19 02:27:02 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: t_ra.sh,v 1.13 2016/12/19 01:37:30 ozaki-r Exp $
+#	$NetBSD: t_ra.sh,v 1.14 2016/12/19 02:27:02 ozaki-r Exp $
 #
 # Copyright (c) 2015 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -26,14 +26,17 @@
 #
 
 RUMPSRV=unix://r1
+RUMPSRV1_2=unix://r12
 RUMPCLI=unix://r2
 RUMPSRV3=unix://r3
 IP6SRV=fc00:1::1
+IP6SRV1_2=fc00:1::2
 IP6SRV_PREFIX=fc00:1:
 IP6CLI=fc00:2::2
 IP6SRV3=fc00:3::1
 IP6SRV3_PREFIX=fc00:3:
 PIDFILE=./rump.rtadvd.pid
+PIDFILE1_2=./rump.rtadvd.pid12
 PIDFILE3=./rump.rtadvd.pid3
 CONFIG=./rtadvd.conf
 DEBUG=${DEBUG:-true}
@@ -374,6 +377,7 @@ ra_multiple_routers_head()
 
 ra_multiple_routers_body()
 {
+	local n=
 
 	rump_server_fs_start $RUMPSRV netinet6
 	rump_server_fs_start $RUMPSRV3 netinet6
@@ -398,6 +402,12 @@ ra_multiple_routers_body()
 	check_entries $RUMPCLI $RUMPSRV $IP6SRV_PREFIX
 	check_entries $RUMPCLI $RUMPSRV3 $IP6SRV3_PREFIX
 
+	export RUMP_SERVER=$RUMPCLI
+	# Two prefixes are advertised by differnt two routers
+	n=$(rump.ndp -p |grep 'advertised by' |wc -l)
+	atf_check_equal $n 2
+	unset RUMP_SERVER
+
 	atf_check -s exit:0 kill -TERM `cat ${PIDFILE}`
 	wait_term ${PIDFILE}
 	atf_check -s exit:0 kill -TERM `cat ${PIDFILE3}`
@@ -422,6 +432,71 @@ ra_multiple_routers_cleanup()
 	cleanup
 }
 
+atf_test_case ra_multiple_routers_single_prefix cleanup
+ra_multiple_routers_single_prefix_head()
+{
+
+	atf_set "descr" "Tests for multiple routers with a single prefix"
+	atf_set "require.progs" "rump_server rump.rtadvd rump.ndp rump.ifconfig"
+}
+
+ra_multiple_routers_single_prefix_body()
+{
+	local n=
+
+	rump_server_fs_start $RUMPSRV netinet6
+	rump_server_fs_start $RUMPSRV1_2 netinet6
+	rump_server_start $RUMPCLI netinet6
+
+	setup_shmif0 ${RUMPSRV} ${IP6SRV}
+	setup_shmif0 ${RUMPSRV1_2} ${IP6SRV1_2}
+	setup_shmif0 ${RUMPCLI} ${IP6CLI}
+
+	init_server $RUMPSRV
+	init_server $RUMPSRV1_2
+
+	create_rtadvdconfig
+
+	export RUMP_SERVER=${RUMPCLI}
+	atf_check -s exit:0 -o match:'0.->.1' rump.sysctl -w net.inet6.ip6.accept_rtadv=1
+	unset RUMP_SERVER
+
+	start_rtadvd $RUMPSRV $PIDFILE
+	start_rtadvd $RUMPSRV1_2 $PIDFILE1_2
+
+	check_entries $RUMPCLI $RUMPSRV $IP6SRV_PREFIX
+	check_entries $RUMPCLI $RUMPSRV1_2 $IP6SRV_PREFIX
+
+	export RUMP_SERVER=$RUMPCLI
+	# One prefix is advertised by differnt two routers
+	n=$(rump.ndp -p |grep 'advertised by' |wc -l)
+	atf_check_equal $n 1
+	unset RUMP_SERVER
+
+	atf_check -s exit:0 kill -TERM `cat ${PIDFILE}`
+	wait_term ${PIDFILE}
+	atf_check -s exit:0 kill -TERM `cat ${PIDFILE1_2}`
+	wait_term ${PIDFILE1_2}
+
+	rump_server_destroy_ifaces
+}
+
+ra_multiple_routers_single_prefix_cleanup()
+{
+
+	if [ -f ${PIDFILE} ]; then
+		kill -TERM `cat ${PIDFILE}`
+		wait_term ${PIDFILE}
+	fi
+	if [ -f ${PIDFILE1_2} ]; then
+		kill -TERM `cat ${PIDFILE1_2}`
+		wait_term ${PIDFILE1_2}
+	fi
+
+	$DEBUG && dump
+	cleanup
+}
+
 atf_init_test_cases()
 {
 
@@ -430,4 +505,5 @@ atf_init_test_cases()
 	atf_add_test_case ra_flush_defrouter_entries
 	atf_add_test_case ra_delete_address
 	atf_add_test_case ra_multiple_routers
+	atf_add_test_case ra_multiple_routers_single_prefix
 }



CVS commit: src/usr.bin/cvslatest

2016-12-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Dec 19 01:48:00 UTC 2016

Modified Files:
src/usr.bin/cvslatest: cvslatest.c

Log Message:
print only the latest entry for debugging.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/cvslatest/cvslatest.c

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

Modified files:

Index: src/usr.bin/cvslatest/cvslatest.c
diff -u src/usr.bin/cvslatest/cvslatest.c:1.2 src/usr.bin/cvslatest/cvslatest.c:1.3
--- src/usr.bin/cvslatest/cvslatest.c:1.2	Sun Jan 24 15:14:44 2016
+++ src/usr.bin/cvslatest/cvslatest.c	Sun Dec 18 20:48:00 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: cvslatest.c,v 1.2 2016/01/24 20:14:44 christos Exp $	*/
+/*	$NetBSD: cvslatest.c,v 1.3 2016/12/19 01:48:00 christos Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: cvslatest.c,v 1.2 2016/01/24 20:14:44 christos Exp $");
+__RCSID("$NetBSD: cvslatest.c,v 1.3 2016/12/19 01:48:00 christos Exp $");
 
 /*
  * Find the latest timestamp in a set of CVS trees, by examining the
@@ -120,7 +120,7 @@ getlatest(const char *path, const char *
 			lat->time = t;
 			snprintf(lat->path, sizeof(lat->path),
 			"%s/%s", repo, fn);
-			if (debug)
+			if (debug > 1)
 printlat(lat);
 		}
 	}



CVS commit: src/tests/net/ndp

2016-12-18 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Mon Dec 19 01:37:30 UTC 2016

Modified Files:
src/tests/net/ndp: t_ra.sh

Log Message:
Fix the description of a test


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/tests/net/ndp/t_ra.sh

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

Modified files:

Index: src/tests/net/ndp/t_ra.sh
diff -u src/tests/net/ndp/t_ra.sh:1.12 src/tests/net/ndp/t_ra.sh:1.13
--- src/tests/net/ndp/t_ra.sh:1.12	Fri Dec 16 09:11:18 2016
+++ src/tests/net/ndp/t_ra.sh	Mon Dec 19 01:37:30 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: t_ra.sh,v 1.12 2016/12/16 09:11:18 ozaki-r Exp $
+#	$NetBSD: t_ra.sh,v 1.13 2016/12/19 01:37:30 ozaki-r Exp $
 #
 # Copyright (c) 2015 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -368,7 +368,7 @@ atf_test_case ra_multiple_routers cleanu
 ra_multiple_routers_head()
 {
 
-	atf_set "descr" "Tests for deleting auto-configured address"
+	atf_set "descr" "Tests for multiple routers"
 	atf_set "require.progs" "rump_server rump.rtadvd rump.ndp rump.ifconfig"
 }
 



CVS commit: src/external/cddl/osnet/lib/libdtrace

2016-12-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Dec 19 01:26:31 UTC 2016

Modified Files:
src/external/cddl/osnet/lib/libdtrace: Makefile

Log Message:
arrange for .in files to be rebuilt.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/external/cddl/osnet/lib/libdtrace/Makefile

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

Modified files:

Index: src/external/cddl/osnet/lib/libdtrace/Makefile
diff -u src/external/cddl/osnet/lib/libdtrace/Makefile:1.15 src/external/cddl/osnet/lib/libdtrace/Makefile:1.16
--- src/external/cddl/osnet/lib/libdtrace/Makefile:1.15	Thu Aug  4 13:07:24 2016
+++ src/external/cddl/osnet/lib/libdtrace/Makefile	Sun Dec 18 20:26:31 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.15 2016/08/04 17:07:24 christos Exp $
+#	$NetBSD: Makefile,v 1.16 2016/12/19 01:26:31 christos Exp $
 
 # $FreeBSD: src/cddl/lib/libdtrace/Makefile,v 1.2.2.1 2009/08/03 08:13:06 kensmith Exp $
 
@@ -119,6 +119,12 @@ beforedepend:	dt_errtags.c dt_names.c
 foo:
 	echo ${OPENSOLARIS_USR_DISTDIR}
 
+.SUFFIXES: .in
+.in:
+	${CPP} -D_KERNEL ${CPPFLAGS} $< | tr -d ' ' | tr '"' '@' | \
+	${TOOL_SED} -e 's/\&/\\\&/g' | grep '^s/' > ${.TARGET}
+
+
 FILES=		${DSRCS}
 FILESDIR=	/usr/lib/dtrace
 



CVS commit: src/lib/libexecinfo

2016-12-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Dec 19 01:24:40 UTC 2016

Modified Files:
src/lib/libexecinfo: unwind.h

Log Message:
flesh out _Unwind_Exception, rust needs it.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libexecinfo/unwind.h

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

Modified files:

Index: src/lib/libexecinfo/unwind.h
diff -u src/lib/libexecinfo/unwind.h:1.4 src/lib/libexecinfo/unwind.h:1.5
--- src/lib/libexecinfo/unwind.h:1.4	Fri Dec  2 14:25:19 2016
+++ src/lib/libexecinfo/unwind.h	Sun Dec 18 20:24:40 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: unwind.h,v 1.4 2016/12/02 19:25:19 christos Exp $	*/
+/*	$NetBSD: unwind.h,v 1.5 2016/12/19 01:24:40 christos Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -28,7 +28,8 @@
 #ifndef _UNWIND_H_
 #define _UNWIND_H_
 
-#include 
+#include 
+#include 
 
 __BEGIN_DECLS
 struct _Unwind_Context;
@@ -54,6 +55,14 @@ typedef long _Unwind_Word;
 #define	_URC_INSTALL_CONTEXT		7
 #define	_URC_CONTINUE_UNWIND		8
 
+struct _Unwind_Exception {
+	uint64_t exception_class;
+	void (*exception_cleanup)(_Unwind_Reason_Code,
+	struct _Unwind_Exception *);
+	uintptr_t private_1;
+	uintptr_t private_2;
+} __attribute__((__aligned__));
+
 typedef _Unwind_Reason_Code
 (*_Unwind_Trace_Fn)(struct _Unwind_Context *, void *);
 #ifdef notyet



CVS commit: src

2016-12-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 18 19:39:05 UTC 2016

Modified Files:
src: build.sh

Log Message:
add a trailing / to force symlink resolution.


To generate a diff of this commit:
cvs rdiff -u -r1.313 -r1.314 src/build.sh

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

Modified files:

Index: src/build.sh
diff -u src/build.sh:1.313 src/build.sh:1.314
--- src/build.sh:1.313	Sun Dec 18 14:00:20 2016
+++ src/build.sh	Sun Dec 18 14:39:05 2016
@@ -1,5 +1,5 @@
 #! /usr/bin/env sh
-#	$NetBSD: build.sh,v 1.313 2016/12/18 19:00:20 christos Exp $
+#	$NetBSD: build.sh,v 1.314 2016/12/18 19:39:05 christos Exp $
 #
 # Copyright (c) 2001-2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -1892,7 +1892,7 @@ createmakewrapper()
 	eval cat <

CVS commit: src

2016-12-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 18 19:00:20 UTC 2016

Modified Files:
src: build.sh

Log Message:
Bail out on error computing the timestamp


To generate a diff of this commit:
cvs rdiff -u -r1.312 -r1.313 src/build.sh

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

Modified files:

Index: src/build.sh
diff -u src/build.sh:1.312 src/build.sh:1.313
--- src/build.sh:1.312	Sat Dec 17 21:20:30 2016
+++ src/build.sh	Sun Dec 18 14:00:20 2016
@@ -1,5 +1,5 @@
 #! /usr/bin/env sh
-#	$NetBSD: build.sh,v 1.312 2016/12/18 02:20:30 christos Exp $
+#	$NetBSD: build.sh,v 1.313 2016/12/18 19:00:20 christos Exp $
 #
 # Copyright (c) 2001-2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -1892,7 +1892,7 @@ createmakewrapper()
 	eval cat <

CVS commit: src/usr.sbin/mdsetimage

2016-12-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Dec 18 18:32:24 UTC 2016

Modified Files:
src/usr.sbin/mdsetimage: mdsetimage.c

Log Message:
Need  for uintmax_t.

>From debidi in #netbsd on Freenode.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/usr.sbin/mdsetimage/mdsetimage.c

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

Modified files:

Index: src/usr.sbin/mdsetimage/mdsetimage.c
diff -u src/usr.sbin/mdsetimage/mdsetimage.c:1.23 src/usr.sbin/mdsetimage/mdsetimage.c:1.24
--- src/usr.sbin/mdsetimage/mdsetimage.c:1.23	Thu Sep 22 08:43:26 2016
+++ src/usr.sbin/mdsetimage/mdsetimage.c	Sun Dec 18 18:32:24 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: mdsetimage.c,v 1.23 2016/09/22 08:43:26 mlelstv Exp $	*/
+/*	$NetBSD: mdsetimage.c,v 1.24 2016/12/18 18:32:24 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1996, 2002 Christopher G. Demetriou
@@ -37,7 +37,7 @@
 #if !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1996\
  Christopher G. Demetriou.  All rights reserved.");
-__RCSID("$NetBSD: mdsetimage.c,v 1.23 2016/09/22 08:43:26 mlelstv Exp $");
+__RCSID("$NetBSD: mdsetimage.c,v 1.24 2016/12/18 18:32:24 riastradh Exp $");
 #endif /* not lint */
 
 #include 
@@ -47,6 +47,7 @@ __RCSID("$NetBSD: mdsetimage.c,v 1.23 20
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 



CVS commit: src/distrib/sets/lists/base

2016-12-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 18 17:58:08 UTC 2016

Modified Files:
src/distrib/sets/lists/base: mi

Log Message:
mark old firmware obsolete.


To generate a diff of this commit:
cvs rdiff -u -r1.1142 -r1.1143 src/distrib/sets/lists/base/mi

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

Modified files:

Index: src/distrib/sets/lists/base/mi
diff -u src/distrib/sets/lists/base/mi:1.1142 src/distrib/sets/lists/base/mi:1.1143
--- src/distrib/sets/lists/base/mi:1.1142	Sat Dec 17 21:18:28 2016
+++ src/distrib/sets/lists/base/mi	Sun Dec 18 12:58:08 2016
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1142 2016/12/18 02:18:28 nonaka Exp $
+# $NetBSD: mi,v 1.1143 2016/12/18 17:58:08 christos Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -157,11 +157,11 @@
 ./libdata/firmware/if_iwm/README.iwlwifi-7265-ucode	base-firmware-root
 ./libdata/firmware/if_iwm/README.iwlwifi-8000-ucode	base-firmware-root
 ./libdata/firmware/if_iwm/iwlwifi-3160-16.ucode	base-firmware-root
-./libdata/firmware/if_iwm/iwlwifi-3160-9.ucode	base-firmware-root
+./libdata/firmware/if_iwm/iwlwifi-3160-9.ucode	base-obsolete	obsolete
 ./libdata/firmware/if_iwm/iwlwifi-7260-16.ucode	base-firmware-root
-./libdata/firmware/if_iwm/iwlwifi-7260-9.ucode	base-firmware-root
+./libdata/firmware/if_iwm/iwlwifi-7260-9.ucode	base-obsolete	obsolete
 ./libdata/firmware/if_iwm/iwlwifi-7265-16.ucode	base-firmware-root
-./libdata/firmware/if_iwm/iwlwifi-7265-9.ucode	base-firmware-root
+./libdata/firmware/if_iwm/iwlwifi-7265-9.ucode	base-obsolete	obsolete
 ./libdata/firmware/if_iwm/iwlwifi-7265D-16.ucode	base-firmware-root
 ./libdata/firmware/if_iwm/iwlwifi-8000C-16.ucode	base-firmware-root
 ./libdata/firmware/if_iwn			base-firmware-root



CVS commit: src/external/intel-fw-public

2016-12-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 18 17:57:39 UTC 2016

Modified Files:
src/external/intel-fw-public/iwl3160: Makefile
src/external/intel-fw-public/iwl7260: Makefile
src/external/intel-fw-public/iwl7265: Makefile
Removed Files:
src/external/intel-fw-public/iwl3160/dist: iwlwifi-3160-9.ucode
src/external/intel-fw-public/iwl7260/dist: iwlwifi-7260-9.ucode
src/external/intel-fw-public/iwl7265/dist: iwlwifi-7265-9.ucode

Log Message:
remove old microcode


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/intel-fw-public/iwl3160/Makefile
cvs rdiff -u -r1.1 -r0 \
src/external/intel-fw-public/iwl3160/dist/iwlwifi-3160-9.ucode
cvs rdiff -u -r1.2 -r1.3 src/external/intel-fw-public/iwl7260/Makefile
cvs rdiff -u -r1.1 -r0 \
src/external/intel-fw-public/iwl7260/dist/iwlwifi-7260-9.ucode
cvs rdiff -u -r1.2 -r1.3 src/external/intel-fw-public/iwl7265/Makefile
cvs rdiff -u -r1.1 -r0 \
src/external/intel-fw-public/iwl7265/dist/iwlwifi-7265-9.ucode

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

Modified files:

Index: src/external/intel-fw-public/iwl3160/Makefile
diff -u src/external/intel-fw-public/iwl3160/Makefile:1.2 src/external/intel-fw-public/iwl3160/Makefile:1.3
--- src/external/intel-fw-public/iwl3160/Makefile:1.2	Sun Dec 18 01:56:43 2016
+++ src/external/intel-fw-public/iwl3160/Makefile	Sun Dec 18 12:57:38 2016
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.2 2016/12/18 06:56:43 nonaka Exp $
+# $NetBSD: Makefile,v 1.3 2016/12/18 17:57:38 christos Exp $
 
 NOMAN=	# define
 
 FILES=	dist/LICENSE.iwlwifi-3160-ucode dist/README.iwlwifi-3160-ucode \
-	dist/iwlwifi-3160-9.ucode dist/iwlwifi-3160-16.ucode
+	dist/iwlwifi-3160-16.ucode
 
 FILESDIR=	/libdata/firmware/if_iwm
 

Index: src/external/intel-fw-public/iwl7260/Makefile
diff -u src/external/intel-fw-public/iwl7260/Makefile:1.2 src/external/intel-fw-public/iwl7260/Makefile:1.3
--- src/external/intel-fw-public/iwl7260/Makefile:1.2	Sat Dec 17 21:18:29 2016
+++ src/external/intel-fw-public/iwl7260/Makefile	Sun Dec 18 12:57:38 2016
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.2 2016/12/18 02:18:29 nonaka Exp $
+# $NetBSD: Makefile,v 1.3 2016/12/18 17:57:38 christos Exp $
 
 NOMAN=	# define
 
 FILES=	dist/LICENSE.iwlwifi-7260-ucode dist/README.iwlwifi-7260-ucode \
-	dist/iwlwifi-7260-9.ucode dist/iwlwifi-7260-16.ucode
+	dist/iwlwifi-7260-16.ucode
 
 FILESDIR=	/libdata/firmware/if_iwm
 

Index: src/external/intel-fw-public/iwl7265/Makefile
diff -u src/external/intel-fw-public/iwl7265/Makefile:1.2 src/external/intel-fw-public/iwl7265/Makefile:1.3
--- src/external/intel-fw-public/iwl7265/Makefile:1.2	Sat Dec 17 21:18:29 2016
+++ src/external/intel-fw-public/iwl7265/Makefile	Sun Dec 18 12:57:38 2016
@@ -1,9 +1,8 @@
-# $NetBSD: Makefile,v 1.2 2016/12/18 02:18:29 nonaka Exp $
+# $NetBSD: Makefile,v 1.3 2016/12/18 17:57:38 christos Exp $
 
 NOMAN=	# define
 
 FILES=	dist/LICENSE.iwlwifi-7265-ucode dist/README.iwlwifi-7265-ucode \
-	dist/iwlwifi-7265-9.ucode \
 	dist/iwlwifi-7265-16.ucode dist/iwlwifi-7265D-16.ucode
 
 FILESDIR=	/libdata/firmware/if_iwm



CVS commit: src/lib/libc/net

2016-12-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 18 17:34:36 UTC 2016

Modified Files:
src/lib/libc/net: resolver.3

Log Message:
clarify res_nclose and res_ndestroy.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/lib/libc/net/resolver.3

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

Modified files:

Index: src/lib/libc/net/resolver.3
diff -u src/lib/libc/net/resolver.3:1.30 src/lib/libc/net/resolver.3:1.31
--- src/lib/libc/net/resolver.3:1.30	Fri Jan 22 05:58:39 2016
+++ src/lib/libc/net/resolver.3	Sun Dec 18 12:34:36 2016
@@ -1,4 +1,4 @@
-.\"	$NetBSD: resolver.3,v 1.30 2016/01/22 10:58:39 wiz Exp $
+.\"	$NetBSD: resolver.3,v 1.31 2016/12/18 17:34:36 christos Exp $
 .\" Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
 .\"
 .\" Permission to use, copy, modify, and distribute this software for any
@@ -33,7 +33,7 @@
 .\"	@(#)resolver.3	6.5 (Berkeley) 6/23/90
 .\"	Id: resolver.man3,v 1.2 2009/01/21 00:12:34 each Exp
 .\"
-.Dd January 22, 2016
+.Dd December 18, 2016
 .Dt RESOLVER 3
 .Os
 .Sh NAME
@@ -611,10 +611,16 @@ The functions
 .Fn res_nclose
 /
 .Fn res_close
-close any open files referenced through
+close any open socket file descriptors referenced through
 .Fa statp
 /
 .Fa _res .
+These functions were designed to be used to emulate
+.Xr endhostent 3 ,
+and don't release other resources held in
+.Ft res_state ;
+to free all_resources, call
+.Fn res_ndestroy .
 .Pp
 The function
 .Fn res_ndestroy



CVS commit: src/sys/sys

2016-12-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 18 17:18:01 UTC 2016

Modified Files:
src/sys/sys: time.h

Log Message:
Change CLOCK_THREAD_CPUTIME_ID so that it is not negative; requested by joerg
this breaks ABI compatibility, but not much should be using this yet, since
it was recently added.


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/sys/sys/time.h

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

Modified files:

Index: src/sys/sys/time.h
diff -u src/sys/sys/time.h:1.73 src/sys/sys/time.h:1.74
--- src/sys/sys/time.h:1.73	Thu Jul  7 02:55:44 2016
+++ src/sys/sys/time.h	Sun Dec 18 12:18:01 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: time.h,v 1.73 2016/07/07 06:55:44 msaitoh Exp $	*/
+/*	$NetBSD: time.h,v 1.74 2016/12/18 17:18:01 christos Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1993
@@ -284,7 +284,7 @@ struct	itimerspec {
 #define	CLOCK_VIRTUAL	1
 #define	CLOCK_PROF	2
 #define	CLOCK_MONOTONIC	3
-#define CLOCK_THREAD_CPUTIME_ID		0x8000
+#define CLOCK_THREAD_CPUTIME_ID		0x2000
 #define CLOCK_PROCESS_CPUTIME_ID	0x4000
 
 #if defined(_NETBSD_SOURCE)



CVS commit: src/external/public-domain/sqlite/man

2016-12-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 18 16:58:17 UTC 2016

Modified Files:
src/external/public-domain/sqlite/man: SQLITE_ACCESS_EXISTS.3
SQLITE_CHANGESET_DATA.3 SQLITE_CHANGESET_OMIT.3
SQLITE_CHECKPOINT_PASSIVE.3 SQLITE_CONFIG_SINGLETHREAD.3
SQLITE_CREATE_INDEX.3 SQLITE_DBCONFIG_LOOKASIDE.3
SQLITE_DBSTATUS_LOOKASIDE_USED.3 SQLITE_DENY.3
SQLITE_DETERMINISTIC.3 SQLITE_FCNTL_LOCKSTATE.3
SQLITE_INDEX_CONSTRAINT_EQ.3 SQLITE_INDEX_SCAN_UNIQUE.3
SQLITE_INTEGER.3 SQLITE_IOCAP_ATOMIC.3 SQLITE_IOERR_READ.3
SQLITE_LIMIT_LENGTH.3 SQLITE_LOCK_NONE.3 SQLITE_MUTEX_FAST.3
SQLITE_OK.3 SQLITE_OPEN_READONLY.3 SQLITE_ROLLBACK.3
SQLITE_SCANSTAT_NLOOP.3 SQLITE_SHM_NLOCK.3 SQLITE_SHM_UNLOCK.3
SQLITE_STATUS_MEMORY_USED.3 SQLITE_STMTSTATUS_FULLSCAN_STEP.3
SQLITE_SYNC_NORMAL.3 SQLITE_TESTCTRL_FIRST.3 SQLITE_UTF8.3
SQLITE_VERSION.3 SQLITE_VTAB_CONSTRAINT_SUPPORT.3 sqlite3.3
sqlite3_aggregate_context.3 sqlite3_aggregate_count.3
sqlite3_auto_extension.3 sqlite3_backup.3 sqlite3_backup_init.3
sqlite3_bind_blob.3 sqlite3_bind_parameter_count.3
sqlite3_bind_parameter_index.3 sqlite3_bind_parameter_name.3
sqlite3_blob.3 sqlite3_blob_bytes.3 sqlite3_blob_close.3
sqlite3_blob_open.3 sqlite3_blob_read.3 sqlite3_blob_reopen.3
sqlite3_blob_write.3 sqlite3_busy_handler.3 sqlite3_busy_timeout.3
sqlite3_cancel_auto_extension.3 sqlite3_changes.3
sqlite3_changeset_iter.3 sqlite3_clear_bindings.3 sqlite3_close.3
sqlite3_collation_needed.3 sqlite3_column_blob.3
sqlite3_column_count.3 sqlite3_column_database_name.3
sqlite3_column_decltype.3 sqlite3_column_name.3
sqlite3_commit_hook.3 sqlite3_compileoption_used.3
sqlite3_complete.3 sqlite3_config.3 sqlite3_context.3
sqlite3_context_db_handle.3 sqlite3_create_collation.3
sqlite3_create_function.3 sqlite3_create_module.3
sqlite3_data_count.3 sqlite3_data_directory.3
sqlite3_db_cacheflush.3 sqlite3_db_config.3 sqlite3_db_filename.3
sqlite3_db_handle.3 sqlite3_db_mutex.3 sqlite3_db_readonly.3
sqlite3_db_release_memory.3 sqlite3_db_status.3
sqlite3_declare_vtab.3 sqlite3_destructor_type.3
sqlite3_enable_load_extension.3 sqlite3_enable_shared_cache.3
sqlite3_errcode.3 sqlite3_exec.3 sqlite3_extended_result_codes.3
sqlite3_file.3 sqlite3_file_control.3 sqlite3_finalize.3
sqlite3_get_autocommit.3 sqlite3_get_auxdata.3 sqlite3_get_table.3
sqlite3_index_info.3 sqlite3_initialize.3 sqlite3_interrupt.3
sqlite3_io_methods.3 sqlite3_last_insert_rowid.3 sqlite3_limit.3
sqlite3_load_extension.3 sqlite3_log.3 sqlite3_malloc.3
sqlite3_mem_methods.3 sqlite3_memory_used.3 sqlite3_module.3
sqlite3_mprintf.3 sqlite3_mutex.3 sqlite3_mutex_alloc.3
sqlite3_mutex_held.3 sqlite3_mutex_methods.3 sqlite3_next_stmt.3
sqlite3_open.3 sqlite3_overload_function.3 sqlite3_pcache.3
sqlite3_pcache_methods2.3 sqlite3_pcache_page.3 sqlite3_prepare.3
sqlite3_preupdate_hook.3 sqlite3_progress_handler.3
sqlite3_randomness.3 sqlite3_release_memory.3 sqlite3_reset.3
sqlite3_reset_auto_extension.3 sqlite3_result_blob.3
sqlite3_result_subtype.3 sqlite3_session.3 sqlite3_set_authorizer.3
sqlite3_sleep.3 sqlite3_snapshot.3 sqlite3_snapshot_cmp.3
sqlite3_snapshot_free.3 sqlite3_snapshot_get.3
sqlite3_snapshot_open.3 sqlite3_soft_heap_limit.3
sqlite3_soft_heap_limit64.3 sqlite3_sql.3 sqlite3_status.3
sqlite3_step.3 sqlite3_stmt.3 sqlite3_stmt_busy.3
sqlite3_stmt_readonly.3 sqlite3_stmt_scanstatus.3
sqlite3_stmt_scanstatus_reset.3 sqlite3_stmt_status.3
sqlite3_strglob.3 sqlite3_stricmp.3 sqlite3_strlike.3
sqlite3_system_errno.3 sqlite3_table_column_metadata.3
sqlite3_temp_directory.3 sqlite3_test_control.3
sqlite3_threadsafe.3 sqlite3_total_changes.3 sqlite3_trace.3
sqlite3_unlock_notify.3 sqlite3_update_hook.3
sqlite3_uri_parameter.3 sqlite3_user_data.3 sqlite3_value.3
sqlite3_value_blob.3 sqlite3_value_dup.3 sqlite3_value_subtype.3
sqlite3_version.3 sqlite3_vfs.3 sqlite3_vfs_find.3 sqlite3_vtab.3
sqlite3_vtab_config.3 sqlite3_vtab_cursor.3
sqlite3_vtab_on_conflict.3 sqlite3_wal_autocheckpoint.3
sqlite3_wal_checkpoint.3 sqlite3_wal_checkpoint_v2.3
sqlite3_wal_hook.3 sqlite3changegroup_new.3
sqlite3changeset_apply.3 sqlite3changeset_apply_strm.3
sqlite3changeset_concat.3 sqlite

CVS commit: src/external/public-domain/sqlite/sqlite2mdoc

2016-12-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 18 16:56:32 UTC 2016

Modified Files:
src/external/public-domain/sqlite/sqlite2mdoc: main.c

Log Message:
Don't emit $Mdocdate$ in the next regeneration.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/public-domain/sqlite/sqlite2mdoc/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/public-domain/sqlite/sqlite2mdoc/main.c
diff -u src/external/public-domain/sqlite/sqlite2mdoc/main.c:1.1 src/external/public-domain/sqlite/sqlite2mdoc/main.c:1.2
--- src/external/public-domain/sqlite/sqlite2mdoc/main.c:1.1	Wed Mar 30 17:30:20 2016
+++ src/external/public-domain/sqlite/sqlite2mdoc/main.c	Sun Dec 18 11:56:32 2016
@@ -1,4 +1,4 @@
-/*	$Id: main.c,v 1.1 2016/03/30 21:30:20 christos Exp $ */
+/*	$Id: main.c,v 1.2 2016/12/18 16:56:32 christos Exp $ */
 /*
  * Copyright (c) 2016 Kristaps Dzonsons 
  *
@@ -22,6 +22,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1014,7 +1015,7 @@ lookup(char *key)
  * Emit a valid mdoc(7) document within the given prefix.
  */
 static void
-emit(const struct defn *d)
+emit(const struct defn *d, const char *mdocdate)
 {
 	struct decl	*first;
 	size_t		 sz, i, col, last, ns;
@@ -1039,7 +1040,11 @@ emit(const struct defn *d)
 		f = stdout;
 
 	/* Begin by outputting the mdoc(7) header. */
+#if 0
 	fputs(".Dd $" "Mdocdate$\n", f);
+#else
+	fprintf(f, ".Dd %s\n", mdocdate);
+#endif
 	fprintf(f, ".Dt %s 3\n", d->dt);
 	fputs(".Os\n", f);
 	fputs(".Sh NAME\n", f);
@@ -1485,6 +1490,12 @@ main(int argc, char *argv[])
 			goto usage;
 		}
 
+	time_t now = time(NULL);
+	struct tm tm;
+	char mdocdate[256];
+	if (gmtime_r(&now, &tm) == NULL)
+		err(EXIT_FAILURE, "gmtime");
+	strftime(mdocdate, sizeof(mdocdate), "%B %d, %Y", &tm);
 	/*
 	 * Read in line-by-line and process in the phase dictated by our
 	 * finite state automaton.
@@ -1533,7 +1544,7 @@ main(int argc, char *argv[])
 			TAILQ_FOREACH(d, &p.dqhead, entries)
 postprocess(prefix, d);
 			TAILQ_FOREACH(d, &p.dqhead, entries)
-emit(d);
+emit(d, mdocdate);
 			rc = 1;
 		} else if (PHASE_DECL != p.phase)
 			warnx("%s:%zu: exit when not in "



CVS commit: src/sys/external/bsd/acpica/dist/compiler

2016-12-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 18 16:34:19 UTC 2016

Modified Files:
src/sys/external/bsd/acpica/dist/compiler: asloptions.c

Log Message:
Fix repro build.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.8 -r1.2 \
src/sys/external/bsd/acpica/dist/compiler/asloptions.c

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

Modified files:

Index: src/sys/external/bsd/acpica/dist/compiler/asloptions.c
diff -u src/sys/external/bsd/acpica/dist/compiler/asloptions.c:1.1.1.8 src/sys/external/bsd/acpica/dist/compiler/asloptions.c:1.2
--- src/sys/external/bsd/acpica/dist/compiler/asloptions.c:1.1.1.8	Fri Nov 11 14:16:14 2016
+++ src/sys/external/bsd/acpica/dist/compiler/asloptions.c	Sun Dec 18 11:34:19 2016
@@ -70,8 +70,13 @@ AslDoResponseFile (
 #define ASL_TOKEN_SEPARATORS" \t\n"
 #define ASL_SUPPORTED_OPTIONS   "@:a:b|c|d^D:e:f^gh^i|I:l^m:no|p:P^r:s|t|T+G^v^w|x:z"
 
+#ifdef ACPI_REPRO
+static char ASL_BUILD_DATE[] = "Jan 1, 1970";
+static char ASL_BUILD_TIME[] = "00:00:00";
+#else
 static char ASL_BUILD_DATE[] = __DATE__;
 static char ASL_BUILD_TIME[] = __TIME__;
+#endif
 
 
 /***



CVS commit: src/sys/dev/scsipi

2016-12-18 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Dec 18 15:32:36 UTC 2016

Modified Files:
src/sys/dev/scsipi: scsipi_base.c

Log Message:
KNF

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.173 -r1.174 src/sys/dev/scsipi/scsipi_base.c

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

Modified files:

Index: src/sys/dev/scsipi/scsipi_base.c
diff -u src/sys/dev/scsipi/scsipi_base.c:1.173 src/sys/dev/scsipi/scsipi_base.c:1.174
--- src/sys/dev/scsipi/scsipi_base.c:1.173	Sun Dec 18 15:27:34 2016
+++ src/sys/dev/scsipi/scsipi_base.c	Sun Dec 18 15:32:36 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: scsipi_base.c,v 1.173 2016/12/18 15:27:34 skrll Exp $	*/
+/*	$NetBSD: scsipi_base.c,v 1.174 2016/12/18 15:32:36 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2002, 2003, 2004 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: scsipi_base.c,v 1.173 2016/12/18 15:27:34 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scsipi_base.c,v 1.174 2016/12/18 15:32:36 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_scsi.h"
@@ -145,7 +145,7 @@ scsipi_channel_init(struct scsipi_channe
 		panic("scsipi_channel_init");
 	}
 
-	return (0);
+	return 0;
 }
 
 /*
@@ -180,7 +180,7 @@ scsipi_chan_periph_hash(uint64_t t, uint
 	hash = hash32_buf(&t, sizeof(t), HASH32_BUF_INIT);
 	hash = hash32_buf(&l, sizeof(l), hash);
 
-	return (hash & SCSIPI_CHAN_PERIPH_HASHMASK);
+	return hash & SCSIPI_CHAN_PERIPH_HASHMASK;
 }
 
 /*
@@ -227,7 +227,7 @@ scsipi_lookup_periph_internal(struct scs
 
 	if (target >= chan->chan_ntargets ||
 	lun >= chan->chan_nluns)
-		return (NULL);
+		return NULL;
 
 	hash = scsipi_chan_periph_hash(target, lun);
 
@@ -241,7 +241,7 @@ scsipi_lookup_periph_internal(struct scs
 	if (lock)
 		mutex_exit(chan_mtx(chan));
 
-	return (periph);
+	return periph;
 }
 
 struct scsipi_periph *
@@ -271,16 +271,16 @@ scsipi_get_resource(struct scsipi_channe
 	if (chan->chan_flags & SCSIPI_CHAN_OPENINGS) {
 		if (chan->chan_openings > 0) {
 			chan->chan_openings--;
-			return (1);
+			return 1;
 		}
-		return (0);
+		return 0;
 	}
 
 	if (adapt->adapt_openings > 0) {
 		adapt->adapt_openings--;
-		return (1);
+		return 1;
 	}
-	return (0);
+	return 0;
 }
 
 /*
@@ -301,7 +301,7 @@ scsipi_grow_resources(struct scsipi_chan
 			scsipi_adapter_request(chan,
 			ADAPTER_REQ_GROW_RESOURCES, NULL);
 			mutex_enter(chan_mtx(chan));
-			return (scsipi_get_resource(chan));
+			return scsipi_get_resource(chan);
 		}
 		/*
 		 * ask the channel thread to do it. It'll have to thaw the
@@ -310,10 +310,10 @@ scsipi_grow_resources(struct scsipi_chan
 		scsipi_channel_freeze_locked(chan, 1);
 		chan->chan_tflags |= SCSIPI_CHANT_GROWRES;
 		cv_broadcast(chan_cv_complete(chan));
-		return (0);
+		return 0;
 	}
 
-	return (0);
+	return 0;
 }
 
 /*
@@ -471,7 +471,7 @@ scsipi_get_xs(struct scsipi_periph *peri
  wait_for_opening:
 		if (flags & XS_CTL_NOSLEEP) {
 			KASSERT(!lock);
-			return (NULL);
+			return NULL;
 		}
 		KASSERT(lock);
 		SC_DEBUG(periph, SCSIPI_DB3, ("sleeping\n"));
@@ -514,7 +514,7 @@ scsipi_get_xs(struct scsipi_periph *peri
 		if ((flags & XS_CTL_NOSLEEP) == 0)
 			mutex_exit(chan_mtx(periph->periph_channel));
 	}
-	return (xs);
+	return xs;
 }
 
 /*
@@ -889,7 +889,7 @@ scsipi_interpret_sense(struct scsipi_xfe
 		("calling private err_handler()\n"));
 		error = (*periph->periph_switch->psw_error)(xs);
 		if (error != EJUSTRETURN)
-			return (error);
+			return error;
 	}
 	/* otherwise use the default */
 	switch (SSD_RCODE(sense->response_code)) {
@@ -899,21 +899,21 @@ scsipi_interpret_sense(struct scsipi_xfe
 		 * codes other than 70.
 		 */
 	case 0x00:		/* no error (command completed OK) */
-		return (0);
+		return 0;
 	case 0x04:		/* drive not ready after it was selected */
 		if ((periph->periph_flags & PERIPH_REMOVABLE) != 0)
 			periph->periph_flags &= ~PERIPH_MEDIA_LOADED;
 		if ((xs->xs_control & XS_CTL_IGNORE_NOT_READY) != 0)
-			return (0);
+			return 0;
 		/* XXX - display some sort of error here? */
-		return (EIO);
+		return EIO;
 	case 0x20:		/* invalid command */
 		if ((xs->xs_control &
 		 XS_CTL_IGNORE_ILLEGAL_REQUEST) != 0)
-			return (0);
-		return (EINVAL);
+			return 0;
+		return EINVAL;
 	case 0x25:		/* invalid LUN (Adaptec ACB-4000) */
-		return (EACCES);
+		return EACCES;
 
 		/*
 		 * If it's code 70, use the extended stuff and
@@ -947,20 +947,20 @@ scsipi_interpret_sense(struct scsipi_xfe
 			if ((periph->periph_flags & PERIPH_REMOVABLE) != 0)
 periph->periph_flags &= ~PERIPH_MEDIA_LOADED;
 			if ((xs->xs_control & XS_CTL_IGNORE_NOT_READY) != 0)
-return (0);
+return 0;
 			if (sense->asc == 0x3A) {
 error = ENODEV; /* Medium not present */
 if (xs->xs_control & XS_CTL_SILENT_NODEV)
-	return (error);
+	return error;
 			} else
 error = EIO;
 			if ((xs->xs_control & XS_CTL_SILENT) != 0)
-return (error);
+

CVS commit: src/sys/dev/scsipi

2016-12-18 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Dec 18 15:27:34 UTC 2016

Modified Files:
src/sys/dev/scsipi: scsipi_base.c

Log Message:
Whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.172 -r1.173 src/sys/dev/scsipi/scsipi_base.c

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

Modified files:

Index: src/sys/dev/scsipi/scsipi_base.c
diff -u src/sys/dev/scsipi/scsipi_base.c:1.172 src/sys/dev/scsipi/scsipi_base.c:1.173
--- src/sys/dev/scsipi/scsipi_base.c:1.172	Sun Dec 18 15:18:40 2016
+++ src/sys/dev/scsipi/scsipi_base.c	Sun Dec 18 15:27:34 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: scsipi_base.c,v 1.172 2016/12/18 15:18:40 skrll Exp $	*/
+/*	$NetBSD: scsipi_base.c,v 1.173 2016/12/18 15:27:34 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2002, 2003, 2004 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: scsipi_base.c,v 1.172 2016/12/18 15:18:40 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scsipi_base.c,v 1.173 2016/12/18 15:27:34 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_scsi.h"
@@ -2140,7 +2140,7 @@ scsipi_completion_thread(void *arg)
 	chan->chan_flags |= SCSIPI_CHAN_TACTIVE;
 	for (;;) {
 		xs = TAILQ_FIRST(&chan->chan_complete);
-		if (xs == NULL && chan->chan_tflags  == 0) {
+		if (xs == NULL && chan->chan_tflags == 0) {
 			/* nothing to do; wait */
 			cv_wait(chan_cv_complete(chan), chan_mtx(chan));
 			continue;



CVS commit: src/sys/dev/scsipi

2016-12-18 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Dec 18 15:18:41 UTC 2016

Modified Files:
src/sys/dev/scsipi: scsipi_base.c

Log Message:
mlelstv accidentaly dropped a mutex_enter


To generate a diff of this commit:
cvs rdiff -u -r1.171 -r1.172 src/sys/dev/scsipi/scsipi_base.c

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

Modified files:

Index: src/sys/dev/scsipi/scsipi_base.c
diff -u src/sys/dev/scsipi/scsipi_base.c:1.171 src/sys/dev/scsipi/scsipi_base.c:1.172
--- src/sys/dev/scsipi/scsipi_base.c:1.171	Sun Dec 18 13:59:14 2016
+++ src/sys/dev/scsipi/scsipi_base.c	Sun Dec 18 15:18:40 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: scsipi_base.c,v 1.171 2016/12/18 13:59:14 mlelstv Exp $	*/
+/*	$NetBSD: scsipi_base.c,v 1.172 2016/12/18 15:18:40 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2002, 2003, 2004 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: scsipi_base.c,v 1.171 2016/12/18 13:59:14 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scsipi_base.c,v 1.172 2016/12/18 15:18:40 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_scsi.h"
@@ -2188,6 +2188,7 @@ scsipi_completion_thread(void *arg)
 			 * for some reason.
 			 */
 			scsipi_run_queue(chan);
+			mutex_enter(chan_mtx(chan));
 		}
 	}
 



CVS commit: src/sys/dev/scsipi

2016-12-18 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Dec 18 13:59:14 UTC 2016

Modified Files:
src/sys/dev/scsipi: scsipi_base.c

Log Message:
The mutex passed to cv_wait must also be held when calling cv_broadcast.
Also optimizing mutex handling in completion thread.

>From nick@.


To generate a diff of this commit:
cvs rdiff -u -r1.170 -r1.171 src/sys/dev/scsipi/scsipi_base.c

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

Modified files:

Index: src/sys/dev/scsipi/scsipi_base.c
diff -u src/sys/dev/scsipi/scsipi_base.c:1.170 src/sys/dev/scsipi/scsipi_base.c:1.171
--- src/sys/dev/scsipi/scsipi_base.c:1.170	Fri Dec 16 15:00:52 2016
+++ src/sys/dev/scsipi/scsipi_base.c	Sun Dec 18 13:59:14 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: scsipi_base.c,v 1.170 2016/12/16 15:00:52 mlelstv Exp $	*/
+/*	$NetBSD: scsipi_base.c,v 1.171 2016/12/18 13:59:14 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2002, 2003, 2004 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: scsipi_base.c,v 1.170 2016/12/16 15:00:52 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scsipi_base.c,v 1.171 2016/12/18 13:59:14 mlelstv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_scsi.h"
@@ -1462,8 +1462,8 @@ scsipi_done(struct scsipi_xfer *xs)
 	 * completion queue, and wake up the completion thread.
 	 */
 	TAILQ_INSERT_TAIL(&chan->chan_complete, xs, channel_q);
-	mutex_exit(chan_mtx(chan));
 	cv_broadcast(chan_cv_complete(chan));
+	mutex_exit(chan_mtx(chan));
 
  out:
 	/*
@@ -2138,21 +2138,17 @@ scsipi_completion_thread(void *arg)
 
 	mutex_enter(chan_mtx(chan));
 	chan->chan_flags |= SCSIPI_CHAN_TACTIVE;
-	mutex_exit(chan_mtx(chan));
 	for (;;) {
-		mutex_enter(chan_mtx(chan));
 		xs = TAILQ_FIRST(&chan->chan_complete);
 		if (xs == NULL && chan->chan_tflags  == 0) {
 			/* nothing to do; wait */
 			cv_wait(chan_cv_complete(chan), chan_mtx(chan));
-			mutex_exit(chan_mtx(chan));
 			continue;
 		}
 		if (chan->chan_tflags & SCSIPI_CHANT_CALLBACK) {
 			/* call chan_callback from thread context */
 			chan->chan_tflags &= ~SCSIPI_CHANT_CALLBACK;
 			chan->chan_callback(chan, chan->chan_callback_arg);
-			mutex_exit(chan_mtx(chan));
 			continue;
 		}
 		if (chan->chan_tflags & SCSIPI_CHANT_GROWRES) {
@@ -2164,6 +2160,7 @@ scsipi_completion_thread(void *arg)
 			scsipi_channel_thaw(chan, 1);
 			if (chan->chan_tflags & SCSIPI_CHANT_GROWRES)
 kpause("scsizzz", FALSE, hz/10, NULL);
+			mutex_enter(chan_mtx(chan));
 			continue;
 		}
 		if (chan->chan_tflags & SCSIPI_CHANT_KICK) {
@@ -2171,10 +2168,10 @@ scsipi_completion_thread(void *arg)
 			chan->chan_tflags &= ~SCSIPI_CHANT_KICK;
 			mutex_exit(chan_mtx(chan));
 			scsipi_run_queue(chan);
+			mutex_enter(chan_mtx(chan));
 			continue;
 		}
 		if (chan->chan_tflags & SCSIPI_CHANT_SHUTDOWN) {
-			mutex_exit(chan_mtx(chan));
 			break;
 		}
 		if (xs) {
@@ -2191,8 +2188,6 @@ scsipi_completion_thread(void *arg)
 			 * for some reason.
 			 */
 			scsipi_run_queue(chan);
-		} else {
-			mutex_exit(chan_mtx(chan));
 		}
 	}
 
@@ -2200,6 +2195,7 @@ scsipi_completion_thread(void *arg)
 
 	/* In case parent is waiting for us to exit. */
 	cv_broadcast(chan_cv_thread(chan));
+	mutex_exit(chan_mtx(chan));
 
 	kthread_exit(0);
 }



CVS commit: src/sys/arch/amiga/stand/bootblock/boot

2016-12-18 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Dec 18 12:02:37 UTC 2016

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: console.c

Log Message:
check for serial console flag also when re-using console from
primary bootstrap.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/amiga/stand/bootblock/boot/console.c

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

Modified files:

Index: src/sys/arch/amiga/stand/bootblock/boot/console.c
diff -u src/sys/arch/amiga/stand/bootblock/boot/console.c:1.14 src/sys/arch/amiga/stand/bootblock/boot/console.c:1.15
--- src/sys/arch/amiga/stand/bootblock/boot/console.c:1.14	Fri Jan 15 08:27:04 2016
+++ src/sys/arch/amiga/stand/bootblock/boot/console.c	Sun Dec 18 12:02:37 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: console.c,v 1.14 2016/01/15 08:27:04 mlelstv Exp $ */
+/* $NetBSD: console.c,v 1.15 2016/12/18 12:02:37 mlelstv Exp $ */
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -110,8 +110,8 @@ consinit(void *consptr) {
 
 	if (consptr != NULL) {
 		/* Check magic? */
-		ConsoleBase = consptr;		/* Use existing console */
-		return (0);
+		mc = consptr;		/* Use existing console */
+		goto done;
 	}
 
 	mc = &myConsole;
@@ -148,6 +148,8 @@ consinit(void *consptr) {
 	if (OpenDevice("timer.device", 0, (struct AmigaIO*)mc->tmior, 0))
 		goto err;
 
+done:
+
 #ifdef SERCONSOLE
 	conspreinit();
 	if (use_serconsole)



CVS commit: [netbsd-7-0] src/doc

2016-12-18 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Dec 18 08:48:09 UTC 2016

Modified Files:
src/doc [netbsd-7-0]: CHANGES-7.0.3

Log Message:
1316, 1333


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.13 -r1.1.2.14 src/doc/CHANGES-7.0.3

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

Modified files:

Index: src/doc/CHANGES-7.0.3
diff -u src/doc/CHANGES-7.0.3:1.1.2.13 src/doc/CHANGES-7.0.3:1.1.2.14
--- src/doc/CHANGES-7.0.3:1.1.2.13	Wed Dec 14 08:22:33 2016
+++ src/doc/CHANGES-7.0.3	Sun Dec 18 08:48:09 2016
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.0.3,v 1.1.2.13 2016/12/14 08:22:33 snj Exp $
+# $NetBSD: CHANGES-7.0.3,v 1.1.2.14 2016/12/18 08:48:09 snj Exp $
 
 A complete list of changes from the NetBSD 7.0.2 release to the NetBSD 7.0.3
 release:
@@ -203,3 +203,16 @@ external/public-domain/tz/tzdata2netbsd 
 	Update tzdata to 2016j.
 	[kre, ticket #1324]
 
+sys/arch/x86/include/pmap.h			1.61
+sys/arch/x86/x86/pmap.c1.223
+sys/arch/x86/x86/vm_machdep.c			1.26
+
+	PR/49691: KAMADA Ken'ichi: free deferred ptp mappings if present.
+	[riastradh, ticket #1316]
+
+sbin/ping/ping.c1.113
+
+	PR bin/36997 Zafer Aydogan: ping doesn't validate numeric inputs
+	enough.
+	[dholland, ticket #1333]
+



CVS commit: [netbsd-7-0] src/sbin/ping

2016-12-18 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Dec 18 08:40:54 UTC 2016

Modified Files:
src/sbin/ping [netbsd-7-0]: ping.c

Log Message:
Pull up following revision(s) (requested by dholland in ticket #1333):
sbin/ping/ping.c: revision 1.113
PR bin/36997 Zafer Aydogan: ping doesn't validate numeric inputs enough.
Check for values between INT_MAX and LONG_MAX (if they're different)
when using strtol to get an int. This applies to the -c and -l options;
the other uses were already checked.
Also limit the inter-packet interval given with -i to values that
don't cause integer overflow calling poll() with milliseconds.
Really large intervals (the number is read as floating point) can
produce positive poll() values but negative integers when converted to
struct timespec; this produces behavior akin to using -l at first and
could be construed as a local DoS vulnerability.


To generate a diff of this commit:
cvs rdiff -u -r1.107.4.1 -r1.107.4.1.2.1 src/sbin/ping/ping.c

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

Modified files:

Index: src/sbin/ping/ping.c
diff -u src/sbin/ping/ping.c:1.107.4.1 src/sbin/ping/ping.c:1.107.4.1.2.1
--- src/sbin/ping/ping.c:1.107.4.1	Tue Apr 14 05:26:20 2015
+++ src/sbin/ping/ping.c	Sun Dec 18 08:40:54 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: ping.c,v 1.107.4.1 2015/04/14 05:26:20 snj Exp $	*/
+/*	$NetBSD: ping.c,v 1.107.4.1.2.1 2016/12/18 08:40:54 snj Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -58,7 +58,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: ping.c,v 1.107.4.1 2015/04/14 05:26:20 snj Exp $");
+__RCSID("$NetBSD: ping.c,v 1.107.4.1.2.1 2016/12/18 08:40:54 snj Exp $");
 #endif
 
 #include 
@@ -291,11 +291,17 @@ main(int argc, char *argv[])
 			compat = 1;
 			break;
 		case 'c':
-			npackets = strtol(optarg, &p, 0);
-			if (*p != '\0' || npackets <= 0)
+			l = strtol(optarg, &p, 0);
+			if (*p != '\0' || l <= 0)
 errx(EXIT_FAILURE,
 "Bad/invalid number of packets: %s",
 optarg);
+#if INT_MAX < LONG_MAX
+			if (l > INT_MAX)
+errx(EXIT_FAILURE,
+"Too many packets to count: %ld", l);
+#endif
+			npackets = l;
 			break;
 		case 'D':
 			pingflags |= F_DF;
@@ -314,12 +320,27 @@ main(int argc, char *argv[])
 			if (*p != '\0' || interval <= 0)
 errx(EXIT_FAILURE, "Bad/invalid interval: %s",
 optarg);
+			/*
+			 * In order to avoid overflowing the microseconds
+			 * argument of poll() the interval must be less than
+			 * INT_MAX/1000. Limit it to one second less than
+			 * that to be safe.
+			 */
+			if (interval >= INT_MAX/1000.0 - 1.0)
+errx(EXIT_FAILURE,
+"Timing interval %g too large", interval);
 			break;
 		case 'l':
-			preload = strtol(optarg, &p, 0);
-			if (*p != '\0' || preload < 0)
+			l = strtol(optarg, &p, 0);
+			if (*p != '\0' || l < 0)
 errx(EXIT_FAILURE, "Bad/invalid preload value: "
 "%s", optarg);
+#if INT_MAX < LONG_MAX
+			if (l > INT_MAX)
+errx(EXIT_FAILURE,
+"Too many preload packets: %ld", l);
+#endif
+			preload = l;
 			break;
 		case 'n':
 			pingflags |= F_NUMERIC;



CVS commit: [netbsd-7] src/doc

2016-12-18 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Dec 18 08:27:59 UTC 2016

Modified Files:
src/doc [netbsd-7]: CHANGES-7.1

Log Message:
tickets 1310-1317, 1319, 1325-1327, 1330-1333.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.134 -r1.1.2.135 src/doc/CHANGES-7.1

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

Modified files:

Index: src/doc/CHANGES-7.1
diff -u src/doc/CHANGES-7.1:1.1.2.134 src/doc/CHANGES-7.1:1.1.2.135
--- src/doc/CHANGES-7.1:1.1.2.134	Wed Dec 14 19:33:33 2016
+++ src/doc/CHANGES-7.1	Sun Dec 18 08:27:59 2016
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.1,v 1.1.2.134 2016/12/14 19:33:33 snj Exp $
+# $NetBSD: CHANGES-7.1,v 1.1.2.135 2016/12/18 08:27:59 snj Exp $
 
 A complete list of changes from the NetBSD 7.0 release to the NetBSD 7.1
 release:
@@ -7596,3 +7596,126 @@ sys/dev/usb/uchcom.c1.17
 	- Match USB_PRODUCT_WINCHIPHEAD2_CH341_2.
 	[bouyer, ticket #1321]
 
+common/lib/libc/stdlib/_strtoul.h		1.10
+
+	Set *endptr in all paths out of strtoul and family.
+	[riastradh, ticket #1310]
+
+lib/libc/stdlib/strtod.3			1.21-1.29
+lib/libc/stdlib/strtol.3			1.36-1.38
+lib/libc/stdlib/strtoul.3			1.36
+
+	Documentation improvements.
+	[riastradh, ticket #1311]
+
+external/bsd/nvi/Makefile.inc			1.2-1.4
+external/bsd/nvi/dist/cl/cl.h			1.3
+external/bsd/nvi/dist/cl/cl_main.c		1.5
+external/bsd/nvi/dist/cl/cl_screen.c		1.5
+external/bsd/nvi/dist/cl/cl_term.c		1.5
+external/bsd/nvi/dist/common/key.h		1.3
+external/bsd/nvi/dist/common/vi_db1.c		1.8
+external/bsd/nvi/dist/docs/vi.man/vi.1		1.3, 1.4
+external/bsd/nvi/dist/ex/ex_map.c		1.4
+external/bsd/nvi/dist/ex/ex_script.c		1.5, 1.6
+external/bsd/nvi/usr.bin/nvi/Makefile		1.7
+
+	nvi:
+	- Fix memory leaks in vi when resizing. PR/50092
+	- Fix the script command of vi(1). PR/50484
+	- Fix > 1024 char lines in script.
+	- Fix synopsis for :tagprev.  PR 51446.
+	[riastradh, ticket #1312]
+
+usr.sbin/paxctl/paxctl.8			1.15
+
+	Documentation fixes.
+	[riastradh, ticket #1313]
+
+share/man/man9/fileassoc.9			1.28
+
+	Documentation fixes.
+	[riastradh, ticket #1314]
+
+share/man/man3/bits.31.17
+
+	Remove bogus BUGS content.
+	[riastradh, ticket #1315]
+
+sys/arch/x86/include/pmap.h			1.61
+sys/arch/x86/x86/pmap.c1.223
+sys/arch/x86/x86/vm_machdep.c			1.26
+
+	PR/49691: KAMADA Ken'ichi: free deferred ptp mappings if present.
+	[riastradh, ticket #1316]
+
+share/misc/bsd-family-tree			1.57, 1.58
+
+	Add various entries.
+	[nakayama, ticket #1317]
+
+sys/modules/npf/Makefile			1.19
+sys/net/npf/files.npf1.18
+sys/net/npf/lpm.c1.1
+sys/net/npf/lpm.h1.1
+sys/net/npf/npf_impl.h1.62
+sys/net/npf/npf_tableset.c			1.24
+sys/net/npf/npf_tableset_ptree.c		delete
+sys/rump/net/lib/libnpf/Makefile		1.18
+
+	Ditches the ptree(3) library, because it is broken (you
+	can get missing entries!).  Instead, as a temporary solution,
+	we switch to a simple linear scan of the hash tables for the
+	longest-prefix-match (lpm.c lpm.h) algorithm.
+	[rmind, ticket #1319]
+
+usr.bin/calendar/calendars/calendar.birthday	1.26
+usr.bin/calendar/calendars/calendar.christian	1.6
+usr.bin/calendar/calendars/calendar.history	1.33, 1.34
+usr.bin/calendar/calendars/calendar.holiday	1.26, 1.27
+usr.bin/calendar/calendars/calendar.judaic	1.6
+usr.bin/calendar/calendars/calendar.netbsd	1.36, 1.37
+usr.bin/calendar/calendars/calendar.usholiday	1.7
+
+	Various updates and fixes for calendar entries.
+	[jnemeth, ticket #1325]
+
+sys/arch/xen/conf/files.xen			1.141
+
+	make CPU microcode loading dependent on both DOM0OPS AND
+	CPU_UCODE
+	[jnemeth, ticket #1326]
+
+sys/dev/pci/if_wm.c1.457
+sys/dev/pci/if_wmreg.h1.94
+
+	wm(4):
+	- Change to use 2500Base-KX correctly on C2000(I354). It worked,
+	  but the output of ifconfig and if_baudrate was not good.
+	- Check SERDES's speed directly from the PCS layer (PCS_LSTS
+	  register) for old devices.
+	- Style fix.
+	[msaitoh, ticket #1327]
+
+external/bsd/blacklist/bin/blacklistctl.c	1.21
+
+	Correct misplaced break.
+	[jnemeth, ticket #1330]
+
+usr.bin/ftp/fetch.c1.226
+
+	Handle proxy authentication correctly.
+	[nonaka, ticket #1331]
+
+tools/Makefile.nbincludes			1.4
+
+	Add endian_machdep.h files for sh3 machines to _ARCH_INCS as
+	sh3/include/elf_machdep.h needs it since r1.11.  Unbreaks tools
+	build on non-netbsd hosts.
+	[uwe, ticket #1332]
+
+sbin/ping/ping.c1.113
+
+	PR bin/36997: ping doesn't validate numeric inputs enough.
+	[dholland, ticket #1333]
+



CVS commit: [netbsd-7] src/sbin/ping

2016-12-18 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Dec 18 08:22:29 UTC 2016

Modified Files:
src/sbin/ping [netbsd-7]: ping.c

Log Message:
Pull up following revision(s) (requested by dholland in ticket #1333):
sbin/ping/ping.c: revision 1.113
PR bin/36997 Zafer Aydogan: ping doesn't validate numeric inputs enough.
Check for values between INT_MAX and LONG_MAX (if they're different)
when using strtol to get an int. This applies to the -c and -l options;
the other uses were already checked.
Also limit the inter-packet interval given with -i to values that
don't cause integer overflow calling poll() with milliseconds.
Really large intervals (the number is read as floating point) can
produce positive poll() values but negative integers when converted to
struct timespec; this produces behavior akin to using -l at first and
could be construed as a local DoS vulnerability.


To generate a diff of this commit:
cvs rdiff -u -r1.107.4.1 -r1.107.4.2 src/sbin/ping/ping.c

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

Modified files:

Index: src/sbin/ping/ping.c
diff -u src/sbin/ping/ping.c:1.107.4.1 src/sbin/ping/ping.c:1.107.4.2
--- src/sbin/ping/ping.c:1.107.4.1	Tue Apr 14 05:26:20 2015
+++ src/sbin/ping/ping.c	Sun Dec 18 08:22:28 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: ping.c,v 1.107.4.1 2015/04/14 05:26:20 snj Exp $	*/
+/*	$NetBSD: ping.c,v 1.107.4.2 2016/12/18 08:22:28 snj Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -58,7 +58,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: ping.c,v 1.107.4.1 2015/04/14 05:26:20 snj Exp $");
+__RCSID("$NetBSD: ping.c,v 1.107.4.2 2016/12/18 08:22:28 snj Exp $");
 #endif
 
 #include 
@@ -291,11 +291,17 @@ main(int argc, char *argv[])
 			compat = 1;
 			break;
 		case 'c':
-			npackets = strtol(optarg, &p, 0);
-			if (*p != '\0' || npackets <= 0)
+			l = strtol(optarg, &p, 0);
+			if (*p != '\0' || l <= 0)
 errx(EXIT_FAILURE,
 "Bad/invalid number of packets: %s",
 optarg);
+#if INT_MAX < LONG_MAX
+			if (l > INT_MAX)
+errx(EXIT_FAILURE,
+"Too many packets to count: %ld", l);
+#endif
+			npackets = l;
 			break;
 		case 'D':
 			pingflags |= F_DF;
@@ -314,12 +320,27 @@ main(int argc, char *argv[])
 			if (*p != '\0' || interval <= 0)
 errx(EXIT_FAILURE, "Bad/invalid interval: %s",
 optarg);
+			/*
+			 * In order to avoid overflowing the microseconds
+			 * argument of poll() the interval must be less than
+			 * INT_MAX/1000. Limit it to one second less than
+			 * that to be safe.
+			 */
+			if (interval >= INT_MAX/1000.0 - 1.0)
+errx(EXIT_FAILURE,
+"Timing interval %g too large", interval);
 			break;
 		case 'l':
-			preload = strtol(optarg, &p, 0);
-			if (*p != '\0' || preload < 0)
+			l = strtol(optarg, &p, 0);
+			if (*p != '\0' || l < 0)
 errx(EXIT_FAILURE, "Bad/invalid preload value: "
 "%s", optarg);
+#if INT_MAX < LONG_MAX
+			if (l > INT_MAX)
+errx(EXIT_FAILURE,
+"Too many preload packets: %ld", l);
+#endif
+			preload = l;
 			break;
 		case 'n':
 			pingflags |= F_NUMERIC;



CVS commit: [netbsd-7] src/tools

2016-12-18 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Dec 18 08:05:52 UTC 2016

Modified Files:
src/tools [netbsd-7]: Makefile.nbincludes

Log Message:
Pull up following revision(s) (requested by uwe in ticket #1332):
tools/Makefile.nbincludes: revision 1.4
Add endian_machdep.h files for sh3 machines to _ARCH_INCS as
sh3/include/elf_machdep.h needs it since r1.11.
Unbreaks tools build on non-netbsd hosts (and whatever problems on
netbsd hosts of different endianness that might have been caused by
the mismatch).


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.3.10.1 src/tools/Makefile.nbincludes

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

Modified files:

Index: src/tools/Makefile.nbincludes
diff -u src/tools/Makefile.nbincludes:1.3 src/tools/Makefile.nbincludes:1.3.10.1
--- src/tools/Makefile.nbincludes:1.3	Sun Aug  5 06:20:14 2012
+++ src/tools/Makefile.nbincludes	Sun Dec 18 08:05:52 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.nbincludes,v 1.3 2012/08/05 06:20:14 christos Exp $
+#	$NetBSD: Makefile.nbincludes,v 1.3.10.1 2016/12/18 08:05:52 snj Exp $
 
 # NOxxx definitions are copied from Makefile.host, and are
 # required before .include .   The include of bsd.own.mk
@@ -26,6 +26,11 @@ _ARCH_INCS!=	${TOOL_SED} -e 's/^\#.*//' 
 
 _ARCH_INCS+=	ews4800mips/include/pdinfo.h ews4800mips/include/vtoc.h
 
+# for sh3/include/elf_machdep.h
+.for sh3mach in dreamcast evbsh3 hpcsh landisk mmeye sh3
+_ARCH_INCS+=	${sh3mach}/include/endian_machdep.h
+.endfor
+
 _INCS=		disktab.h
 _SYSINCS=	bootblock.h \
 		disklabel.h disklabel_acorn.h disklabel_gpt.h disklabel_rdb.h \



CVS commit: [netbsd-7] src/usr.bin/ftp

2016-12-18 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Dec 18 08:03:09 UTC 2016

Modified Files:
src/usr.bin/ftp [netbsd-7]: fetch.c

Log Message:
Pull up following revision(s) (requested by nonaka in ticket #1331):
usr.bin/ftp/fetch.c: revision 1.226
handle proxy authentication correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.205.4.5 -r1.205.4.6 src/usr.bin/ftp/fetch.c

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

Modified files:

Index: src/usr.bin/ftp/fetch.c
diff -u src/usr.bin/ftp/fetch.c:1.205.4.5 src/usr.bin/ftp/fetch.c:1.205.4.6
--- src/usr.bin/ftp/fetch.c:1.205.4.5	Tue Nov  1 19:30:44 2016
+++ src/usr.bin/ftp/fetch.c	Sun Dec 18 08:03:09 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: fetch.c,v 1.205.4.5 2016/11/01 19:30:44 snj Exp $	*/
+/*	$NetBSD: fetch.c,v 1.205.4.6 2016/12/18 08:03:09 snj Exp $	*/
 
 /*-
  * Copyright (c) 1997-2015 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: fetch.c,v 1.205.4.5 2016/11/01 19:30:44 snj Exp $");
+__RCSID("$NetBSD: fetch.c,v 1.205.4.6 2016/12/18 08:03:09 snj Exp $");
 #endif /* not lint */
 
 /*
@@ -855,8 +855,7 @@ print_connect(FETCH *fin, const struct u
 #define C_OK 0
 #define C_CLEANUP 1
 #define C_IMPROPER 2
-#define C_PROXY 3
-#define C_NOPROXY 4
+#define C_RESTART 3
 
 static int
 getresponseline(FETCH *fin, char *buf, size_t buflen, int *len)
@@ -1086,7 +1085,7 @@ negotiate_connection(FETCH *fin, const c
 	case 401:
 	case 407:
 	{
-		struct  authinfo aauth;
+		struct authinfo aauth;
 		char **authp;
 
 		if (hcode == 401)
@@ -1121,7 +1120,8 @@ negotiate_connection(FETCH *fin, const c
 		authp = &aauth.auth;
 		if (auth_url(*auth, authp, &aauth) == 0) {
 			*rval = fetch_url(url, penv,
-			pauth->auth, wauth->auth);
+			hcode == 401 ? pauth->auth : aauth.auth,
+			hcode == 401 ? aauth.auth : wauth->auth);
 			memset(*authp, 0, strlen(*authp));
 			FREEPTR(*authp);
 		}
@@ -1216,6 +1216,34 @@ connectmethod(int s, FETCH *fin, struct 
 	switch (hcode) {
 	case 200:
 		break;
+#ifndef NO_AUTH
+	case 407:
+		if (verbose || pauth->auth == NULL ||
+		pauth->user == NULL || pauth->pass == NULL)
+			fprintf(ttyout, "%s\n", message);
+		if (EMPTYSTRING(*auth)) {
+			warnx("No authentication challenge provided by server");
+			goto cleanup_fetch_url;
+		}
+
+		if (pauth->auth != NULL) {
+			char reply[10];
+
+			fprintf(ttyout, "Authorization failed. Retry (y/n)? ");
+			if (get_line(stdin, reply, sizeof(reply), NULL)
+			< 0) {
+goto cleanup_fetch_url;
+			}
+			if (tolower((unsigned char)reply[0]) != 'y')
+goto cleanup_fetch_url;
+			pauth->user = NULL;
+			pauth->pass = NULL;
+		}
+
+		if (auth_url(*auth, &pauth->auth, pauth) == 0)
+			goto restart_fetch_url;
+		goto cleanup_fetch_url;
+#endif
 	default:
 		if (message)
 			warnx("Error proxy connect " "`%s'", message);
@@ -1236,6 +1264,9 @@ improper:
 cleanup_fetch_url:
 	rv = C_CLEANUP;
 	goto out;
+restart_fetch_url:
+	rv = C_RESTART;
+	goto out;
 out:
 	FREEPTR(message);
 	return rv;
@@ -1444,6 +1475,10 @@ fetch_url(const char *url, const char *p
 		if (isproxy && oui.utype == HTTPS_URL_T) {
 			switch (connectmethod(s, fin, &oui, &ui, &pauth, &auth,
 			&hasleading)) {
+			case C_RESTART:
+rval = fetch_url(url, penv, pauth.auth,
+wauth.auth);
+/*FALLTHROUGH*/
 			case C_CLEANUP:
 goto cleanup_fetch_url;
 			case C_IMPROPER: