CVS commit: src/sys

2018-01-25 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Jan 26 07:49:15 UTC 2018

Modified Files:
src/sys/net: if_l2tp.c
src/sys/netinet: in_l2tp.c
src/sys/netinet6: in6_l2tp.c

Log Message:
Several fixes in L2TP:

 * l2tp_input(): use m_copydata, and ensure there is enough space in the
   chain. Otherwise overflow.

 * l2tp_tcpmss_clamp(): ensure there is enough space in the chain.

 * in_l2tp_output(): don't check 'sc' against NULL, it can't be NULL.

 * in_l2tp_input(): no need to call m_pullup since we use m_copydata.
   Just check the space in the chain.

 * in_l2tp_input(): if there is a cookie, make sure the chain has enough
   space.

 * in6_l2tp_input(): same changes as in_l2tp_input().

Ok knakahara@


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/net/if_l2tp.c
cvs rdiff -u -r1.11 -r1.12 src/sys/netinet/in_l2tp.c
cvs rdiff -u -r1.13 -r1.14 src/sys/netinet6/in6_l2tp.c

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



CVS commit: src/sys

2018-01-25 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Jan 26 07:49:15 UTC 2018

Modified Files:
src/sys/net: if_l2tp.c
src/sys/netinet: in_l2tp.c
src/sys/netinet6: in6_l2tp.c

Log Message:
Several fixes in L2TP:

 * l2tp_input(): use m_copydata, and ensure there is enough space in the
   chain. Otherwise overflow.

 * l2tp_tcpmss_clamp(): ensure there is enough space in the chain.

 * in_l2tp_output(): don't check 'sc' against NULL, it can't be NULL.

 * in_l2tp_input(): no need to call m_pullup since we use m_copydata.
   Just check the space in the chain.

 * in_l2tp_input(): if there is a cookie, make sure the chain has enough
   space.

 * in6_l2tp_input(): same changes as in_l2tp_input().

Ok knakahara@


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/net/if_l2tp.c
cvs rdiff -u -r1.11 -r1.12 src/sys/netinet/in_l2tp.c
cvs rdiff -u -r1.13 -r1.14 src/sys/netinet6/in6_l2tp.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/net/if_l2tp.c
diff -u src/sys/net/if_l2tp.c:1.18 src/sys/net/if_l2tp.c:1.19
--- src/sys/net/if_l2tp.c:1.18	Thu Jan 25 10:33:37 2018
+++ src/sys/net/if_l2tp.c	Fri Jan 26 07:49:15 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_l2tp.c,v 1.18 2018/01/25 10:33:37 maxv Exp $	*/
+/*	$NetBSD: if_l2tp.c,v 1.19 2018/01/26 07:49:15 maxv Exp $	*/
 
 /*
  * Copyright (c) 2017 Internet Initiative Japan Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_l2tp.c,v 1.18 2018/01/25 10:33:37 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_l2tp.c,v 1.19 2018/01/26 07:49:15 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -465,10 +465,18 @@ l2tpintr(struct l2tp_variant *var)
 void
 l2tp_input(struct mbuf *m, struct ifnet *ifp)
 {
+	u_long val;
 
 	KASSERT(ifp != NULL);
 
-	if (0 == (mtod(m, u_long) & 0x03)) {
+	if (m->m_pkthdr.len < sizeof(val)) {
+		m_freem(m);
+		return;
+	}
+
+	m_copydata(m, 0, sizeof(val), );
+
+	if ((val & 0x03) == 0) {
 		/* copy and align head of payload */
 		struct mbuf *m_head;
 		int copy_length;
@@ -1375,6 +1383,11 @@ l2tp_tcpmss_clamp(struct ifnet *ifp, str
 		return m;
 	}
 
+	if (m->m_pkthdr.len < sizeof(evh)) {
+		m_freem(m);
+		return NULL;
+	}
+
 	/* save ether header */
 	m_copydata(m, 0, sizeof(evh), (void *));
 	eh = (struct ether_header *)

Index: src/sys/netinet/in_l2tp.c
diff -u src/sys/netinet/in_l2tp.c:1.11 src/sys/netinet/in_l2tp.c:1.12
--- src/sys/netinet/in_l2tp.c:1.11	Thu Jan 25 10:45:58 2018
+++ src/sys/netinet/in_l2tp.c	Fri Jan 26 07:49:15 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: in_l2tp.c,v 1.11 2018/01/25 10:45:58 maxv Exp $	*/
+/*	$NetBSD: in_l2tp.c,v 1.12 2018/01/26 07:49:15 maxv Exp $	*/
 
 /*
  * Copyright (c) 2017 Internet Initiative Japan Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: in_l2tp.c,v 1.11 2018/01/25 10:45:58 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in_l2tp.c,v 1.12 2018/01/26 07:49:15 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_l2tp.h"
@@ -103,9 +103,6 @@ in_l2tp_output(struct l2tp_variant *var,
 	&& sin_dst->sin_family == AF_INET);
 
 	sc = var->lv_softc;
-	if (sc == NULL)
-		return ENETUNREACH;
-
 	ifp = >l2tp_ec.ec_if;
 	error = l2tp_check_nesting(ifp, m);
 	if (error) {
@@ -262,13 +259,12 @@ in_l2tp_input(struct mbuf *m, int off, i
 	struct psref psref;
 	struct l2tp_variant *var;
 
-	if (m->m_len < off + sizeof(uint32_t)) {
-		m = m_pullup(m, off + sizeof(uint32_t));
-		if (!m) {
-			/* if payload length < 4 octets */
-			return;
-		}
-}
+	KASSERT((m->m_flags & M_PKTHDR) != 0);
+
+	if (m->m_pkthdr.len < off + sizeof(uint32_t)) {
+		m_freem(m);
+		return;
+	}
 
 	/* get L2TP session ID */
 	m_copydata(m, off, sizeof(uint32_t), (void *)_id);
@@ -322,6 +318,10 @@ in_l2tp_input(struct mbuf *m, int off, i
 	m_adj(m, off + sizeof(uint32_t));
 
 	if (var->lv_use_cookie == L2TP_COOKIE_ON) {
+		if (m->m_pkthdr.len < var->lv_my_cookie_len) {
+			m_freem(m);
+			goto out;
+		}
 		if (var->lv_my_cookie_len == 4) {
 			m_copydata(m, 0, sizeof(uint32_t), (void *)_32);
 			NTOHL(cookie_32);

Index: src/sys/netinet6/in6_l2tp.c
diff -u src/sys/netinet6/in6_l2tp.c:1.13 src/sys/netinet6/in6_l2tp.c:1.14
--- src/sys/netinet6/in6_l2tp.c:1.13	Thu Jan 25 10:45:58 2018
+++ src/sys/netinet6/in6_l2tp.c	Fri Jan 26 07:49:15 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: in6_l2tp.c,v 1.13 2018/01/25 10:45:58 maxv Exp $	*/
+/*	$NetBSD: in6_l2tp.c,v 1.14 2018/01/26 07:49:15 maxv Exp $	*/
 
 /*
  * Copyright (c) 2017 Internet Initiative Japan Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: in6_l2tp.c,v 1.13 2018/01/25 10:45:58 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6_l2tp.c,v 1.14 2018/01/26 07:49:15 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_l2tp.h"
@@ -253,14 +253,12 @@ in6_l2tp_input(struct mbuf **mp, int *of
 	uint64_t cookie_64;
 	struct psref psref;
 
-	if (m->m_len < off + sizeof(uint32_t)) {
-		m = m_pullup(m, off + 

CVS commit: src/sys/netinet6

2018-01-25 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Fri Jan 26 06:49:02 UTC 2018

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

Log Message:
Get rid of unnecessary splsoftnet (redo)

Unless NET_MPSAFE, splsoftnet is still needed for rt_* functions.


To generate a diff of this commit:
cvs rdiff -u -r1.137 -r1.138 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.



CVS commit: src/sys/netinet6

2018-01-25 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Fri Jan 26 06:49:02 UTC 2018

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

Log Message:
Get rid of unnecessary splsoftnet (redo)

Unless NET_MPSAFE, splsoftnet is still needed for rt_* functions.


To generate a diff of this commit:
cvs rdiff -u -r1.137 -r1.138 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/nd6_rtr.c
diff -u src/sys/netinet6/nd6_rtr.c:1.137 src/sys/netinet6/nd6_rtr.c:1.138
--- src/sys/netinet6/nd6_rtr.c:1.137	Fri Jan 26 06:37:21 2018
+++ src/sys/netinet6/nd6_rtr.c	Fri Jan 26 06:49:02 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: nd6_rtr.c,v 1.137 2018/01/26 06:37:21 ozaki-r Exp $	*/
+/*	$NetBSD: nd6_rtr.c,v 1.138 2018/01/26 06:49:02 ozaki-r Exp $	*/
 /*	$KAME: nd6_rtr.c,v 1.95 2001/02/07 08:09:47 itojun Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nd6_rtr.c,v 1.137 2018/01/26 06:37:21 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nd6_rtr.c,v 1.138 2018/01/26 06:49:02 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -469,7 +469,9 @@ defrouter_addreq(struct nd_defrouter *ne
 		struct sockaddr_in6 sin6;
 		struct sockaddr sa;
 	} def, mask, gate;
+#ifndef NET_MPSAFE
 	int s;
+#endif
 	int error;
 
 	memset(, 0, sizeof(def));
@@ -484,14 +486,18 @@ defrouter_addreq(struct nd_defrouter *ne
 	gate.sin6.sin6_scope_id = 0;	/* XXX */
 #endif
 
+#ifndef NET_MPSAFE
 	s = splsoftnet();
+#endif
 	error = rtrequest_newmsg(RTM_ADD, , , ,
 	RTF_GATEWAY);
 	if (error == 0) {
 		nd6_numroutes++;
 		newdr->installed = 1;
 	}
+#ifndef NET_MPSAFE
 	splx(s);
+#endif
 	return;
 }
 
@@ -957,7 +963,7 @@ nd6_prelist_add(struct nd_prefixctl *prc
 	struct nd_prefix **newp)
 {
 	struct nd_prefix *newpr = NULL;
-	int i, s;
+	int i;
 	int error;
 	struct in6_ifextra *ext = prc->ndprc_ifp->if_afdata[AF_INET6];
 
@@ -997,10 +1003,8 @@ nd6_prelist_add(struct nd_prefixctl *prc
 		newpr->ndpr_mask.s6_addr32[i];
 	}
 
-	s = splsoftnet();
 	/* link ndpr_entry to nd_prefix list */
 	ND_PREFIX_LIST_INSERT_HEAD(newpr);
-	splx(s);
 
 	/* ND_OPT_PI_FLAG_ONLINK processing */
 	if (newpr->ndpr_raf_onlink) {
@@ -1068,7 +1072,6 @@ void
 nd6_prelist_remove(struct nd_prefix *pr)
 {
 	struct nd_pfxrouter *pfr, *next;
-	int s;
 	struct in6_ifextra *ext = pr->ndpr_ifp->if_afdata[AF_INET6];
 
 	ND6_ASSERT_WLOCK();
@@ -1076,7 +1079,6 @@ nd6_prelist_remove(struct nd_prefix *pr)
 
 	nd6_invalidate_prefix(pr);
 
-	s = splsoftnet();
 	/* unlink ndpr_entry from nd_prefix list */
 	ND_PREFIX_LIST_REMOVE(pr);
 
@@ -1094,7 +1096,6 @@ nd6_prelist_remove(struct nd_prefix *pr)
 			"%s\n", pr->ndpr_ifp->if_xname);
 		}
 	}
-	splx(s);
 
 	free(pr, M_IP6NDP);
 
@@ -2223,16 +2224,21 @@ in6_init_address_ltimes(struct nd_prefix
 void
 nd6_rt_flush(struct in6_addr *gateway, struct ifnet *ifp)
 {
+#ifndef NET_MPSAFE
 	int s = splsoftnet();
+#endif
 
 	/* We'll care only link-local addresses */
-	if (!IN6_IS_ADDR_LINKLOCAL(gateway)) {
-		splx(s);
-		return;
-	}
+	if (!IN6_IS_ADDR_LINKLOCAL(gateway))
+		goto out;
 
 	rt_delete_matched_entries(AF_INET6, rt6_deleteroute_matcher, gateway);
+
+out:
+#ifndef NET_MPSAFE
 	splx(s);
+#endif
+	return; /* XXX gcc */
 }
 
 static int



CVS commit: src/sys/netinet6

2018-01-25 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Fri Jan 26 06:37:21 UTC 2018

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

Log Message:
Revert "Get rid of unnecessary splsoftnet" (v1.133)

It's not always true that softnet_lock is held these places.
See PR kern/52947.


To generate a diff of this commit:
cvs rdiff -u -r1.136 -r1.137 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/nd6_rtr.c
diff -u src/sys/netinet6/nd6_rtr.c:1.136 src/sys/netinet6/nd6_rtr.c:1.137
--- src/sys/netinet6/nd6_rtr.c:1.136	Fri Dec 15 04:03:46 2017
+++ src/sys/netinet6/nd6_rtr.c	Fri Jan 26 06:37:21 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: nd6_rtr.c,v 1.136 2017/12/15 04:03:46 ozaki-r Exp $	*/
+/*	$NetBSD: nd6_rtr.c,v 1.137 2018/01/26 06:37:21 ozaki-r Exp $	*/
 /*	$KAME: nd6_rtr.c,v 1.95 2001/02/07 08:09:47 itojun Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nd6_rtr.c,v 1.136 2017/12/15 04:03:46 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nd6_rtr.c,v 1.137 2018/01/26 06:37:21 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -469,6 +469,7 @@ defrouter_addreq(struct nd_defrouter *ne
 		struct sockaddr_in6 sin6;
 		struct sockaddr sa;
 	} def, mask, gate;
+	int s;
 	int error;
 
 	memset(, 0, sizeof(def));
@@ -483,15 +484,14 @@ defrouter_addreq(struct nd_defrouter *ne
 	gate.sin6.sin6_scope_id = 0;	/* XXX */
 #endif
 
-#ifndef NET_MPSAFE
-	KASSERT(mutex_owned(softnet_lock));
-#endif
+	s = splsoftnet();
 	error = rtrequest_newmsg(RTM_ADD, , , ,
 	RTF_GATEWAY);
 	if (error == 0) {
 		nd6_numroutes++;
 		newdr->installed = 1;
 	}
+	splx(s);
 	return;
 }
 
@@ -957,7 +957,7 @@ nd6_prelist_add(struct nd_prefixctl *prc
 	struct nd_prefix **newp)
 {
 	struct nd_prefix *newpr = NULL;
-	int i;
+	int i, s;
 	int error;
 	struct in6_ifextra *ext = prc->ndprc_ifp->if_afdata[AF_INET6];
 
@@ -997,8 +997,10 @@ nd6_prelist_add(struct nd_prefixctl *prc
 		newpr->ndpr_mask.s6_addr32[i];
 	}
 
+	s = splsoftnet();
 	/* link ndpr_entry to nd_prefix list */
 	ND_PREFIX_LIST_INSERT_HEAD(newpr);
+	splx(s);
 
 	/* ND_OPT_PI_FLAG_ONLINK processing */
 	if (newpr->ndpr_raf_onlink) {
@@ -1066,6 +1068,7 @@ void
 nd6_prelist_remove(struct nd_prefix *pr)
 {
 	struct nd_pfxrouter *pfr, *next;
+	int s;
 	struct in6_ifextra *ext = pr->ndpr_ifp->if_afdata[AF_INET6];
 
 	ND6_ASSERT_WLOCK();
@@ -1073,6 +1076,7 @@ nd6_prelist_remove(struct nd_prefix *pr)
 
 	nd6_invalidate_prefix(pr);
 
+	s = splsoftnet();
 	/* unlink ndpr_entry from nd_prefix list */
 	ND_PREFIX_LIST_REMOVE(pr);
 
@@ -1090,6 +1094,7 @@ nd6_prelist_remove(struct nd_prefix *pr)
 			"%s\n", pr->ndpr_ifp->if_xname);
 		}
 	}
+	splx(s);
 
 	free(pr, M_IP6NDP);
 
@@ -2218,16 +2223,16 @@ in6_init_address_ltimes(struct nd_prefix
 void
 nd6_rt_flush(struct in6_addr *gateway, struct ifnet *ifp)
 {
-
-#ifndef NET_MPSAFE
-	KASSERT(mutex_owned(softnet_lock));
-#endif
+	int s = splsoftnet();
 
 	/* We'll care only link-local addresses */
-	if (!IN6_IS_ADDR_LINKLOCAL(gateway))
+	if (!IN6_IS_ADDR_LINKLOCAL(gateway)) {
+		splx(s);
 		return;
+	}
 
 	rt_delete_matched_entries(AF_INET6, rt6_deleteroute_matcher, gateway);
+	splx(s);
 }
 
 static int



CVS commit: src/sys/netinet6

2018-01-25 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Fri Jan 26 06:37:21 UTC 2018

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

Log Message:
Revert "Get rid of unnecessary splsoftnet" (v1.133)

It's not always true that softnet_lock is held these places.
See PR kern/52947.


To generate a diff of this commit:
cvs rdiff -u -r1.136 -r1.137 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.



CVS commit: src/sys/arch/mips/mips

2018-01-25 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Fri Jan 26 05:29:43 UTC 2018

Modified Files:
src/sys/arch/mips/mips: locore_mips3.S

Log Message:
Don't warn about MIPS1 MULTIPROCESSOR in a mips3 file.


To generate a diff of this commit:
cvs rdiff -u -r1.113 -r1.114 src/sys/arch/mips/mips/locore_mips3.S

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/mips/mips/locore_mips3.S
diff -u src/sys/arch/mips/mips/locore_mips3.S:1.113 src/sys/arch/mips/mips/locore_mips3.S:1.114
--- src/sys/arch/mips/mips/locore_mips3.S:1.113	Wed Jul 27 09:32:35 2016
+++ src/sys/arch/mips/mips/locore_mips3.S	Fri Jan 26 05:29:43 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore_mips3.S,v 1.113 2016/07/27 09:32:35 skrll Exp $	*/
+/*	$NetBSD: locore_mips3.S,v 1.114 2018/01/26 05:29:43 maya Exp $	*/
 
 /*
  * Copyright (c) 1997 Jonathan Stone (hereinafter referred to as the author)
@@ -92,7 +92,7 @@
 #include 
 #include 
 
-RCSID("$NetBSD: locore_mips3.S,v 1.113 2016/07/27 09:32:35 skrll Exp $")
+RCSID("$NetBSD: locore_mips3.S,v 1.114 2018/01/26 05:29:43 maya Exp $")
 
 #include "assym.h"
 
@@ -778,9 +778,6 @@ END(mips3_cp0_tlb_page_mask_probe)
 
 #ifdef MULTIPROCESSOR
 /*
- * The presence of this routine here will causes MIPS1 MULTIPROCESSOR kernels
- * to fail, as they should since we won't support such abominations.
- *
  * MD code calls/jumps to this with the pointer to this CPU's cpu_info in a1,
  * sp set to ci->ci_data.cpu_idlelwp->l_md.md_utf.  gp will be overridden so
  * 0 can be supplied if needed.  (This happens to match what CFE wants)



CVS commit: src/sys/arch/mips/mips

2018-01-25 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Fri Jan 26 05:29:43 UTC 2018

Modified Files:
src/sys/arch/mips/mips: locore_mips3.S

Log Message:
Don't warn about MIPS1 MULTIPROCESSOR in a mips3 file.


To generate a diff of this commit:
cvs rdiff -u -r1.113 -r1.114 src/sys/arch/mips/mips/locore_mips3.S

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



Re: CVS commit: src/sys/nfs

2018-01-25 Thread Tom Spindler (moof)
> > Log Message:
> > Use a random opaque cookie, not kva pointer, for nfssvc(2).
> > 
> > (What were they smoking?!)

It looks like most of the code is from the 4.4-Lite merge from mycroft
circa 1994 (!!); I leave it up to the reader to determine what was
being smoked when at Berkeley.

> > I suspect most of this is actually dead code that wasn't properly
> > amputated along with the rest of the gangrene of NFSKERB a decade
> > ago, but I'm out of time to investigate further.  If someone else
> > wants to kill NFSSVC_AUTHIN/NFSSVC_AUTHINFAIL and the rest of the
> > tentacular kerberosity, be my guest.

Alas, I don't remember what moved me to kill the NFSKERB bits in
../usr.sbin/nfsd, but given that the current source still has e.g.

#ifdef NFSKERB
XXX
#else
(void)ktvin.tv_sec;
#endif

in nfs_socket.c, I think it's completely safe and worthwhile to
utterly nuke everything related to the nfs-with-kerb4 code.



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

2018-01-25 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Jan 25 23:42:06 UTC 2018

Modified Files:
src/distrib/sets/lists/modules: md.amd64 md.i386

Log Message:
Update sets lists for new amdsmn(4) and amdzentemp(4) modules


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/distrib/sets/lists/modules/md.amd64
cvs rdiff -u -r1.75 -r1.76 src/distrib/sets/lists/modules/md.i386

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/modules/md.amd64
diff -u src/distrib/sets/lists/modules/md.amd64:1.72 src/distrib/sets/lists/modules/md.amd64:1.73
--- src/distrib/sets/lists/modules/md.amd64:1.72	Thu Dec 15 12:56:52 2016
+++ src/distrib/sets/lists/modules/md.amd64	Thu Jan 25 23:42:06 2018
@@ -1,4 +1,4 @@
-# $NetBSD: md.amd64,v 1.72 2016/12/15 12:56:52 kre Exp $
+# $NetBSD: md.amd64,v 1.73 2018/01/25 23:42:06 pgoyette Exp $
 #
 # NOTE that there are two sets of files here:
 # @MODULEDIR@ and amd64-xen
@@ -31,8 +31,12 @@
 ./@MODULEDIR@/acpiwmi/acpiwmi.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/aibsbase-kernel-modules	kmod
 ./@MODULEDIR@/aibs/aibs.kmod			base-kernel-modules	kmod
+./@MODULEDIR@/amdsmnbase-kernel-modules	kmod
+./@MODULEDIR@/amdsmn/amdsmn.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/amdtempbase-kernel-modules	kmod
 ./@MODULEDIR@/amdtemp/amdtemp.kmod		base-kernel-modules	kmod
+./@MODULEDIR@/amdzentemp			base-kernel-modules	kmod
+./@MODULEDIR@/amdzentemp/amdzentemp.kmod	base-kernel-modules	kmod
 ./@MODULEDIR@/apsbase-kernel-modules	kmod
 ./@MODULEDIR@/aps/aps.kmod			base-kernel-modules	kmod
 ./@MODULEDIR@/asusbase-kernel-modules	kmod

Index: src/distrib/sets/lists/modules/md.i386
diff -u src/distrib/sets/lists/modules/md.i386:1.75 src/distrib/sets/lists/modules/md.i386:1.76
--- src/distrib/sets/lists/modules/md.i386:1.75	Wed Aug  9 18:45:30 2017
+++ src/distrib/sets/lists/modules/md.i386	Thu Jan 25 23:42:06 2018
@@ -1,4 +1,4 @@
-# $NetBSD: md.i386,v 1.75 2017/08/09 18:45:30 maxv Exp $
+# $NetBSD: md.i386,v 1.76 2018/01/25 23:42:06 pgoyette Exp $
 #
 # NOTE that there are three sets of files here:
 # @MODULEDIR@, i386-xen, and i386pae-xen
@@ -32,8 +32,12 @@
 ./@MODULEDIR@/acpiwmi/acpiwmi.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/aibsbase-kernel-modules	kmod
 ./@MODULEDIR@/aibs/aibs.kmod			base-kernel-modules	kmod
+./@MODULEDIR@/amdsmnbase-kernel-modules	kmod
+./@MODULEDIR@/amdsmn/amdsmn.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/amdtempbase-kernel-modules	kmod
 ./@MODULEDIR@/amdtemp/amdtemp.kmod		base-kernel-modules	kmod
+./@MODULEDIR@/amdzentemp			base-kernel-modules	kmod
+./@MODULEDIR@/amdzentemp/amdzentemp.kmod	base-kernel-modules	kmod
 ./@MODULEDIR@/apsbase-kernel-modules	kmod
 ./@MODULEDIR@/aps/aps.kmod			base-kernel-modules	kmod
 ./@MODULEDIR@/asusbase-kernel-modules	kmod



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

2018-01-25 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Jan 25 23:42:06 UTC 2018

Modified Files:
src/distrib/sets/lists/modules: md.amd64 md.i386

Log Message:
Update sets lists for new amdsmn(4) and amdzentemp(4) modules


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/distrib/sets/lists/modules/md.amd64
cvs rdiff -u -r1.75 -r1.76 src/distrib/sets/lists/modules/md.i386

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



CVS commit: src/sys/modules

2018-01-25 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Jan 25 23:40:06 UTC 2018

Modified Files:
src/sys/modules: Makefile
Added Files:
src/sys/modules/amdsmn: Makefile amdsmn.ioconf
src/sys/modules/amdzentemp: Makefile amdzentemp.ioconf

Log Message:
Create amdsmn(4) amd amdzentemp(4) modules for X86


To generate a diff of this commit:
cvs rdiff -u -r1.198 -r1.199 src/sys/modules/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/modules/amdsmn/Makefile \
src/sys/modules/amdsmn/amdsmn.ioconf
cvs rdiff -u -r0 -r1.1 src/sys/modules/amdzentemp/Makefile \
src/sys/modules/amdzentemp/amdzentemp.ioconf

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



CVS commit: src/sys/modules

2018-01-25 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Jan 25 23:40:06 UTC 2018

Modified Files:
src/sys/modules: Makefile
Added Files:
src/sys/modules/amdsmn: Makefile amdsmn.ioconf
src/sys/modules/amdzentemp: Makefile amdzentemp.ioconf

Log Message:
Create amdsmn(4) amd amdzentemp(4) modules for X86


To generate a diff of this commit:
cvs rdiff -u -r1.198 -r1.199 src/sys/modules/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/modules/amdsmn/Makefile \
src/sys/modules/amdsmn/amdsmn.ioconf
cvs rdiff -u -r0 -r1.1 src/sys/modules/amdzentemp/Makefile \
src/sys/modules/amdzentemp/amdzentemp.ioconf

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

Modified files:

Index: src/sys/modules/Makefile
diff -u src/sys/modules/Makefile:1.198 src/sys/modules/Makefile:1.199
--- src/sys/modules/Makefile:1.198	Tue Jan  9 03:31:13 2018
+++ src/sys/modules/Makefile	Thu Jan 25 23:40:06 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.198 2018/01/09 03:31:13 christos Exp $
+#	$NetBSD: Makefile,v 1.199 2018/01/25 23:40:06 pgoyette Exp $
 
 .include 
 
@@ -181,7 +181,9 @@ SUBDIR+=	exec_elf64
 
 .if ${MACHINE_ARCH} == "i386" || \
 ${MACHINE_ARCH} == "x86_64"
+SUBDIR+=	amdsmn
 SUBDIR+=	amdtemp
+SUBDIR+=	amdzentemp
 SUBDIR+=	coretemp
 SUBDIR+=	est
 SUBDIR+=	hdafg

Added files:

Index: src/sys/modules/amdsmn/Makefile
diff -u /dev/null src/sys/modules/amdsmn/Makefile:1.1
--- /dev/null	Thu Jan 25 23:40:06 2018
+++ src/sys/modules/amdsmn/Makefile	Thu Jan 25 23:40:06 2018
@@ -0,0 +1,13 @@
+# $NetBSD: Makefile,v 1.1 2018/01/25 23:40:06 pgoyette Exp $
+
+.include "../Makefile.inc"
+
+.PATH:	${S}/arch/x86/pci
+
+KMOD=	amdsmn
+IOCONF=	amdsmn.ioconf
+SRCS=	amdsmn.c
+
+WARNS=	4
+
+.include 
Index: src/sys/modules/amdsmn/amdsmn.ioconf
diff -u /dev/null src/sys/modules/amdsmn/amdsmn.ioconf:1.1
--- /dev/null	Thu Jan 25 23:40:06 2018
+++ src/sys/modules/amdsmn/amdsmn.ioconf	Thu Jan 25 23:40:06 2018
@@ -0,0 +1,11 @@
+# $NetBSD: amdsmn.ioconf,v 1.1 2018/01/25 23:40:06 pgoyette Exp $
+
+ioconf amdsmn
+
+include "conf/files"
+include "dev/pci/files.pci"
+include "arch/x86/pci/files.pci"
+
+pseudo-root pci*
+
+amdsmn* at pci?

Index: src/sys/modules/amdzentemp/Makefile
diff -u /dev/null src/sys/modules/amdzentemp/Makefile:1.1
--- /dev/null	Thu Jan 25 23:40:06 2018
+++ src/sys/modules/amdzentemp/Makefile	Thu Jan 25 23:40:06 2018
@@ -0,0 +1,13 @@
+# $NetBSD: Makefile,v 1.1 2018/01/25 23:40:06 pgoyette Exp $
+
+.include "../Makefile.inc"
+
+.PATH:	${S}/arch/x86/pci
+
+KMOD=	amdzentemp
+IOCONF=	amdzentemp.ioconf
+SRCS=	amdzentemp.c
+
+WARNS=	4
+
+.include 
Index: src/sys/modules/amdzentemp/amdzentemp.ioconf
diff -u /dev/null src/sys/modules/amdzentemp/amdzentemp.ioconf:1.1
--- /dev/null	Thu Jan 25 23:40:06 2018
+++ src/sys/modules/amdzentemp/amdzentemp.ioconf	Thu Jan 25 23:40:06 2018
@@ -0,0 +1,11 @@
+# $NetBSD: amdzentemp.ioconf,v 1.1 2018/01/25 23:40:06 pgoyette Exp $
+
+ioconf amdzentemp
+
+include "conf/files"
+include "dev/pci/files.pci"
+include "arch/x86/pci/files.pci"
+
+pseudo-root amdsmn*
+
+amdzentemp* at amdsmn?



CVS commit: src/sys/arch/x86/pci

2018-01-25 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Jan 25 23:37:34 UTC 2018

Modified Files:
src/sys/arch/x86/pci: amdsmn.c amdzentemp.c

Log Message:
Modularize the amdsmn(4) driver, and update dependency for amdzentemp(4)


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/x86/pci/amdsmn.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/x86/pci/amdzentemp.c

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



CVS commit: src/sys/arch/x86/pci

2018-01-25 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Jan 25 23:37:34 UTC 2018

Modified Files:
src/sys/arch/x86/pci: amdsmn.c amdzentemp.c

Log Message:
Modularize the amdsmn(4) driver, and update dependency for amdzentemp(4)


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/x86/pci/amdsmn.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/x86/pci/amdzentemp.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/x86/pci/amdsmn.c
diff -u src/sys/arch/x86/pci/amdsmn.c:1.1 src/sys/arch/x86/pci/amdsmn.c:1.2
--- src/sys/arch/x86/pci/amdsmn.c:1.1	Thu Jan 25 01:22:21 2018
+++ src/sys/arch/x86/pci/amdsmn.c	Thu Jan 25 23:37:33 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: amdsmn.c,v 1.1 2018/01/25 01:22:21 christos Exp $	*/
+/*	$NetBSD: amdsmn.c,v 1.2 2018/01/25 23:37:33 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2017 Conrad Meyer 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amdsmn.c,v 1.1 2018/01/25 01:22:21 christos Exp $ ");
+__KERNEL_RCSID(0, "$NetBSD: amdsmn.c,v 1.2 2018/01/25 23:37:33 pgoyette Exp $ ");
 
 /*
  * Driver for the AMD Family 17h CPU System Management Network.
@@ -41,6 +41,7 @@ __KERNEL_RCSID(0, "$NetBSD: amdsmn.c,v 1
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -49,6 +50,7 @@ __KERNEL_RCSID(0, "$NetBSD: amdsmn.c,v 1
 #include 
 
 #include "amdsmn.h"
+#include "ioconf.h"
 
 #define	SMN_ADDR_REG	0x60
 #define	SMN_DATA_REG	0x64
@@ -63,11 +65,12 @@ struct amdsmn_softc {
 
 static int amdsmn_match(device_t, cfdata_t, void *);
 static void amdsmn_attach(device_t, device_t, void *);
+static int amdsmn_rescan(device_t, const char *, const int *);
 static int amdsmn_detach(device_t, int);
 static int amdsmn_misc_search(device_t, cfdata_t, const int *, void *);
 
-CFATTACH_DECL_NEW(amdsmn, sizeof(struct amdsmn_softc), amdsmn_match,
-amdsmn_attach, amdsmn_detach, NULL);
+CFATTACH_DECL3_NEW(amdsmn, sizeof(struct amdsmn_softc), amdsmn_match,
+amdsmn_attach, amdsmn_detach, NULL, amdsmn_rescan, NULL, 0);
 
 static int
 amdsmn_match(device_t parent, cfdata_t match, void *aux) 
@@ -91,13 +94,24 @@ amdsmn_attach(device_t parent, device_t 
 {
 	struct amdsmn_softc *sc = device_private(self);
 	struct pci_attach_args *pa = aux;
+	int flags = 0;
 
 	mutex_init(>smn_lock, MUTEX_DEFAULT, IPL_NONE);
 	sc->pa = *pa;
 	sc->pc = pa->pa_pc;
 	sc->pcitag = pa->pa_tag;
 	aprint_normal(": AMD Family 17h System Management Network\n");
-	config_search_loc(amdsmn_misc_search, self, "amdsmn", NULL, >pa);
+	amdsmn_rescan(self, "amdsmn", );
+}
+
+static int
+amdsmn_rescan(device_t self, const char *ifattr, const int *flags)
+{
+	struct amdsmn_softc *sc = device_private(self);
+
+	config_search_loc(amdsmn_misc_search, self, ifattr, NULL, >pa);
+
+	return 0;
 }
 
 static int
@@ -136,3 +150,34 @@ amdsmn_write(device_t dev, uint32_t addr
 
 	return 0;
 }
+
+MODULE(MODULE_CLASS_DRIVER, amdsmn, "pci");
+
+#ifdef _MODULE
+#include "ioconf.c"
+#endif
+
+static int
+amdsmn_modcmd(modcmd_t cmd, void *opaque)
+{
+	int error = 0;
+
+#ifdef _MODULE
+	switch (cmd) {
+	case MODULE_CMD_INIT:
+		error = config_init_component(cfdriver_ioconf_amdsmn,
+		cfattach_ioconf_amdsmn, cfdata_ioconf_amdsmn);
+		break;
+	case MODULE_CMD_FINI:
+		error = config_fini_component(cfdriver_ioconf_amdsmn,
+		cfattach_ioconf_amdsmn, cfdata_ioconf_amdsmn);
+		break;
+	default:
+		error = ENOTTY;
+		break;
+	}
+#endif
+
+	return error;
+}
+

Index: src/sys/arch/x86/pci/amdzentemp.c
diff -u src/sys/arch/x86/pci/amdzentemp.c:1.5 src/sys/arch/x86/pci/amdzentemp.c:1.6
--- src/sys/arch/x86/pci/amdzentemp.c:1.5	Thu Jan 25 22:37:42 2018
+++ src/sys/arch/x86/pci/amdzentemp.c	Thu Jan 25 23:37:33 2018
@@ -1,4 +1,4 @@
-/*  $NetBSD: amdzentemp.c,v 1.5 2018/01/25 22:37:42 pgoyette Exp $ */
+/*  $NetBSD: amdzentemp.c,v 1.6 2018/01/25 23:37:33 pgoyette Exp $ */
 /*  $OpenBSD: kate.c,v 1.2 2008/03/27 04:52:03 cnst Exp $   */
 
 /*
@@ -50,7 +50,7 @@
 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amdzentemp.c,v 1.5 2018/01/25 22:37:42 pgoyette Exp $ ");
+__KERNEL_RCSID(0, "$NetBSD: amdzentemp.c,v 1.6 2018/01/25 23:37:33 pgoyette Exp $ ");
 
 #include 
 #include 
@@ -223,7 +223,7 @@ amdzentemp_family17_refresh(struct sysmo
 	edata->value_cur = ((temp >> 21) * 125000) + 27315;
 }
 
-MODULE(MODULE_CLASS_DRIVER, amdzentemp, "sysmon_envsys");
+MODULE(MODULE_CLASS_DRIVER, amdzentemp, "sysmon_envsys,amdsmn");
 
 #ifdef _MODULE
 #include "ioconf.c"



CVS commit: src/doc

2018-01-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan 25 22:49:32 UTC 2018

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
mention tzcode2018c


To generate a diff of this commit:
cvs rdiff -u -r1.1496 -r1.1497 src/doc/3RDPARTY
cvs rdiff -u -r1.2350 -r1.2351 src/doc/CHANGES

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



CVS commit: src/doc

2018-01-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan 25 22:49:32 UTC 2018

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
mention tzcode2018c


To generate a diff of this commit:
cvs rdiff -u -r1.1496 -r1.1497 src/doc/3RDPARTY
cvs rdiff -u -r1.2350 -r1.2351 src/doc/CHANGES

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1496 src/doc/3RDPARTY:1.1497
--- src/doc/3RDPARTY:1.1496	Wed Jan 24 08:57:37 2018
+++ src/doc/3RDPARTY	Thu Jan 25 17:49:32 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1496 2018/01/24 13:57:37 kre Exp $
+#	$NetBSD: 3RDPARTY,v 1.1497 2018/01/25 22:49:32 christos Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1411,7 +1411,7 @@ Notes:
 Added changes from a5 -> a12 manually.
 
 Package:	tz
-Version:	tzcode2017c / tzdata2018c
+Version:	tzcode2018c / tzdata2018c
 Current Vers:	tzcode2018c / tzdata2018c
 Maintainer:	Paul Eggert <egg...@cs.ucla.edu>
 Archive Site:	ftp://ftp.iana.org/tz/releases/

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2350 src/doc/CHANGES:1.2351
--- src/doc/CHANGES:1.2350	Wed Jan 24 08:57:37 2018
+++ src/doc/CHANGES	Thu Jan 25 17:49:32 2018
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2350 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2351 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -104,3 +104,4 @@ Changes from NetBSD 8.0 to NetBSD 9.0:
 	macppc: Enable Veriexec support in the GENERIC kernel [sevan 20180117]
 	raid(4): Add support for 32-bit on 64-bit kernel.  [mrg 20180117]
 	zoneinfo: Import tzdata2018c (skipping 2018a & 2018b). [kre 20180124]
+	libc: Update to tzcode2018c. [christos 20180125]



CVS commit: src/lib/libc/time

2018-01-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan 25 22:48:42 UTC 2018

Modified Files:
src/lib/libc/time: Makefile NEWS README ctime.3 localtime.c theory.html
tz-how-to.html tzselect.8 tzselect.ksh tzset.3 version zdump.c
zic.8 zic.c

Log Message:
Merge tzcode2018c [ changelog with changes to tzdata sections removed ]

Release 2018c - 2018-01-22 23:00:44 -0800

  Changes to build procedure

The build procedure now works around mawk 1.3.3's lack of support
for character class expressions.  (Problem reported by Ohyama.)

Release 2018b - 2018-01-17 23:24:48 -0800

  Changes to build procedure

The distribution now contains the file 'pacificnew' again.
This file was inadvertantly omitted in the 2018a distribution.
(Problem reported by Matias Fonzo.)

Release 2018a - 2018-01-12 22:29:21 -0800

  Changes to build procedure

The default installation locations have been changed to mostly
match Debian circa 2017, instead of being designed as an add-on to
4.3BSD circa 1986.  This affects the Makefile macros TOPDIR,
TZDIR, MANDIR, and LIBDIR.  New Makefile macros TZDEFAULT, USRDIR,
USRSHAREDIR, BINDIR, ZDUMPDIR, and ZICDIR let installers tailor
locations more precisely.  (This responds to suggestions from
Brian Inglis and from Steve Summit.)

The default installation procedure no longer creates the
backward-compatibility link US/Pacific-New, which causes
confusion during user setup (e.g., see Debian bug 815200).
Use 'make BACKWARD="backward pacificnew"' to create the link
anyway, for now.  Eventually we plan to remove the link entirely.

tzdata.zi now contains a version-number comment.
(Suggested by Tom Lane.)

The Makefile now quotes values like BACKWARD more carefully when
passing them to the shell.  (Problem reported by Zefram.)

Builders no longer need to specify -DHAVE_SNPRINTF on platforms
that have snprintf and use pre-C99 compilers.  (Problem reported
by Jon Skeet.)

  Changes to code

zic has a new option -t FILE that specifies the location of the
file that determines local time when TZ is unset.  The default for
this location can be configured via the new TZDEFAULT makefile
macro, which defaults to /etc/localtime.

Diagnostics and commentary now distinguish UT from UTC more
carefully; see theory.html for more information about UT vs UTC.

zic has been ported to GCC 8's -Wstringop-truncation option.
(Problem reported by Martin Sebor.)

  Changes to documentation and commentary

The zic man page now documents the longstanding behavior that
times and years can be out of the usual range, with negative times
counting backwards from midnight and with year 0 preceding year 1.
(Problem reported by Michael Deckers.)

The theory.html file now mentions the POSIX limit of six chars
per abbreviation, and lists alphabetic abbreviations used.

The files tz-art.htm and tz-link.htm have been renamed to
tz-art.html and tz-link.html, respectively, for consistency with
other file names and to simplify web server configuration.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/lib/libc/time/Makefile
cvs rdiff -u -r1.22 -r1.23 src/lib/libc/time/NEWS
cvs rdiff -u -r1.12 -r1.13 src/lib/libc/time/README
cvs rdiff -u -r1.55 -r1.56 src/lib/libc/time/ctime.3
cvs rdiff -u -r1.110 -r1.111 src/lib/libc/time/localtime.c
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/time/theory.html
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/time/tz-how-to.html
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/time/tzselect.8
cvs rdiff -u -r1.16 -r1.17 src/lib/libc/time/tzselect.ksh
cvs rdiff -u -r1.36 -r1.37 src/lib/libc/time/tzset.3
cvs rdiff -u -r1.5 -r1.6 src/lib/libc/time/version
cvs rdiff -u -r1.47 -r1.48 src/lib/libc/time/zdump.c
cvs rdiff -u -r1.27 -r1.28 src/lib/libc/time/zic.8
cvs rdiff -u -r1.69 -r1.70 src/lib/libc/time/zic.c

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



CVS commit: src/lib/libc/time

2018-01-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan 25 22:48:42 UTC 2018

Modified Files:
src/lib/libc/time: Makefile NEWS README ctime.3 localtime.c theory.html
tz-how-to.html tzselect.8 tzselect.ksh tzset.3 version zdump.c
zic.8 zic.c

Log Message:
Merge tzcode2018c [ changelog with changes to tzdata sections removed ]

Release 2018c - 2018-01-22 23:00:44 -0800

  Changes to build procedure

The build procedure now works around mawk 1.3.3's lack of support
for character class expressions.  (Problem reported by Ohyama.)

Release 2018b - 2018-01-17 23:24:48 -0800

  Changes to build procedure

The distribution now contains the file 'pacificnew' again.
This file was inadvertantly omitted in the 2018a distribution.
(Problem reported by Matias Fonzo.)

Release 2018a - 2018-01-12 22:29:21 -0800

  Changes to build procedure

The default installation locations have been changed to mostly
match Debian circa 2017, instead of being designed as an add-on to
4.3BSD circa 1986.  This affects the Makefile macros TOPDIR,
TZDIR, MANDIR, and LIBDIR.  New Makefile macros TZDEFAULT, USRDIR,
USRSHAREDIR, BINDIR, ZDUMPDIR, and ZICDIR let installers tailor
locations more precisely.  (This responds to suggestions from
Brian Inglis and from Steve Summit.)

The default installation procedure no longer creates the
backward-compatibility link US/Pacific-New, which causes
confusion during user setup (e.g., see Debian bug 815200).
Use 'make BACKWARD="backward pacificnew"' to create the link
anyway, for now.  Eventually we plan to remove the link entirely.

tzdata.zi now contains a version-number comment.
(Suggested by Tom Lane.)

The Makefile now quotes values like BACKWARD more carefully when
passing them to the shell.  (Problem reported by Zefram.)

Builders no longer need to specify -DHAVE_SNPRINTF on platforms
that have snprintf and use pre-C99 compilers.  (Problem reported
by Jon Skeet.)

  Changes to code

zic has a new option -t FILE that specifies the location of the
file that determines local time when TZ is unset.  The default for
this location can be configured via the new TZDEFAULT makefile
macro, which defaults to /etc/localtime.

Diagnostics and commentary now distinguish UT from UTC more
carefully; see theory.html for more information about UT vs UTC.

zic has been ported to GCC 8's -Wstringop-truncation option.
(Problem reported by Martin Sebor.)

  Changes to documentation and commentary

The zic man page now documents the longstanding behavior that
times and years can be out of the usual range, with negative times
counting backwards from midnight and with year 0 preceding year 1.
(Problem reported by Michael Deckers.)

The theory.html file now mentions the POSIX limit of six chars
per abbreviation, and lists alphabetic abbreviations used.

The files tz-art.htm and tz-link.htm have been renamed to
tz-art.html and tz-link.html, respectively, for consistency with
other file names and to simplify web server configuration.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/lib/libc/time/Makefile
cvs rdiff -u -r1.22 -r1.23 src/lib/libc/time/NEWS
cvs rdiff -u -r1.12 -r1.13 src/lib/libc/time/README
cvs rdiff -u -r1.55 -r1.56 src/lib/libc/time/ctime.3
cvs rdiff -u -r1.110 -r1.111 src/lib/libc/time/localtime.c
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/time/theory.html
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/time/tz-how-to.html
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/time/tzselect.8
cvs rdiff -u -r1.16 -r1.17 src/lib/libc/time/tzselect.ksh
cvs rdiff -u -r1.36 -r1.37 src/lib/libc/time/tzset.3
cvs rdiff -u -r1.5 -r1.6 src/lib/libc/time/version
cvs rdiff -u -r1.47 -r1.48 src/lib/libc/time/zdump.c
cvs rdiff -u -r1.27 -r1.28 src/lib/libc/time/zic.8
cvs rdiff -u -r1.69 -r1.70 src/lib/libc/time/zic.c

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/time/Makefile
diff -u src/lib/libc/time/Makefile:1.38 src/lib/libc/time/Makefile:1.39
--- src/lib/libc/time/Makefile:1.38	Tue Oct 24 13:38:17 2017
+++ src/lib/libc/time/Makefile	Thu Jan 25 17:48:42 2018
@@ -42,36 +42,63 @@ POSIXRULES=	America/New_York
 # Also see TZDEFRULESTRING below, which takes effect only
 # if the time zone files cannot be accessed.
 
-# Everything gets put in subdirectories of. . .
 
-TOPDIR=		/usr/local
+# Installation locations.
+#
+# The defaults are suitable for Debian, except that if REDO is
+# posix_right or right_posix then files that Debian puts under
+# /usr/share/zoneinfo/posix and /usr/share/zoneinfo/right are instead
+# put under /usr/share/zoneinfo-posix and /usr/share/zoneinfo-leaps,
+# respectively.  Problems with the Debian approach are discussed in
+# the commentary for the right_posix rule (below).
+
+# Destination directory, 

CVS commit: src/sys/arch/x86/pci

2018-01-25 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Jan 25 22:37:42 UTC 2018

Modified Files:
src/sys/arch/x86/pci: amdzentemp.c

Log Message:
Correct placement of __diagused attribute


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/x86/pci/amdzentemp.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/x86/pci/amdzentemp.c
diff -u src/sys/arch/x86/pci/amdzentemp.c:1.4 src/sys/arch/x86/pci/amdzentemp.c:1.5
--- src/sys/arch/x86/pci/amdzentemp.c:1.4	Thu Jan 25 22:14:01 2018
+++ src/sys/arch/x86/pci/amdzentemp.c	Thu Jan 25 22:37:42 2018
@@ -1,4 +1,4 @@
-/*  $NetBSD: amdzentemp.c,v 1.4 2018/01/25 22:14:01 pgoyette Exp $ */
+/*  $NetBSD: amdzentemp.c,v 1.5 2018/01/25 22:37:42 pgoyette Exp $ */
 /*  $OpenBSD: kate.c,v 1.2 2008/03/27 04:52:03 cnst Exp $   */
 
 /*
@@ -50,7 +50,7 @@
 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amdzentemp.c,v 1.4 2018/01/25 22:14:01 pgoyette Exp $ ");
+__KERNEL_RCSID(0, "$NetBSD: amdzentemp.c,v 1.5 2018/01/25 22:37:42 pgoyette Exp $ ");
 
 #include 
 #include 
@@ -98,7 +98,7 @@ CFATTACH_DECL_NEW(amdzentemp, sizeof(str
 static int
 amdzentemp_match(device_t parent, cfdata_t match, void *aux)
 {
-	struct pci_attach_args *pa = aux __diagused;
+	struct pci_attach_args *pa __diagused = aux;
 
 	KASSERT(PCI_VENDOR(pa->pa_id) == PCI_VENDOR_AMD);
  



CVS commit: src/sys/arch/x86/pci

2018-01-25 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Jan 25 22:37:42 UTC 2018

Modified Files:
src/sys/arch/x86/pci: amdzentemp.c

Log Message:
Correct placement of __diagused attribute


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/x86/pci/amdzentemp.c

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



CVS commit: src/sys/arch/x86/pci

2018-01-25 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Jan 25 22:14:01 UTC 2018

Modified Files:
src/sys/arch/x86/pci: amdzentemp.c

Log Message:
Put back the variable declaration, too, and mark it __diagused

Otherwise a DIAGNOSTIC kernel will complain about the variable being
undeclared.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/x86/pci/amdzentemp.c

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



CVS commit: src/sys/arch/x86/pci

2018-01-25 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Jan 25 22:14:01 UTC 2018

Modified Files:
src/sys/arch/x86/pci: amdzentemp.c

Log Message:
Put back the variable declaration, too, and mark it __diagused

Otherwise a DIAGNOSTIC kernel will complain about the variable being
undeclared.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/x86/pci/amdzentemp.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/x86/pci/amdzentemp.c
diff -u src/sys/arch/x86/pci/amdzentemp.c:1.3 src/sys/arch/x86/pci/amdzentemp.c:1.4
--- src/sys/arch/x86/pci/amdzentemp.c:1.3	Thu Jan 25 21:23:36 2018
+++ src/sys/arch/x86/pci/amdzentemp.c	Thu Jan 25 22:14:01 2018
@@ -1,4 +1,4 @@
-/*  $NetBSD: amdzentemp.c,v 1.3 2018/01/25 21:23:36 pgoyette Exp $ */
+/*  $NetBSD: amdzentemp.c,v 1.4 2018/01/25 22:14:01 pgoyette Exp $ */
 /*  $OpenBSD: kate.c,v 1.2 2008/03/27 04:52:03 cnst Exp $   */
 
 /*
@@ -50,7 +50,7 @@
 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amdzentemp.c,v 1.3 2018/01/25 21:23:36 pgoyette Exp $ ");
+__KERNEL_RCSID(0, "$NetBSD: amdzentemp.c,v 1.4 2018/01/25 22:14:01 pgoyette Exp $ ");
 
 #include 
 #include 
@@ -98,6 +98,7 @@ CFATTACH_DECL_NEW(amdzentemp, sizeof(str
 static int
 amdzentemp_match(device_t parent, cfdata_t match, void *aux)
 {
+	struct pci_attach_args *pa = aux __diagused;
 
 	KASSERT(PCI_VENDOR(pa->pa_id) == PCI_VENDOR_AMD);
  



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

2018-01-25 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Jan 25 22:09:56 UTC 2018

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

Log Message:
Correct the plist entry for ./usr/share/man/cat8/acorn32/MAKEDEV.0

This file is obsolete, replace '.cat' with 'obsolete'.


To generate a diff of this commit:
cvs rdiff -u -r1.1574 -r1.1575 src/distrib/sets/lists/man/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/man/mi
diff -u src/distrib/sets/lists/man/mi:1.1574 src/distrib/sets/lists/man/mi:1.1575
--- src/distrib/sets/lists/man/mi:1.1574	Thu Jan 25 01:27:14 2018
+++ src/distrib/sets/lists/man/mi	Thu Jan 25 22:09:56 2018
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1574 2018/01/25 01:27:14 christos Exp $
+# $NetBSD: mi,v 1.1575 2018/01/25 22:09:56 kamil Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -2317,7 +2317,7 @@
 ./usr/share/man/cat8/acorn26/boot.0		man-obsolete		obsolete
 ./usr/share/man/cat8/acorn26/boot26.0		man-obsolete		obsolete
 ./usr/share/man/cat8/acorn26/makedev.0		man-obsolete		obsolete
-./usr/share/man/cat8/acorn32/MAKEDEV.0		man-obsolete		.cat
+./usr/share/man/cat8/acorn32/MAKEDEV.0		man-obsolete		obsolete
 ./usr/share/man/cat8/acorn32/boot.0		man-sys-catman		obsolete
 ./usr/share/man/cat8/acorn32/boot32.0		man-sys-catman		.cat
 ./usr/share/man/cat8/acorn32/makedev.0		man-obsolete		obsolete



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

2018-01-25 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Jan 25 22:09:56 UTC 2018

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

Log Message:
Correct the plist entry for ./usr/share/man/cat8/acorn32/MAKEDEV.0

This file is obsolete, replace '.cat' with 'obsolete'.


To generate a diff of this commit:
cvs rdiff -u -r1.1574 -r1.1575 src/distrib/sets/lists/man/mi

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



CVS commit: src/sys/arch/x86/pci

2018-01-25 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Jan 25 21:23:36 UTC 2018

Modified Files:
src/sys/arch/x86/pci: amdzentemp.c

Log Message:
KNF: Put back the blank line following the empty variable declarations


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/x86/pci/amdzentemp.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/x86/pci/amdzentemp.c
diff -u src/sys/arch/x86/pci/amdzentemp.c:1.2 src/sys/arch/x86/pci/amdzentemp.c:1.3
--- src/sys/arch/x86/pci/amdzentemp.c:1.2	Thu Jan 25 15:01:05 2018
+++ src/sys/arch/x86/pci/amdzentemp.c	Thu Jan 25 21:23:36 2018
@@ -1,4 +1,4 @@
-/*  $NetBSD: amdzentemp.c,v 1.2 2018/01/25 15:01:05 prlw1 Exp $ */
+/*  $NetBSD: amdzentemp.c,v 1.3 2018/01/25 21:23:36 pgoyette Exp $ */
 /*  $OpenBSD: kate.c,v 1.2 2008/03/27 04:52:03 cnst Exp $   */
 
 /*
@@ -50,7 +50,7 @@
 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amdzentemp.c,v 1.2 2018/01/25 15:01:05 prlw1 Exp $ ");
+__KERNEL_RCSID(0, "$NetBSD: amdzentemp.c,v 1.3 2018/01/25 21:23:36 pgoyette Exp $ ");
 
 #include 
 #include 
@@ -98,6 +98,7 @@ CFATTACH_DECL_NEW(amdzentemp, sizeof(str
 static int
 amdzentemp_match(device_t parent, cfdata_t match, void *aux)
 {
+
 	KASSERT(PCI_VENDOR(pa->pa_id) == PCI_VENDOR_AMD);
  
 	cfdata_t parent_cfdata = device_cfdata(parent);



CVS commit: src/sys/arch/x86/pci

2018-01-25 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Jan 25 21:23:36 UTC 2018

Modified Files:
src/sys/arch/x86/pci: amdzentemp.c

Log Message:
KNF: Put back the blank line following the empty variable declarations


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/x86/pci/amdzentemp.c

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



Re: CVS commit: src/sys/arch/x86/pci

2018-01-25 Thread Paul Goyette

On Thu, 25 Jan 2018, Patrick Welche wrote:


Module Name:src
Committed By:   prlw1
Date:   Thu Jan 25 15:01:05 UTC 2018

Modified Files:
src/sys/arch/x86/pci: amdzentemp.c

Log Message:
Unused variable build fix. (now void *aux is unused)


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/x86/pci/amdzentemp.c


@@ -98,8 +98,6 @@ CFATTACH_DECL_NEW(amdzentemp, sizeof(str
 static int
 amdzentemp_match(device_t parent, cfdata_t match, void *aux)
 {
-   struct pci_attach_args *pa = aux;
-
KASSERT(PCI_VENDOR(pa->pa_id) == PCI_VENDOR_AMD);

cfdata_t parent_cfdata = device_cfdata(parent);


Please leave the blank line for KNF reasons!



+--+--++
| Paul Goyette | PGP Key fingerprint: | E-mail addresses:  |
| (Retired)| FA29 0E3B 35AF E8AE 6651 | paul at whooppee dot com   |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd dot org |
+--+--++


CVS commit: src/sys/netinet6

2018-01-25 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Jan 25 20:55:15 UTC 2018

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

Log Message:
Kick zero-sized fragments. We can't allow them to enter; two fragments
could be put at the same offset.


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/netinet6/frag6.c

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



CVS commit: src/sys/netinet6

2018-01-25 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Jan 25 20:55:15 UTC 2018

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

Log Message:
Kick zero-sized fragments. We can't allow them to enter; two fragments
could be put at the same offset.


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/netinet6/frag6.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/frag6.c
diff -u src/sys/netinet6/frag6.c:1.63 src/sys/netinet6/frag6.c:1.64
--- src/sys/netinet6/frag6.c:1.63	Thu Jan 25 15:55:57 2018
+++ src/sys/netinet6/frag6.c	Thu Jan 25 20:55:15 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: frag6.c,v 1.63 2018/01/25 15:55:57 maxv Exp $	*/
+/*	$NetBSD: frag6.c,v 1.64 2018/01/25 20:55:15 maxv Exp $	*/
 /*	$KAME: frag6.c,v 1.40 2002/05/27 21:40:31 itojun Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: frag6.c,v 1.63 2018/01/25 15:55:57 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: frag6.c,v 1.64 2018/01/25 20:55:15 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -189,13 +189,14 @@ frag6_input(struct mbuf **mp, int *offp,
 	}
 
 	/*
-	 * check whether fragment packet's fragment length is
+	 * Check whether fragment packet's fragment length is non-zero and
 	 * multiple of 8 octets.
 	 * sizeof(struct ip6_frag) == 8
 	 * sizeof(struct ip6_hdr) = 40
 	 */
 	if ((ip6f->ip6f_offlg & IP6F_MORE_FRAG) &&
-	(((ntohs(ip6->ip6_plen) - offset) & 0x7) != 0)) {
+	(((ntohs(ip6->ip6_plen) - offset) == 0) ||
+	 ((ntohs(ip6->ip6_plen) - offset) & 0x7) != 0)) {
 		icmp6_error(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_HEADER,
 		offsetof(struct ip6_hdr, ip6_plen));
 		in6_ifstat_inc(dstifp, ifs6_reass_fail);



CVS commit: src/usr.sbin/autofs

2018-01-25 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Thu Jan 25 19:15:10 UTC 2018

Modified Files:
src/usr.sbin/autofs: auto_master.5

Log Message:
.Li is superfluous inside .Bd -literal


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/autofs/auto_master.5

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/autofs/auto_master.5
diff -u src/usr.sbin/autofs/auto_master.5:1.5 src/usr.sbin/autofs/auto_master.5:1.6
--- src/usr.sbin/autofs/auto_master.5:1.5	Wed Jan 24 12:05:50 2018
+++ src/usr.sbin/autofs/auto_master.5	Thu Jan 25 19:15:10 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: auto_master.5,v 1.5 2018/01/24 12:05:50 uwe Exp $
+.\"	$NetBSD: auto_master.5,v 1.6 2018/01/25 19:15:10 uwe Exp $
 .\" Copyright (c) 2017 The NetBSD Foundation, Inc.
 .\" Copyright (c) 2016 The DragonFly Project
 .\" Copyright (c) 2014 The FreeBSD Foundation
@@ -176,14 +176,14 @@ field are replaced with the value of
 .Ar key .
 This is typically used with wildcards, like:
 .Bd -literal -offset indent
-.Li *	192.168.1.1:/share/&
+*	192.168.1.1:/share/&
 .Ed
 .Pp
 The
 .Ar location
 field may contain references to variables, like:
 .Bd -literal -offset indent
-.Li sys	192.168.1.1:/sys/${OSNAME}
+sys	192.168.1.1:/sys/${OSNAME}
 .Ed
 .Pp
 Defined variables are:
@@ -237,18 +237,18 @@ and
 mount options, described in
 .Xr mount_nfs 8 :
 .Bd -literal -offset indent
-.Li x -intr,nfsv4 192.168.1.1:/share/example/x
+x -intr,nfsv4 192.168.1.1:/share/example/x
 .Ed
 .Pp
 Automatically mount an SMB share on access, as a guest user,
 without prompting for a password:
 .Bd -literal -offset indent
-.Li share -fstype=smbfs,-N ://@server/share
+share -fstype=smbfs,-N ://@server/share
 .Ed
 .Pp
 Automatically mount the CD drive on access:
 .Bd -literal -offset indent
-.Li cd -fstype=cd9660 :/dev/cd0
+cd -fstype=cd9660 :/dev/cd0
 .Ed
 .Sh SPECIAL MAPS
 Special maps have names beginning with
@@ -318,23 +318,23 @@ the map entry key with the optional map 
 The example above could be rewritten using direct map, by placing this in
 .Nm :
 .Bd -literal -offset indent
-.Li /- auto_example
+/- auto_example
 .Ed
 .Pp
 and this in the
 .Pa /etc/auto_example
 map file:
 .Bd -literal -offset indent
-.Li /example/x -intr,nfsv4 192.168.1.1:/share/example/x
-.Li /example/share -fstype=smbfs,-N ://@server/share
-.Li /example/cd -fstype=cd9660 :/dev/cd0
+/example/x -intr,nfsv4 192.168.1.1:/share/example/x
+/example/share -fstype=smbfs,-N ://@server/share
+/example/cd -fstype=cd9660 :/dev/cd0
 .Ed
 .Sh DIRECTORY SERVICES
 Both
 .Nm
 and maps may contain entries consisting of a plus sign and map name:
 .Bd -literal -offset indent
-.Li +auto_master
++auto_master
 .Ed
 .Pp
 Those entries cause



CVS commit: src/usr.sbin/autofs

2018-01-25 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Thu Jan 25 19:15:10 UTC 2018

Modified Files:
src/usr.sbin/autofs: auto_master.5

Log Message:
.Li is superfluous inside .Bd -literal


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/autofs/auto_master.5

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



CVS commit: src/share/man/man4

2018-01-25 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Thu Jan 25 18:56:18 UTC 2018

Modified Files:
src/share/man/man4: amdtemp.4

Log Message:
Formatting fixes.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/share/man/man4/amdtemp.4

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



CVS commit: src/share/man/man4

2018-01-25 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Thu Jan 25 18:56:18 UTC 2018

Modified Files:
src/share/man/man4: amdtemp.4

Log Message:
Formatting fixes.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/share/man/man4/amdtemp.4

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

Modified files:

Index: src/share/man/man4/amdtemp.4
diff -u src/share/man/man4/amdtemp.4:1.9 src/share/man/man4/amdtemp.4:1.10
--- src/share/man/man4/amdtemp.4:1.9	Tue Mar 18 18:20:39 2014
+++ src/share/man/man4/amdtemp.4	Thu Jan 25 18:56:17 2018
@@ -1,4 +1,4 @@
-.\" $NetBSD: amdtemp.4,v 1.9 2014/03/18 18:20:39 riastradh Exp $
+.\" $NetBSD: amdtemp.4,v 1.10 2018/01/25 18:56:17 uwe Exp $
 .\"-
 .\" Copyright (c) 2008 Christoph Egger
 .\" All rights reserved.
@@ -41,13 +41,13 @@ driver provides support for the on-die d
 on AMD K8, AMD Barcelona, AMD Phenom, AMD Griffin, and AMD Fusion CPUs.
 .Pp
 These sensors were officially introduced in AMD K8 Revision F processors,
-and provide 0.5 degC accuracy.
-Precision was improved in Revision
-G chips, which provide two more bits for 0.25 degC steppings.
+and provide 0.5\(deC accuracy.
+Precision was improved in Revision G chips,
+which provide two more bits for 0.25\(deC steppings.
 Each core
 has two temperature sensors, and there are up to two cores per CPU socket.
 .Pp
-AMD Barcelona, AMD Phenom, AMD Griffin, and AMD Fusion provide 0.125 degC
+AMD Barcelona, AMD Phenom, AMD Griffin, and AMD Fusion provide 0.125\(deC
 accuracy and provide one temperature sensor for each CPU socket.
 .Pp
 The
@@ -55,9 +55,9 @@ The
 driver reports temperatures through the
 .Xr envsys 4
 API.
-.Bl -column "Sensor" "Units" "Typical" -offset indent
-.It Sy "Sensor " Ta Sy "Units" Ta Sy "Typical Use"
-.It Li "CPUN sensor0" Ta "uK" Ta "cpuN temperature"
+.Bl -column "CPUN sensor0" "Units" "Typical Use" -offset indent
+.It Sy "Sensor" Ta Sy "Units" Ta Sy "Typical Use"
+.It CPU Ns Em N No sensor0 Ta \(*mK Ta cpu Ns Em N No temperature
 .El
 .Sh SEE ALSO
 .Xr envsys 4 ,



Re: CVS commit: src/sys/nfs

2018-01-25 Thread Taylor R Campbell
> Date: Thu, 25 Jan 2018 19:08:16 +0100
> From: Maxime Villard 
> 
> I noticed this issue a long time ago too. While it's clear that this hack was
> utter garbage, it wasn't essentially critical since the path that leads to 
> this
> place is privileged, and basically there's everywhere the assumption that only
> the privileged NFS daemon will invoke these syscalls.

Yes.  But even root shouldn't be allowed to control arbitrary kva
pointers, unless we want to give up on the concept of securelevel>0
altogether.


Re: CVS commit: src/sys/nfs

2018-01-25 Thread Maxime Villard

Le 25/01/2018 à 18:14, Taylor R Campbell a écrit :

Module Name:src
Committed By:   riastradh
Date:   Thu Jan 25 17:14:36 UTC 2018

Modified Files:
src/sys/nfs: nfs.h nfs_syscalls.c

Log Message:
Use a random opaque cookie, not kva pointer, for nfssvc(2).

(What were they smoking?!)

I suspect most of this is actually dead code that wasn't properly
amputated along with the rest of the gangrene of NFSKERB a decade
ago, but I'm out of time to investigate further.  If someone else
wants to kill NFSSVC_AUTHIN/NFSSVC_AUTHINFAIL and the rest of the
tentacular kerberosity, be my guest.


I noticed this issue a long time ago too. While it's clear that this hack was
utter garbage, it wasn't essentially critical since the path that leads to this
place is privileged, and basically there's everywhere the assumption that only
the privileged NFS daemon will invoke these syscalls.


CVS commit: src/bin/date

2018-01-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan 25 18:07:17 UTC 2018

Modified Files:
src/bin/date: date.1

Log Message:
sync with tzcode-2018c


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/bin/date/date.1

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

Modified files:

Index: src/bin/date/date.1
diff -u src/bin/date/date.1:1.45 src/bin/date/date.1:1.46
--- src/bin/date/date.1:1.45	Mon Jul  3 17:33:22 2017
+++ src/bin/date/date.1	Thu Jan 25 13:07:17 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: date.1,v 1.45 2017/07/03 21:33:22 wiz Exp $
+.\"	$NetBSD: date.1,v 1.46 2018/01/25 18:07:17 christos Exp $
 .\"
 .\" Copyright (c) 1980, 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -32,7 +32,7 @@
 .\"
 .\" @(#)date.1	8.3 (Berkeley) 4/28/95
 .\"
-.Dd August 11, 2016
+.Dd January 25, 2018
 .Dt DATE 1
 .Os
 .Sh NAME
@@ -166,16 +166,29 @@ See
 for more information.
 .El
 .Sh FILES
-.Bl -tag -width /var/log/messages -compact
+.Bl -tag -width /usr/share/zoneinfo/posixrules -compact
 .It Pa /etc/localtime
 Symlink pointing to system's default timezone information file in
 .Pa /usr/share/zoneinfo
 directory.
+.It Pa /usr/lib/locale//LC_TIME
+Description of time locale .
+.It Pa /usr/share/zoneinfo
+Time zone information directory.
+.It Pa /usr/share/zoneinfo/posixrules
+Used with POSIX-style TZ's.
+.It Pa /usr/share/zoneinfo/GMT
+For UTC leap seconds.
 .It Pa /var/log/wtmp
 A record of date resets and time changes.
 .It Pa /var/log/messages
 A record of the user setting the time.
 .El
+.Pp
+If 
+.Pa /usr/share/zoneinfo/GMT
+is absent, UTC leap seconds are loaded from
+.Pa /usr/share/zoneinfo/posixrules .
 .Sh EXAMPLES
 The command:
 .Bd -literal -offset indent



CVS commit: src/bin/date

2018-01-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan 25 18:07:17 UTC 2018

Modified Files:
src/bin/date: date.1

Log Message:
sync with tzcode-2018c


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/bin/date/date.1

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



CVS commit: src/sys/arch/xen/xen

2018-01-25 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Jan 25 17:41:49 UTC 2018

Modified Files:
src/sys/arch/xen/xen: if_xennet_xenbus.c

Log Message:
Don't call xennet_softstart from hard interrupt; schedule softint.

Fixes panic in bpf_mtap which expects to be called only in softint.


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/sys/arch/xen/xen/if_xennet_xenbus.c

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



CVS commit: src/sys/arch/xen/xen

2018-01-25 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Jan 25 17:41:49 UTC 2018

Modified Files:
src/sys/arch/xen/xen: if_xennet_xenbus.c

Log Message:
Don't call xennet_softstart from hard interrupt; schedule softint.

Fixes panic in bpf_mtap which expects to be called only in softint.


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/sys/arch/xen/xen/if_xennet_xenbus.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/xen/xen/if_xennet_xenbus.c
diff -u src/sys/arch/xen/xen/if_xennet_xenbus.c:1.73 src/sys/arch/xen/xen/if_xennet_xenbus.c:1.74
--- src/sys/arch/xen/xen/if_xennet_xenbus.c:1.73	Sat Nov 11 21:03:01 2017
+++ src/sys/arch/xen/xen/if_xennet_xenbus.c	Thu Jan 25 17:41:49 2018
@@ -1,4 +1,4 @@
-/*  $NetBSD: if_xennet_xenbus.c,v 1.73 2017/11/11 21:03:01 riastradh Exp $  */
+/*  $NetBSD: if_xennet_xenbus.c,v 1.74 2018/01/25 17:41:49 riastradh Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -84,7 +84,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_xennet_xenbus.c,v 1.73 2017/11/11 21:03:01 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_xennet_xenbus.c,v 1.74 2018/01/25 17:41:49 riastradh Exp $");
 
 #include "opt_xen.h"
 #include "opt_nfs_boot.h"
@@ -956,7 +956,7 @@ again:
 end:
 	if (ifp->if_flags & IFF_OACTIVE) {
 		ifp->if_flags &= ~IFF_OACTIVE;
-		xennet_softstart(sc);
+		softint_schedule(sc->sc_softintr);
 	}
 }
 



CVS commit: src/sys/nfs

2018-01-25 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Jan 25 17:14:36 UTC 2018

Modified Files:
src/sys/nfs: nfs.h nfs_syscalls.c

Log Message:
Use a random opaque cookie, not kva pointer, for nfssvc(2).

(What were they smoking?!)

I suspect most of this is actually dead code that wasn't properly
amputated along with the rest of the gangrene of NFSKERB a decade
ago, but I'm out of time to investigate further.  If someone else
wants to kill NFSSVC_AUTHIN/NFSSVC_AUTHINFAIL and the rest of the
tentacular kerberosity, be my guest.

Noted by Silvio Cesare of InfoSect.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/sys/nfs/nfs.h
cvs rdiff -u -r1.158 -r1.159 src/sys/nfs/nfs_syscalls.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/nfs/nfs.h
diff -u src/sys/nfs/nfs.h:1.76 src/sys/nfs/nfs.h:1.77
--- src/sys/nfs/nfs.h:1.76	Sun Jan 21 20:36:49 2018
+++ src/sys/nfs/nfs.h	Thu Jan 25 17:14:36 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs.h,v 1.76 2018/01/21 20:36:49 christos Exp $	*/
+/*	$NetBSD: nfs.h,v 1.77 2018/01/25 17:14:36 riastradh Exp $	*/
 /*
  * Copyright (c) 1989, 1993, 1995
  *	The Regents of the University of California.  All rights reserved.
@@ -41,6 +41,7 @@
 #include 
 #include 
 #include 
+#include 
 #endif
 
 /*
@@ -486,7 +487,7 @@ extern int nfssvc_sockhead_flag;
  * One of these structures is allocated for each nfsd.
  */
 struct nfsd {
-	TAILQ_ENTRY(nfsd) nfsd_chain;	/* List of all nfsd's */
+	struct rb_node	nfsd_node;	/* Tree of all nfsd's */
 	SLIST_ENTRY(nfsd) nfsd_idle;	/* List of idle nfsd's */
 	kcondvar_t	nfsd_cv;
 	int		nfsd_flag;	/* NFSD_ flags */
@@ -497,6 +498,7 @@ struct nfsd {
 	u_char		nfsd_verfstr[RPCVERF_MAXSIZ];
 	struct proc	*nfsd_procp;	/* Proc ptr */
 	struct nfsrv_descript *nfsd_nd;	/* Associated nfsrv_descript */
+	uint32_t	nfsd_cookie;	/* Userland cookie, fits 32bit ptr */
 };
 
 /* Bits for "nfsd_flag" */
@@ -557,7 +559,6 @@ struct nfsrv_descript {
 
 extern kmutex_t nfsd_lock;
 extern kcondvar_t nfsd_initcv;
-extern TAILQ_HEAD(nfsdhead, nfsd) nfsd_head;
 extern SLIST_HEAD(nfsdidlehead, nfsd) nfsd_idle_head;
 extern int nfsd_head_flag;
 #define	NFSD_CHECKSLP	0x01

Index: src/sys/nfs/nfs_syscalls.c
diff -u src/sys/nfs/nfs_syscalls.c:1.158 src/sys/nfs/nfs_syscalls.c:1.159
--- src/sys/nfs/nfs_syscalls.c:1.158	Sun Feb 12 18:24:31 2017
+++ src/sys/nfs/nfs_syscalls.c	Thu Jan 25 17:14:36 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_syscalls.c,v 1.158 2017/02/12 18:24:31 maxv Exp $	*/
+/*	$NetBSD: nfs_syscalls.c,v 1.159 2018/01/25 17:14:36 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nfs_syscalls.c,v 1.158 2017/02/12 18:24:31 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nfs_syscalls.c,v 1.159 2018/01/25 17:14:36 riastradh Exp $");
 
 #include 
 #include 
@@ -61,6 +61,8 @@ __KERNEL_RCSID(0, "$NetBSD: nfs_syscalls
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include 
 #include 
@@ -87,9 +89,11 @@ kmutex_t nfsd_lock;
 struct nfssvc_sockhead nfssvc_sockhead;
 kcondvar_t nfsd_initcv;
 struct nfssvc_sockhead nfssvc_sockpending;
-struct nfsdhead nfsd_head;
 struct nfsdidlehead nfsd_idle_head;
 
+static rb_tree_t nfsd_tree;
+static const rb_tree_ops_t nfsd_tree_ops;
+
 int nfssvc_sockhead_flag;
 int nfsd_head_flag;
 
@@ -102,12 +106,118 @@ static void nfsd_rt(int, struct nfsrv_de
 static int nfssvc_nfsd(struct nfssvc_copy_ops *, struct nfsd_srvargs *, void *,
 		struct lwp *);
 
+static int nfsd_compare_nodes(void *, const void *, const void *);
+static int nfsd_compare_key(void *, const void *, const void *);
+
+static struct nfsd *nfsd_bake_cookie(struct nfsd *);
+static void nfsd_toss_cookie(struct nfsd *);
+static struct nfsd *nfsd_get(struct nfsd *);
+
 static int nfssvc_addsock_in(struct nfsd_args *, const void *);
 static int nfssvc_setexports_in(struct mountd_exports_list *, const void *);
 static int nfssvc_nsd_in(struct nfsd_srvargs *, const void *);
 static int nfssvc_nsd_out(void *, const struct nfsd_srvargs *);
 static int nfssvc_exp_in(struct export_args *, const void *, size_t);
 
+static const rb_tree_ops_t nfsd_tree_ops = {
+	.rbto_compare_nodes = nfsd_compare_nodes,
+	.rbto_compare_key = nfsd_compare_key,
+	.rbto_node_offset = offsetof(struct nfsd, nfsd_node),
+};
+
+static int
+nfsd_compare_nodes(void *cookie, const void *va, const void *vb)
+{
+	const struct nfsd *na = va;
+	const struct nfsd *nb = vb;
+
+	if (na->nfsd_cookie < nb->nfsd_cookie)
+		return -1;
+	if (na->nfsd_cookie > nb->nfsd_cookie)
+		return +1;
+	return 0;
+}
+
+static int
+nfsd_compare_key(void *cookie, const void *vn, const void *vk)
+{
+	const struct nfsd *n = vn;
+	const uint32_t *k = vk;
+
+	if (n->nfsd_cookie < *k)
+		return -1;
+	if (n->nfsd_cookie > *k)
+		return +1;
+	return 0;
+}
+
+/*
+ * nfsd_bake_cookie(nfsd)
+ *
+ *	Bake a cookie for nfsd, hang it on the tree of nfsds, and
+ *	

CVS commit: src/sys/nfs

2018-01-25 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Jan 25 17:14:36 UTC 2018

Modified Files:
src/sys/nfs: nfs.h nfs_syscalls.c

Log Message:
Use a random opaque cookie, not kva pointer, for nfssvc(2).

(What were they smoking?!)

I suspect most of this is actually dead code that wasn't properly
amputated along with the rest of the gangrene of NFSKERB a decade
ago, but I'm out of time to investigate further.  If someone else
wants to kill NFSSVC_AUTHIN/NFSSVC_AUTHINFAIL and the rest of the
tentacular kerberosity, be my guest.

Noted by Silvio Cesare of InfoSect.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/sys/nfs/nfs.h
cvs rdiff -u -r1.158 -r1.159 src/sys/nfs/nfs_syscalls.c

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



CVS commit: src/sys/dev/pci

2018-01-25 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Thu Jan 25 16:05:12 UTC 2018

Modified Files:
src/sys/dev/pci: pcidevs.h pcidevs_data.h

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.1299 -r1.1300 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1298 -r1.1299 src/sys/dev/pci/pcidevs_data.h

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



CVS commit: src/sys/dev/pci

2018-01-25 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Thu Jan 25 16:02:12 UTC 2018

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Add Marvell Yukon 88E8040T


To generate a diff of this commit:
cvs rdiff -u -r1.1306 -r1.1307 src/sys/dev/pci/pcidevs

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/pci/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1306 src/sys/dev/pci/pcidevs:1.1307
--- src/sys/dev/pci/pcidevs:1.1306	Wed Jan 24 22:23:51 2018
+++ src/sys/dev/pci/pcidevs	Thu Jan 25 16:02:12 2018
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1306 2018/01/24 22:23:51 sevan Exp $
+$NetBSD: pcidevs,v 1.1307 2018/01/25 16:02:12 sborrill Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -2491,6 +2491,7 @@ product MARVELL YUKON_8036	0x4351	Yukon 
 product MARVELL YUKON_8038	0x4352	Yukon 88E8038
 product MARVELL YUKON_8039	0x4353	Yukon 88E8039
 product MARVELL YUKON_8040	0x4354	Yukon 88E8040
+product MARVELL YUKON_8040T	0x4355	Yukon 88E8040T
 product MARVELL YUKON_C033	0x4356	Yukon 88EC033
 product MARVELL YUKON_8052	0x4360	Yukon 88E8052
 product MARVELL YUKON_8050	0x4361	Yukon 88E8050



CVS commit: src/sys/dev/pci

2018-01-25 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Thu Jan 25 16:02:12 UTC 2018

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Add Marvell Yukon 88E8040T


To generate a diff of this commit:
cvs rdiff -u -r1.1306 -r1.1307 src/sys/dev/pci/pcidevs

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



CVS commit: src/sys/netinet6

2018-01-25 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Jan 25 15:55:57 UTC 2018

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

Log Message:
Remove outdated comment and fix typo.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/netinet6/frag6.c

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



CVS commit: src/sys/netinet6

2018-01-25 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Jan 25 15:55:57 UTC 2018

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

Log Message:
Remove outdated comment and fix typo.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/netinet6/frag6.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/frag6.c
diff -u src/sys/netinet6/frag6.c:1.62 src/sys/netinet6/frag6.c:1.63
--- src/sys/netinet6/frag6.c:1.62	Thu Jan 25 15:33:06 2018
+++ src/sys/netinet6/frag6.c	Thu Jan 25 15:55:57 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: frag6.c,v 1.62 2018/01/25 15:33:06 maxv Exp $	*/
+/*	$NetBSD: frag6.c,v 1.63 2018/01/25 15:55:57 maxv Exp $	*/
 /*	$KAME: frag6.c,v 1.40 2002/05/27 21:40:31 itojun Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: frag6.c,v 1.62 2018/01/25 15:33:06 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: frag6.c,v 1.63 2018/01/25 15:55:57 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -396,8 +396,7 @@ frag6_input(struct mbuf **mp, int *offp,
 
 insert:
 	/*
-	 * Stick new segment in its place. Move to front of packet queue, as
-	 * we are the most recently active fragmented packet.
+	 * Stick new segment in its place.
 	 */
 	frag6_enq(ip6af, af6->ip6af_up);
 	frag6_nfrags++;
@@ -550,7 +549,7 @@ frag6_freef(struct ip6q *q6)
 			/* adjust pointer */
 			ip6 = mtod(m, struct ip6_hdr *);
 
-			/* restoure source and destination addresses */
+			/* restore source and destination addresses */
 			ip6->ip6_src = q6->ip6q_src;
 			ip6->ip6_dst = q6->ip6q_dst;
 



CVS commit: src/sys/netinet6

2018-01-25 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Jan 25 15:33:06 UTC 2018

Modified Files:
src/sys/netinet6: frag6.c ip6_var.h

Log Message:
Several changes:

 * Move the structure definitions into frag6.c, they should not be used
   elsewhere.

 * Rename ip6af_mff -> ip6af_more, and switch it to bool, easier to
   understand.

 * Remove IP6_REASS_MBUF, no point in keeping this.

 * Remove ip6q_arrive and ip6q_nxtp, unused.

 * Style.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/netinet6/frag6.c
cvs rdiff -u -r1.75 -r1.76 src/sys/netinet6/ip6_var.h

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



CVS commit: src/sys/netinet6

2018-01-25 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Jan 25 15:33:06 UTC 2018

Modified Files:
src/sys/netinet6: frag6.c ip6_var.h

Log Message:
Several changes:

 * Move the structure definitions into frag6.c, they should not be used
   elsewhere.

 * Rename ip6af_mff -> ip6af_more, and switch it to bool, easier to
   understand.

 * Remove IP6_REASS_MBUF, no point in keeping this.

 * Remove ip6q_arrive and ip6q_nxtp, unused.

 * Style.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/netinet6/frag6.c
cvs rdiff -u -r1.75 -r1.76 src/sys/netinet6/ip6_var.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/frag6.c
diff -u src/sys/netinet6/frag6.c:1.61 src/sys/netinet6/frag6.c:1.62
--- src/sys/netinet6/frag6.c:1.61	Fri Nov 17 07:37:12 2017
+++ src/sys/netinet6/frag6.c	Thu Jan 25 15:33:06 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: frag6.c,v 1.61 2017/11/17 07:37:12 ozaki-r Exp $	*/
+/*	$NetBSD: frag6.c,v 1.62 2018/01/25 15:33:06 maxv Exp $	*/
 /*	$KAME: frag6.c,v 1.40 2002/05/27 21:40:31 itojun Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: frag6.c,v 1.61 2017/11/17 07:37:12 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: frag6.c,v 1.62 2018/01/25 15:33:06 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -58,6 +58,42 @@ __KERNEL_RCSID(0, "$NetBSD: frag6.c,v 1.
 
 #include 
 
+/*
+ * IP6 reassembly queue structure.  Each fragment
+ * being reassembled is attached to one of these structures.
+ */
+struct	ip6q {
+	u_int32_t	ip6q_head;
+	u_int16_t	ip6q_len;
+	u_int8_t	ip6q_nxt;	/* ip6f_nxt in first fragment */
+	u_int8_t	ip6q_hlim;
+	struct ip6asfrag *ip6q_down;
+	struct ip6asfrag *ip6q_up;
+	u_int32_t	ip6q_ident;
+	u_int8_t	ip6q_ttl;
+	struct in6_addr	ip6q_src, ip6q_dst;
+	struct ip6q	*ip6q_next;
+	struct ip6q	*ip6q_prev;
+	int		ip6q_unfrglen;	/* len of unfragmentable part */
+	int		ip6q_nfrag;	/* # of fragments */
+};
+
+struct	ip6asfrag {
+	u_int32_t	ip6af_head;
+	u_int16_t	ip6af_len;
+	u_int8_t	ip6af_nxt;
+	u_int8_t	ip6af_hlim;
+	/* must not override the above members during reassembling */
+	struct ip6asfrag *ip6af_down;
+	struct ip6asfrag *ip6af_up;
+	struct mbuf	*ip6af_m;
+	int		ip6af_offset;	/* offset in ip6af_m to next header */
+	int		ip6af_frglen;	/* fragmentable part length */
+	int		ip6af_off;	/* fragment offset */
+	bool		ip6af_more;	/* more fragment bit in frag off */
+};
+
+
 static void frag6_enq(struct ip6asfrag *, struct ip6asfrag *);
 static void frag6_deq(struct ip6asfrag *);
 static void frag6_insque(struct ip6q *, struct ip6q *);
@@ -68,9 +104,10 @@ static int frag6_drainwanted;
 
 u_int frag6_nfragpackets;
 u_int frag6_nfrags;
-struct	ip6q ip6q;	/* ip6 reassemble queue */
+struct ip6q ip6q;	/* ip6 reassembly queue */
 
-static kmutex_t	frag6_lock;
+/* Protects ip6q */
+static kmutex_t	frag6_lock __cacheline_aligned;
 
 /*
  * Initialise reassembly queue and fragment identifier.
@@ -172,10 +209,10 @@ frag6_input(struct mbuf **mp, int *offp,
 	offset += sizeof(struct ip6_frag);
 
 	/*
-	 * RFC6946:  A host that receives an IPv6 packet which includes 
-	 * a Fragment Header with the "Fragmen Offset" equal to 0 and 
+	 * RFC6946: A host that receives an IPv6 packet which includes
+	 * a Fragment Header with the "Fragment Offset" equal to 0 and
 	 * the "M" bit equal to 0 MUST process such packet in isolation
-	 *  from any other packets/fragments.
+	 * from any other packets/fragments.
 	 */
 	fragoff = ntohs(ip6f->ip6f_offlg & IP6F_OFF_MASK);
 	if (fragoff == 0 && !(ip6f->ip6f_offlg & IP6F_MORE_FRAG)) {
@@ -183,7 +220,7 @@ frag6_input(struct mbuf **mp, int *offp,
 		in6_ifstat_inc(dstifp, ifs6_reass_ok);
 		*offp = offset;
 		rtcache_unref(rt, );
-		return ip6f->ip6f_nxt;		
+		return ip6f->ip6f_nxt;
 	}
 
 	mutex_enter(_lock);
@@ -231,11 +268,7 @@ frag6_input(struct mbuf **mp, int *offp,
 
 		/* ip6q_nxt will be filled afterwards, from 1st fragment */
 		q6->ip6q_down	= q6->ip6q_up = (struct ip6asfrag *)q6;
-#ifdef notyet
-		q6->ip6q_nxtp	= (u_char *)nxtp;
-#endif
 		q6->ip6q_ident	= ip6f->ip6f_ident;
-		q6->ip6q_arrive = 0; /* Is it used anywhere? */
 		q6->ip6q_ttl 	= IPV6_FRAGTTL;
 		q6->ip6q_src	= ip6->ip6_src;
 		q6->ip6q_dst	= ip6->ip6_dst;
@@ -248,7 +281,6 @@ frag6_input(struct mbuf **mp, int *offp,
 	 * If it's the 1st fragment, record the length of the
 	 * unfragmentable part and the next header of the fragment header.
 	 */
-
 	if (fragoff == 0) {
 		q6->ip6q_unfrglen = offset - sizeof(struct ip6_hdr) -
 		sizeof(struct ip6_frag);
@@ -257,8 +289,8 @@ frag6_input(struct mbuf **mp, int *offp,
 
 	/*
 	 * Check that the reassembled packet would not exceed 65535 bytes
-	 * in size.
-	 * If it would exceed, discard the fragment and return an ICMP error.
+	 * in size. If it would exceed, discard the fragment and return an
+	 * ICMP error.
 	 */
 	frgpartlen = sizeof(struct ip6_hdr) + 

CVS commit: src/sys/arch/x86/pci

2018-01-25 Thread Patrick Welche
Module Name:src
Committed By:   prlw1
Date:   Thu Jan 25 15:01:05 UTC 2018

Modified Files:
src/sys/arch/x86/pci: amdzentemp.c

Log Message:
Unused variable build fix. (now void *aux is unused)


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/x86/pci/amdzentemp.c

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



CVS commit: src/sys/arch/x86/pci

2018-01-25 Thread Patrick Welche
Module Name:src
Committed By:   prlw1
Date:   Thu Jan 25 15:01:05 UTC 2018

Modified Files:
src/sys/arch/x86/pci: amdzentemp.c

Log Message:
Unused variable build fix. (now void *aux is unused)


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/x86/pci/amdzentemp.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/x86/pci/amdzentemp.c
diff -u src/sys/arch/x86/pci/amdzentemp.c:1.1 src/sys/arch/x86/pci/amdzentemp.c:1.2
--- src/sys/arch/x86/pci/amdzentemp.c:1.1	Thu Jan 25 01:22:21 2018
+++ src/sys/arch/x86/pci/amdzentemp.c	Thu Jan 25 15:01:05 2018
@@ -1,4 +1,4 @@
-/*  $NetBSD: amdzentemp.c,v 1.1 2018/01/25 01:22:21 christos Exp $ */
+/*  $NetBSD: amdzentemp.c,v 1.2 2018/01/25 15:01:05 prlw1 Exp $ */
 /*  $OpenBSD: kate.c,v 1.2 2008/03/27 04:52:03 cnst Exp $   */
 
 /*
@@ -50,7 +50,7 @@
 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amdzentemp.c,v 1.1 2018/01/25 01:22:21 christos Exp $ ");
+__KERNEL_RCSID(0, "$NetBSD: amdzentemp.c,v 1.2 2018/01/25 15:01:05 prlw1 Exp $ ");
 
 #include 
 #include 
@@ -98,8 +98,6 @@ CFATTACH_DECL_NEW(amdzentemp, sizeof(str
 static int
 amdzentemp_match(device_t parent, cfdata_t match, void *aux)
 {
-	struct pci_attach_args *pa = aux;
-
 	KASSERT(PCI_VENDOR(pa->pa_id) == PCI_VENDOR_AMD);
  
 	cfdata_t parent_cfdata = device_cfdata(parent);



CVS commit: src/sys/arch/sparc/dev

2018-01-25 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Jan 25 14:45:58 UTC 2018

Modified Files:
src/sys/arch/sparc/dev: cgfourteen.c

Log Message:
do boundary checks when writing cursor sprite colour registers


To generate a diff of this commit:
cvs rdiff -u -r1.84 -r1.85 src/sys/arch/sparc/dev/cgfourteen.c

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



CVS commit: src/sys/arch/sparc/dev

2018-01-25 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Jan 25 14:45:58 UTC 2018

Modified Files:
src/sys/arch/sparc/dev: cgfourteen.c

Log Message:
do boundary checks when writing cursor sprite colour registers


To generate a diff of this commit:
cvs rdiff -u -r1.84 -r1.85 src/sys/arch/sparc/dev/cgfourteen.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/sparc/dev/cgfourteen.c
diff -u src/sys/arch/sparc/dev/cgfourteen.c:1.84 src/sys/arch/sparc/dev/cgfourteen.c:1.85
--- src/sys/arch/sparc/dev/cgfourteen.c:1.84	Fri Jan 12 23:38:24 2018
+++ src/sys/arch/sparc/dev/cgfourteen.c	Thu Jan 25 14:45:58 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgfourteen.c,v 1.84 2018/01/12 23:38:24 macallan Exp $ */
+/*	$NetBSD: cgfourteen.c,v 1.85 2018/01/25 14:45:58 macallan Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -1120,7 +1120,11 @@ cg14_do_cursor(struct cgfourteen_softc *
 	if (cur->which & WSDISPLAY_CURSOR_DOCMAP) {
 		int i;
 		uint32_t val;
-	
+
+		if ((cur->cmap.index > 2) || (cur->cmap.count > 3) ||
+		(cur->cmap.index + cur->cmap.count > 3))
+			return EINVAL;
+
 		for (i = 0; i < min(cur->cmap.count, 3); i++) {
 			val = (cur->cmap.red[i] ) |
 			  (cur->cmap.green[i] << 8) |



CVS commit: src/share/man/man4/man4.x86

2018-01-25 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Thu Jan 25 10:52:49 UTC 2018

Modified Files:
src/share/man/man4/man4.x86: amdsmn.4

Log Message:
Xref the right driver.  .An -nosplit  Delint.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/man/man4/man4.x86/amdsmn.4

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



CVS commit: src/share/man/man4/man4.x86

2018-01-25 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Thu Jan 25 10:52:49 UTC 2018

Modified Files:
src/share/man/man4/man4.x86: amdsmn.4

Log Message:
Xref the right driver.  .An -nosplit  Delint.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/man/man4/man4.x86/amdsmn.4

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

Modified files:

Index: src/share/man/man4/man4.x86/amdsmn.4
diff -u src/share/man/man4/man4.x86/amdsmn.4:1.1 src/share/man/man4/man4.x86/amdsmn.4:1.2
--- src/share/man/man4/man4.x86/amdsmn.4:1.1	Thu Jan 25 01:25:39 2018
+++ src/share/man/man4/man4.x86/amdsmn.4	Thu Jan 25 10:52:49 2018
@@ -1,9 +1,9 @@
-.\"	$NetBSD: amdsmn.4,v 1.1 2018/01/25 01:25:39 christos Exp $
+.\"	$NetBSD: amdsmn.4,v 1.2 2018/01/25 10:52:49 uwe Exp $
 .\"
 .\" Copyright (c) 2018 Ian Clark 
 .\" All rights reserved.
 .\"
-.\" This code is derived from the FreeBSD amdsmn driver by 
+.\" This code is derived from the FreeBSD amdsmn driver by
 .\" Conrad Meyer 
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -72,16 +72,16 @@ in
 .Tn AMD
 Family 17h processors.
 .Sh SEE ALSO
-.Xr amdtemp 4
+.Xr amdzentemp 4
 .Sh HISTORY
-The 
+The
 .Nm
 driver first appeared in
 .Fx .
-
 .Sh AUTHORS
+.An -nosplit
 Based on the
-.Fx 
+.Fx
 driver by
 .An Conrad Meyer .
 It was adapted to



CVS commit: src/share/man/man4/man4.x86

2018-01-25 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Thu Jan 25 10:48:28 UTC 2018

Modified Files:
src/share/man/man4/man4.x86: amdzentemp.4

Log Message:
New sentence - new line.  Sort sections.  Use .Xr to refer to amdtemp(4).


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/share/man/man4/man4.x86/amdzentemp.4

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



CVS commit: src/share/man/man4/man4.x86

2018-01-25 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Thu Jan 25 10:48:28 UTC 2018

Modified Files:
src/share/man/man4/man4.x86: amdzentemp.4

Log Message:
New sentence - new line.  Sort sections.  Use .Xr to refer to amdtemp(4).


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/share/man/man4/man4.x86/amdzentemp.4

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

Modified files:

Index: src/share/man/man4/man4.x86/amdzentemp.4
diff -u src/share/man/man4/man4.x86/amdzentemp.4:1.4 src/share/man/man4/man4.x86/amdzentemp.4:1.5
--- src/share/man/man4/man4.x86/amdzentemp.4:1.4	Thu Jan 25 10:28:57 2018
+++ src/share/man/man4/man4.x86/amdzentemp.4	Thu Jan 25 10:48:27 2018
@@ -1,4 +1,4 @@
-.\" $NetBSD: amdzentemp.4,v 1.4 2018/01/25 10:28:57 pgoyette Exp $
+.\" $NetBSD: amdzentemp.4,v 1.5 2018/01/25 10:48:27 uwe Exp $
 .\"-
 .\" Copyright (c) 2008 Christoph Egger
 .\" All rights reserved.
@@ -40,8 +40,8 @@ The
 driver provides support for the on-die digital thermal sensor present
 on AMD Ryzen CPUs
 .Pp
-These sensors provide 0.125\(deC accuracy. There is one sensor for each
-CPU socket.
+These sensors provide 0.125\(deC accuracy.
+There is one sensor for each CPU socket.
 .Pp
 The
 .Nm
@@ -57,17 +57,6 @@ API.
 .Xr envsys 4 ,
 .Xr envstat 8 ,
 .Xr powerd 8
-.Sh BUGS
-The temperature reading provided to
-.Xr envsys 4
-needs to have a CPU-dependent offset applied.
-For Ryzen X processors, the offset is 20\(deC, while for Threadripper
-processors an offset of 27\(deC is needed.
-.Pp
-The sensor has a thermal-trip value which should be retrieved and
-provided to
-.Xr envsys 4
-as the sensors critical-maximum value.
 .Sh HISTORY
 The
 .Nm
@@ -78,7 +67,7 @@ named
 It was then ported to
 .Nx 5.0
 under the name
-.Dq amdtemp .
+.Xr amdtemp 4 .
 The
 .Fx
 version of the driver was updated with support for newer AMD CPUs.
@@ -98,3 +87,14 @@ Porting of support for the newer AMD CPU
 .Fx
 was provided by
 .An Ian Clark .
+.Sh BUGS
+The temperature reading provided to
+.Xr envsys 4
+needs to have a CPU-dependent offset applied.
+For Ryzen X processors, the offset is 20\(deC, while for Threadripper
+processors an offset of 27\(deC is needed.
+.Pp
+The sensor has a thermal-trip value which should be retrieved and
+provided to
+.Xr envsys 4
+as the sensors critical-maximum value.



CVS commit: src/sys

2018-01-25 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Jan 25 10:45:58 UTC 2018

Modified Files:
src/sys/netinet: in_l2tp.c
src/sys/netinet6: in6_l2tp.c

Log Message:
Style, reduce the indentation level when possible, and add a missing NULL
check after M_PREPEND.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/netinet/in_l2tp.c
cvs rdiff -u -r1.12 -r1.13 src/sys/netinet6/in6_l2tp.c

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



CVS commit: src/sys

2018-01-25 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Jan 25 10:45:58 UTC 2018

Modified Files:
src/sys/netinet: in_l2tp.c
src/sys/netinet6: in6_l2tp.c

Log Message:
Style, reduce the indentation level when possible, and add a missing NULL
check after M_PREPEND.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/netinet/in_l2tp.c
cvs rdiff -u -r1.12 -r1.13 src/sys/netinet6/in6_l2tp.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/netinet/in_l2tp.c
diff -u src/sys/netinet/in_l2tp.c:1.10 src/sys/netinet/in_l2tp.c:1.11
--- src/sys/netinet/in_l2tp.c:1.10	Mon Jan 22 09:51:06 2018
+++ src/sys/netinet/in_l2tp.c	Thu Jan 25 10:45:58 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: in_l2tp.c,v 1.10 2018/01/22 09:51:06 maxv Exp $	*/
+/*	$NetBSD: in_l2tp.c,v 1.11 2018/01/25 10:45:58 maxv Exp $	*/
 
 /*
  * Copyright (c) 2017 Internet Initiative Japan Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: in_l2tp.c,v 1.10 2018/01/22 09:51:06 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in_l2tp.c,v 1.11 2018/01/25 10:45:58 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_l2tp.h"
@@ -113,7 +113,16 @@ in_l2tp_output(struct l2tp_variant *var,
 		goto looped;
 	}
 
-#ifdef NETYET
+	/* bidirectional configured tunnel mode */
+	if (sin_dst->sin_addr.s_addr == INADDR_ANY) {
+		m_freem(m);
+		if ((ifp->if_flags & IFF_DEBUG) != 0)
+			log(LOG_DEBUG, "%s: ENETUNREACH\n", __func__);
+		error = ENETUNREACH;
+		goto out;
+	}
+
+#ifdef NOTYET
 /* TODO: support ALTQ for innner frame */
 #ifdef ALTQ
 	ALTQ_SAVE_PAYLOAD(m, AF_ETHER);
@@ -122,16 +131,7 @@ in_l2tp_output(struct l2tp_variant *var,
 
 	memset(, 0, sizeof(iphdr));
 	iphdr.ip_src = sin_src->sin_addr;
-	/* bidirectional configured tunnel mode */
-	if (sin_dst->sin_addr.s_addr != INADDR_ANY)
-		iphdr.ip_dst = sin_dst->sin_addr;
-	else {
-		m_freem(m);
-		if ((ifp->if_flags & IFF_DEBUG) != 0)
-			log(LOG_DEBUG, "%s: ENETUNREACH\n", __func__);
-		error = ENETUNREACH;
-		goto out;
-	}
+	iphdr.ip_dst = sin_dst->sin_addr;
 	iphdr.ip_p = IPPROTO_L2TP;
 	/* version will be set in ip_output() */
 	iphdr.ip_ttl = ip_l2tp_ttl;
@@ -152,11 +152,12 @@ in_l2tp_output(struct l2tp_variant *var,
 		goto out;
 	}
 #endif
+
 	/*
-	 * payload length
-	 *  NOTE: Payload length may be changed in ip_tcpmss().
-	 *Typical case is missing of TCP mss option in original
-	 *TCP header.
+	 * Payload length.
+	 *
+	 * NOTE: payload length may be changed in ip_tcpmss(). Typical case
+	 * is missing of TCP mss option in original TCP header.
 	 */
 	iphdr.ip_len += m->m_pkthdr.len;
 	HTONS(iphdr.ip_len);
@@ -174,12 +175,10 @@ in_l2tp_output(struct l2tp_variant *var,
 		}
 		if (var->lv_peer_cookie_len == 4) {
 			cookie_32 = htonl((uint32_t)var->lv_peer_cookie);
-			memcpy(mtod(m, void *), _32,
-			sizeof(uint32_t));
+			memcpy(mtod(m, void *), _32, sizeof(uint32_t));
 		} else {
 			cookie_64 = htobe64(var->lv_peer_cookie);
-			memcpy(mtod(m, void *), _64,
-			sizeof(uint64_t));
+			memcpy(mtod(m, void *), _64, sizeof(uint64_t));
 		}
 	}
 
@@ -291,28 +290,28 @@ in_l2tp_input(struct mbuf *m, int off, i
 		m_freem(m);
 		ip_statinc(IP_STAT_NOL2TP);
 		return;
-	} else {
-		sc = var->lv_softc;
-		l2tpp = &(sc->l2tp_ec.ec_if);
+	}
+
+	sc = var->lv_softc;
+	l2tpp = &(sc->l2tp_ec.ec_if);
 
-		if (l2tpp == NULL || (l2tpp->if_flags & IFF_UP) == 0) {
+	if (l2tpp == NULL || (l2tpp->if_flags & IFF_UP) == 0) {
 #ifdef L2TP_DEBUG
-			if (l2tpp == NULL)
-log(LOG_DEBUG, "%s: l2tpp is NULL\n", __func__);
-			else
-log(LOG_DEBUG, "%s: l2tpp is down\n", __func__);
+		if (l2tpp == NULL)
+			log(LOG_DEBUG, "%s: l2tpp is NULL\n", __func__);
+		else
+			log(LOG_DEBUG, "%s: l2tpp is down\n", __func__);
 #endif
-			m_freem(m);
-			ip_statinc(IP_STAT_NOL2TP);
-			goto out;
-		}
+		m_freem(m);
+		ip_statinc(IP_STAT_NOL2TP);
+		goto out;
+	}
 
-		/* other CPU do l2tp_delete_tunnel */
-		if (var->lv_psrc == NULL || var->lv_pdst == NULL) {
-			m_freem(m);
-			ip_statinc(IP_STAT_NOL2TP);
-			goto out;
-		}
+	/* other CPU did l2tp_delete_tunnel */
+	if (var->lv_psrc == NULL || var->lv_pdst == NULL) {
+		m_freem(m);
+		ip_statinc(IP_STAT_NOL2TP);
+		goto out;
 	}
 
 	if (var->lv_state != L2TP_STATE_UP) {

Index: src/sys/netinet6/in6_l2tp.c
diff -u src/sys/netinet6/in6_l2tp.c:1.12 src/sys/netinet6/in6_l2tp.c:1.13
--- src/sys/netinet6/in6_l2tp.c:1.12	Mon Dec 18 03:21:44 2017
+++ src/sys/netinet6/in6_l2tp.c	Thu Jan 25 10:45:58 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: in6_l2tp.c,v 1.12 2017/12/18 03:21:44 knakahara Exp $	*/
+/*	$NetBSD: in6_l2tp.c,v 1.13 2018/01/25 10:45:58 maxv Exp $	*/
 
 /*
  * Copyright (c) 2017 Internet Initiative Japan Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: in6_l2tp.c,v 1.12 2017/12/18 03:21:44 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6_l2tp.c,v 1.13 2018/01/25 10:45:58 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include 

CVS commit: src/sys/net

2018-01-25 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Jan 25 10:33:37 UTC 2018

Modified Files:
src/sys/net: if_l2tp.c

Log Message:
style


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/net/if_l2tp.c

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



CVS commit: src/sys/net

2018-01-25 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Jan 25 10:33:37 UTC 2018

Modified Files:
src/sys/net: if_l2tp.c

Log Message:
style


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/net/if_l2tp.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/net/if_l2tp.c
diff -u src/sys/net/if_l2tp.c:1.17 src/sys/net/if_l2tp.c:1.18
--- src/sys/net/if_l2tp.c:1.17	Tue Dec 19 03:32:35 2017
+++ src/sys/net/if_l2tp.c	Thu Jan 25 10:33:37 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_l2tp.c,v 1.17 2017/12/19 03:32:35 ozaki-r Exp $	*/
+/*	$NetBSD: if_l2tp.c,v 1.18 2018/01/25 10:33:37 maxv Exp $	*/
 
 /*
  * Copyright (c) 2017 Internet Initiative Japan Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_l2tp.c,v 1.17 2017/12/19 03:32:35 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_l2tp.c,v 1.18 2018/01/25 10:33:37 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -496,18 +496,18 @@ l2tp_input(struct mbuf *m, struct ifnet 
 		M_COPY_PKTHDR(m_head, m);
 
 		m_head->m_data += 2 /* align */ + L2TP_LINK_HDR_ROOM;
-		memcpy(m_head->m_data, m->m_data, copy_length);
+		memcpy(mtod(m_head, void *), mtod(m, void *), copy_length);
 		m_head->m_len = copy_length;
 		m->m_data += copy_length;
 		m->m_len -= copy_length;
 
 		/* construct chain */
 		if (m->m_len == 0) {
-			m_head->m_next = m_free(m); /* not m_freem */
+			m_head->m_next = m_free(m);
 		} else {
 			/*
-			 * copyed mtag in previous call M_COPY_PKTHDR
-			 * but don't delete mtag in case cutt of M_PKTHDR flag
+			 * Already copied mtag with M_COPY_PKTHDR.
+			 * but don't delete mtag in case cut off M_PKTHDR flag
 			 */
 			m_tag_delete_chain(m, NULL);
 			m->m_flags &= ~M_PKTHDR;
@@ -1366,80 +1366,85 @@ static struct mbuf *l2tp_tcpmss6_clamp(s
 #endif
 
 struct mbuf *
-l2tp_tcpmss_clamp(struct ifnet *ifp, struct mbuf	*m)
+l2tp_tcpmss_clamp(struct ifnet *ifp, struct mbuf *m)
 {
+	struct ether_header *eh;
+	struct ether_vlan_header evh;
 
-	if (l2tp_need_tcpmss_clamp(ifp)) {
-		struct ether_header *eh;
-		struct ether_vlan_header evh;
-
-		/* save ether header */
-		m_copydata(m, 0, sizeof(evh), (void *));
-		eh = (struct ether_header *)
-
-		switch (ntohs(eh->ether_type)) {
-		case ETHERTYPE_VLAN: /* Ether + VLAN */
-			if (m->m_pkthdr.len <= sizeof(struct ether_vlan_header))
-break;
-			m_adj(m, sizeof(struct ether_vlan_header));
-			switch (ntohs(evh.evl_proto)) {
-#ifdef INET
-			case ETHERTYPE_IP: /* Ether + VLAN + IPv4 */
-m = l2tp_tcpmss4_clamp(ifp, m);
-if (m == NULL)
-	return NULL;
-break;
-#endif /* INET */
-#ifdef INET6
-			case ETHERTYPE_IPV6: /* Ether + VLAN + IPv6 */
-m = l2tp_tcpmss6_clamp(ifp, m);
-if (m == NULL)
-	return NULL;
-break;
-#endif /* INET6 */
-			default:
-break;
-			}
-			/* restore ether header */
-			M_PREPEND(m, sizeof(struct ether_vlan_header),
-			M_DONTWAIT);
-			if (m == NULL)
-return NULL;
-			*mtod(m, struct ether_vlan_header *) = evh;
+	if (!l2tp_need_tcpmss_clamp(ifp)) {
+		return m;
+	}
+
+	/* save ether header */
+	m_copydata(m, 0, sizeof(evh), (void *));
+	eh = (struct ether_header *)
+
+	switch (ntohs(eh->ether_type)) {
+	case ETHERTYPE_VLAN: /* Ether + VLAN */
+		if (m->m_pkthdr.len <= sizeof(struct ether_vlan_header))
 			break;
+		m_adj(m, sizeof(struct ether_vlan_header));
+		switch (ntohs(evh.evl_proto)) {
 #ifdef INET
-		case ETHERTYPE_IP: /* Ether + IPv4 */
-			if (m->m_pkthdr.len <= sizeof(struct ether_header))
-break;
-			m_adj(m, sizeof(struct ether_header));
+		case ETHERTYPE_IP: /* Ether + VLAN + IPv4 */
 			m = l2tp_tcpmss4_clamp(ifp, m);
 			if (m == NULL)
 return NULL;
-			/* restore ether header */
-			M_PREPEND(m, sizeof(struct ether_header), M_DONTWAIT);
-			if (m == NULL)
-return NULL;
-			*mtod(m, struct ether_header *) = *eh;
 			break;
 #endif /* INET */
 #ifdef INET6
-		case ETHERTYPE_IPV6: /* Ether + IPv6 */
-			if (m->m_pkthdr.len <= sizeof(struct ether_header))
-break;
-			m_adj(m, sizeof(struct ether_header));
+		case ETHERTYPE_IPV6: /* Ether + VLAN + IPv6 */
 			m = l2tp_tcpmss6_clamp(ifp, m);
 			if (m == NULL)
 return NULL;
-			/* restore ether header */
-			M_PREPEND(m, sizeof(struct ether_header), M_DONTWAIT);
-			if (m == NULL)
-return NULL;
-			*mtod(m, struct ether_header *) = *eh;
 			break;
 #endif /* INET6 */
 		default:
 			break;
 		}
+
+		/* restore ether header */
+		M_PREPEND(m, sizeof(struct ether_vlan_header),
+		M_DONTWAIT);
+		if (m == NULL)
+			return NULL;
+		*mtod(m, struct ether_vlan_header *) = evh;
+		break;
+
+#ifdef INET
+	case ETHERTYPE_IP: /* Ether + IPv4 */
+		if (m->m_pkthdr.len <= sizeof(struct ether_header))
+			break;
+		m_adj(m, sizeof(struct ether_header));
+		m = l2tp_tcpmss4_clamp(ifp, m);
+		if (m == NULL)
+			return NULL;
+		/* restore ether header */
+		M_PREPEND(m, sizeof(struct ether_header), M_DONTWAIT);
+		if (m == 

CVS commit: src/share/man/man4/man4.x86

2018-01-25 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Jan 25 10:28:57 UTC 2018

Modified Files:
src/share/man/man4/man4.x86: amdzentemp.4

Log Message:
Add missing article 'a'


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/share/man/man4/man4.x86/amdzentemp.4

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

Modified files:

Index: src/share/man/man4/man4.x86/amdzentemp.4
diff -u src/share/man/man4/man4.x86/amdzentemp.4:1.3 src/share/man/man4/man4.x86/amdzentemp.4:1.4
--- src/share/man/man4/man4.x86/amdzentemp.4:1.3	Thu Jan 25 10:15:24 2018
+++ src/share/man/man4/man4.x86/amdzentemp.4	Thu Jan 25 10:28:57 2018
@@ -1,4 +1,4 @@
-.\" $NetBSD: amdzentemp.4,v 1.3 2018/01/25 10:15:24 uwe Exp $
+.\" $NetBSD: amdzentemp.4,v 1.4 2018/01/25 10:28:57 pgoyette Exp $
 .\"-
 .\" Copyright (c) 2008 Christoph Egger
 .\" All rights reserved.
@@ -64,7 +64,7 @@ needs to have a CPU-dependent offset app
 For Ryzen X processors, the offset is 20\(deC, while for Threadripper
 processors an offset of 27\(deC is needed.
 .Pp
-The sensor has thermal-trip value which should be retrieved and
+The sensor has a thermal-trip value which should be retrieved and
 provided to
 .Xr envsys 4
 as the sensors critical-maximum value.



CVS commit: src/share/man/man4/man4.x86

2018-01-25 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Jan 25 10:28:57 UTC 2018

Modified Files:
src/share/man/man4/man4.x86: amdzentemp.4

Log Message:
Add missing article 'a'


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/share/man/man4/man4.x86/amdzentemp.4

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



CVS commit: src/share/man/man4/man4.x86

2018-01-25 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Thu Jan 25 10:15:24 UTC 2018

Modified Files:
src/share/man/man4/man4.x86: amdzentemp.4

Log Message:
Fix .Dt name.  Formatting fixes.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/share/man/man4/man4.x86/amdzentemp.4

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



CVS commit: src/share/man/man4/man4.x86

2018-01-25 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Thu Jan 25 10:15:24 UTC 2018

Modified Files:
src/share/man/man4/man4.x86: amdzentemp.4

Log Message:
Fix .Dt name.  Formatting fixes.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/share/man/man4/man4.x86/amdzentemp.4

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

Modified files:

Index: src/share/man/man4/man4.x86/amdzentemp.4
diff -u src/share/man/man4/man4.x86/amdzentemp.4:1.2 src/share/man/man4/man4.x86/amdzentemp.4:1.3
--- src/share/man/man4/man4.x86/amdzentemp.4:1.2	Thu Jan 25 08:41:17 2018
+++ src/share/man/man4/man4.x86/amdzentemp.4	Thu Jan 25 10:15:24 2018
@@ -1,4 +1,4 @@
-.\" $NetBSD: amdzentemp.4,v 1.2 2018/01/25 08:41:17 pgoyette Exp $
+.\" $NetBSD: amdzentemp.4,v 1.3 2018/01/25 10:15:24 uwe Exp $
 .\"-
 .\" Copyright (c) 2008 Christoph Egger
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" $FreeBSD: src/share/man/man4/coretemp.4,v 1.4 2007/10/15 20:00:19 netchild Exp $
 .\"
 .Dd January 24, 2018
-.Dt AMDTEMP 4 x86
+.Dt AMDZENTEMP 4 x86
 .Os
 .Sh NAME
 .Nm amdzentemp
@@ -40,7 +40,7 @@ The
 driver provides support for the on-die digital thermal sensor present
 on AMD Ryzen CPUs
 .Pp
-These sensors provide 0.125 degC accuracy. There is one sensor for each
+These sensors provide 0.125\(deC accuracy. There is one sensor for each
 CPU socket.
 .Pp
 The
@@ -48,9 +48,9 @@ The
 driver reports temperatures through the
 .Xr envsys 4
 API.
-.Bl -column "Sensor" "Units" "Typical" -offset indent
-.It Sy "Sensor " Ta Sy "Units" Ta Sy "Typical Use"
-.It Li "CPUN sensor0" Ta "uK" Ta "cpuN temperature"
+.Bl -column "CPUN sensor0" "Units" "Typical Use" -offset indent
+.It Sy "Sensor" Ta Sy "Units" Ta Sy "Typical Use"
+.It CPU Ns Em N No sensor0 Ta \(*mK Ta cpu Ns Em N No temperature
 .El
 .Sh SEE ALSO
 .Xr amdtemp 4 ,
@@ -60,9 +60,9 @@ API.
 .Sh BUGS
 The temperature reading provided to
 .Xr envsys 4
-needs to have a CPU-dependant offset applied.
-For Ryzen X processors, the offset is 20C, while for Threadripper
-processors an offset of 27C is needed.
+needs to have a CPU-dependent offset applied.
+For Ryzen X processors, the offset is 20\(deC, while for Threadripper
+processors an offset of 27\(deC is needed.
 .Pp
 The sensor has thermal-trip value which should be retrieved and
 provided to



CVS commit: src/share/man/man9

2018-01-25 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Jan 25 09:33:21 UTC 2018

Modified Files:
src/share/man/man9: mbuf.9

Log Message:
Improve wording.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/share/man/man9/mbuf.9

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



CVS commit: src/share/man/man9

2018-01-25 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Jan 25 09:33:21 UTC 2018

Modified Files:
src/share/man/man9: mbuf.9

Log Message:
Improve wording.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/share/man/man9/mbuf.9

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

Modified files:

Index: src/share/man/man9/mbuf.9
diff -u src/share/man/man9/mbuf.9:1.55 src/share/man/man9/mbuf.9:1.56
--- src/share/man/man9/mbuf.9:1.55	Mon Jan 22 10:40:36 2018
+++ src/share/man/man9/mbuf.9	Thu Jan 25 09:33:21 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: mbuf.9,v 1.55 2018/01/22 10:40:36 maxv Exp $
+.\"	$NetBSD: mbuf.9,v 1.56 2018/01/25 09:33:21 maxv Exp $
 .\"
 .\" Copyright (c) 1997 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd January 22, 2018
+.Dd January 25, 2018
 .Dt MBUF 9
 .Os
 .Sh NAME
@@ -466,7 +466,7 @@ Returns
 .Dv NULL
 and frees the mbuf chain on failure.
 .Fa len
-must be smaller or equal than
+must be smaller than or equal to
 .Dv MCLBYTES .
 .It Fn m_pullup "struct mbuf *m" "int len"
 Rearranges an mbuf chain so that



CVS commit: src/share/man/man4

2018-01-25 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Jan 25 09:29:18 UTC 2018

Modified Files:
src/share/man/man4: ipsecif.4

Log Message:
Improve wording, and put a new drawing, from me and Kengo Nakahara.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/share/man/man4/ipsecif.4

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



CVS commit: src/share/man/man4

2018-01-25 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Jan 25 09:29:18 UTC 2018

Modified Files:
src/share/man/man4: ipsecif.4

Log Message:
Improve wording, and put a new drawing, from me and Kengo Nakahara.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/share/man/man4/ipsecif.4

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

Modified files:

Index: src/share/man/man4/ipsecif.4
diff -u src/share/man/man4/ipsecif.4:1.4 src/share/man/man4/ipsecif.4:1.5
--- src/share/man/man4/ipsecif.4:1.4	Thu Jan 11 08:59:27 2018
+++ src/share/man/man4/ipsecif.4	Thu Jan 25 09:29:18 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ipsecif.4,v 1.4 2018/01/11 08:59:27 wiz Exp $
+.\"	$NetBSD: ipsecif.4,v 1.5 2018/01/25 09:29:18 maxv Exp $
 .\"
 .\" Copyright (C) 2017 Internet Initiative Japan Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd January 11, 2018
+.Dd January 25, 2018
 .Dt IPSECIF 4
 .Os
 .Sh NAME
@@ -54,7 +54,7 @@ The administrator must configure
 tunnel endpoint addresses.
 These addresses will be used for the outer IP header of ESP packets.
 The administrator also configures the protocol
-and addresses for the inner IP header with
+and addresses for the inner IP header with the
 .Xr ifconfig 8
 .Cm inet
 or
@@ -68,22 +68,20 @@ The packet processing is similar to
 .Xr gif 4
 over
 .Xr ipsec 4
-transport mode, however their security policy managements are different.
+transport mode, however the security policy management is different.
 .Xr gif 4
 over
 .Xr ipsec 4
-transport mode expects for userland programs to managed its
+transport mode expects userland programs to manage their
 security policies.
 In contrast,
 .Nm
-manages its security policies by itself, that is, when the administrator
-sets up a
+manages its security policies by itself: when the administrator
+sets up an
 .Nm
 tunnel source and destination address pair, the related security policies
 are created automatically in the kernel.
-Therefore, the security policies of
-.Nm
-are added/deleted atomically.
+They are automatically deleted when the tunnel is destroyed.
 .Pp
 It also means that
 .Nm
@@ -93,9 +91,9 @@ avoids the trouble caused when only one 
 policy pair exists.
 .Pp
 There are four security policies generated by
-.Nm ,
-that is, one in and out pair for IPv4 and IPv6 each.
-These security policies equal to the following
+.Nm :
+one in and out pair for IPv4 and IPv6 each.
+These security policies are equivalent to the following
 .Xr ipsec.conf 5
 configuration where src and dst are IP addresses specified to the tunnel:
 .Bd -literal -offset indent
@@ -105,9 +103,9 @@ spdadd "src" "dst" ipv6 -P out ipsec esp
 spdadd "dst" "src" ipv6 -P in ipsec esp/transport//unique;
 .Ed
 .Pp
-Therefore,
+The
 .Nm
-configuration will fail if you already added such security policies, and
+configuration will fail if such security policies already exist, and
 vice versa.
 .Pp
 The related security associates can be established by an IKE daemon such as
@@ -120,9 +118,8 @@ option which sets a security policy's un
 .Pp
 Some
 .Xr ifconfig 8
-parameters change
-.Nm Ap s
-behaviour.
+parameters change the behaviour of
+.Nm .
 link0 can enable NAT-Traversal,
 link1 can enable ECN friendly mode like
 .Xr gif 4 ,
@@ -138,15 +135,28 @@ to reduce security associates for IPv6 p
 .Sh EXAMPLES
 Configuration example:
 .Bd -literal
-Host X--NetBSD A  tunnel-- NetBSD B--Host E
-   \\  |
-\\/
- +-Router BRouter C-+
+Out IP addr = 172.16.100.1Out IP addr = 172.16.200.1
+wm0 = 192.168.0.1/24wm0 = 192.168.0.2/24
+wm1 = 10.100.0.1/24  wm1 = 10.200.0.1/24
+
+++++
+|  NetBSD_A  ||  NetBSD_B  |
+||||
+|  [ipsec0] - - - - - - - - (tunnel) - - - - - - - - [ipsec0]  |
+|  [wm0]- ... --[wm0]  |
+||||
++---[wm1]++[wm1]---+
+  |  |
+  |  |
+++++
+|   Host_X   ||   Host_Y   |
+++++
 .Ed
 .Pp
-On
-.Nx
-system A
+Host_X and Host_Y will be able to communicate via an IPv4 IPsec
+tunnel.
+.Pp
+On NetBSD_A:
 .Bd -literal
 # ifconfig wm0 inet 192.168.0.1/24
 # ifconfig ipsec0 create
@@ -157,9 +167,7 @@ start IKE daemon or set security associa
 # 

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

2018-01-25 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Jan 25 08:57:59 UTC 2018

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

Log Message:
Revert previous.

obsolete + other tags is not easy to clean up.


To generate a diff of this commit:
cvs rdiff -u -r1.236 -r1.237 src/distrib/sets/lists/debug/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/debug/mi
diff -u src/distrib/sets/lists/debug/mi:1.236 src/distrib/sets/lists/debug/mi:1.237
--- src/distrib/sets/lists/debug/mi:1.236	Wed Jan 24 09:51:26 2018
+++ src/distrib/sets/lists/debug/mi	Thu Jan 25 08:57:59 2018
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.236 2018/01/24 09:51:26 wiz Exp $
+# $NetBSD: mi,v 1.237 2018/01/25 08:57:59 wiz Exp $
 ./etc/mtree/set.debug   comp-sys-root
 ./usr/lib	comp-sys-usr		compatdir
 ./usr/lib/i18n/libBIG5_g.a			comp-c-debuglib		debuglib,compatfile
@@ -43,9 +43,9 @@
 ./usr/lib/libcompat_g.acomp-c-debuglib		debuglib,compatfile
 ./usr/lib/libcrypt_g.acomp-c-debuglib		debuglib,compatfile
 ./usr/lib/libcrypto_g.acomp-c-debuglib		debuglib,compatfile
-./usr/lib/libcrypto_idea_g.a			comp-obsolete		obsolete
-./usr/lib/libcrypto_mdc2_g.a			comp-obsolete		obsolete
-./usr/lib/libcrypto_rc5_g.a			comp-obsolete		obsolete
+./usr/lib/libcrypto_idea_g.a			comp-obsolete		obsolete,compatfile
+./usr/lib/libcrypto_mdc2_g.a			comp-obsolete		obsolete,compatfile
+./usr/lib/libcrypto_rc5_g.a			comp-obsolete		obsolete,compatfile
 ./usr/lib/libctf_g.acomp-c-debuglib		debuglib,compatfile,ctf
 ./usr/lib/libcurses_g.acomp-c-debuglib		debuglib,compatfile
 ./usr/lib/libdes_g.acomp-c-debuglib		debuglib,compatfile
@@ -76,7 +76,7 @@
 ./usr/lib/libheimbase_g.a			comp-c-debuglib		debuglib,compatfile,kerberos
 ./usr/lib/libheimntlm_g.a			comp-c-debuglib		debuglib,compatfile,kerberos
 ./usr/lib/libhx509_g.acomp-c-debuglib		debuglib,compatfile,kerberos
-./usr/lib/libiberty_g.acomp-obsolete		obsolete
+./usr/lib/libiberty_g.acomp-obsolete		obsolete,compatfile,binutils
 ./usr/lib/libintl_g.acomp-c-debuglib		debuglib,compatfile
 ./usr/lib/libipsec_g.acomp-c-debuglib		debuglib,compatfile
 ./usr/lib/libirs_g.acomp-c-debuglib		debuglib,compatfile
@@ -111,13 +111,13 @@
 ./usr/lib/libnvpair_g.acomp-c-debuglib		debuglib,zfs,compatfile
 ./usr/lib/libobjc_g.acomp-c-debuglib		debuglib,gcc,compatfile
 ./usr/lib/libopcodes_g.a			comp-c-debuglib		debuglib,compatfile,binutils
-./usr/lib/libopenpgpsdk_g.a			comp-obsolete		obsolete
+./usr/lib/libopenpgpsdk_g.a			comp-obsolete		obsolete,compatfile
 ./usr/lib/libossaudio_g.a			comp-c-debuglib		debuglib,compatfile
 ./usr/lib/libp2k_g.acomp-c-debuglib		debuglib,compatfile,rump
 ./usr/lib/libpam_g.acomp-c-debuglib		debuglib,compatfile,pam
 ./usr/lib/libpanel_g.acomp-c-debuglib		debuglib,compatfile
 ./usr/lib/libpcap_g.acomp-c-debuglib		debuglib,compatfile
-./usr/lib/libpcc_g.acomp-obsolete		obsolete
+./usr/lib/libpcc_g.acomp-obsolete		obsolete,compatfile
 ./usr/lib/libpci_g.acomp-c-debuglib		debuglib,compatfile
 ./usr/lib/libperfuse_g.a			comp-c-debuglib		debuglib,compatfile
 ./usr/lib/libposix_g.acomp-c-debuglib		debuglib,compatfile
@@ -139,8 +139,8 @@
 ./usr/lib/librtld_db_g.a			comp-c-debuglib		debuglib,compatfile,dtrace
 ./usr/lib/librump_g.acomp-c-debuglib		debuglib,compatfile,rump
 ./usr/lib/librumpclient_g.a			comp-c-debuglib		debuglib,compatfile,rump
-./usr/lib/librumpcrypto_g.a			comp-obsolete		obsolete
-./usr/lib/librumpdev_audio_ac97_g.a		comp-obsolete		obsolete
+./usr/lib/librumpcrypto_g.a			comp-obsolete		obsolete,compatfile
+./usr/lib/librumpdev_audio_ac97_g.a		comp-obsolete		obsolete,compatfile
 ./usr/lib/librumpdev_audio_g.a			comp-c-debuglib		debuglib,rump
 ./usr/lib/librumpdev_bpf_g.a			comp-c-debuglib		debuglib,rump
 ./usr/lib/librumpdev_cgd_g.a			comp-c-debuglib		debuglib,rump
@@ -158,7 +158,7 @@
 ./usr/lib/librumpdev_raidframe_g.a		comp-c-debuglib		debuglib,rump
 ./usr/lib/librumpdev_rnd_g.a			comp-c-debuglib		debuglib,rump
 ./usr/lib/librumpdev_scsipi_g.a			comp-c-debuglib		debuglib,rump
-./usr/lib/librumpdev_scsitest_g.a		comp-obsolete		obsolete
+./usr/lib/librumpdev_scsitest_g.a		comp-obsolete		obsolete,compatfile
 ./usr/lib/librumpdev_sysmon_g.a			comp-c-debuglib		debuglib,rump
 ./usr/lib/librumpdev_ualea_g.a			comp-c-debuglib		debuglib,rump
 ./usr/lib/librumpdev_ubt_g.a			comp-c-debuglib		debuglib,rump
@@ -184,26 +184,26 @@
 ./usr/lib/librumpfs_nilfs_g.a			comp-c-debuglib		debuglib,rump
 ./usr/lib/librumpfs_ntfs_g.a			comp-c-debuglib		debuglib,rump
 ./usr/lib/librumpfs_null_g.a			comp-c-debuglib		debuglib,rump
-./usr/lib/librumpfs_nullfs_g.a			comp-obsolete		obsolete
+./usr/lib/librumpfs_nullfs_g.a			comp-obsolete		obsolete,compatfile
 ./usr/lib/librumpfs_ptyfs_g.a			comp-c-debuglib		debuglib,rump
 ./usr/lib/librumpfs_smbfs_g.a			comp-c-debuglib		debuglib,rump
 

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

2018-01-25 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Jan 25 08:57:59 UTC 2018

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

Log Message:
Revert previous.

obsolete + other tags is not easy to clean up.


To generate a diff of this commit:
cvs rdiff -u -r1.236 -r1.237 src/distrib/sets/lists/debug/mi

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



CVS commit: src/share/man/man4/man4.x86

2018-01-25 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Jan 25 08:41:17 UTC 2018

Modified Files:
src/share/man/man4/man4.x86: amdzentemp.4

Log Message:
Some clean-up on the HISTORY and AUTHORS sections, and addition of a BUGS
section to document the fact that we don't yet handle the required temp
offset, nor do we expose the available thermal-trip value.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/man/man4/man4.x86/amdzentemp.4

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



CVS commit: src/share/man/man4/man4.x86

2018-01-25 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Jan 25 08:41:17 UTC 2018

Modified Files:
src/share/man/man4/man4.x86: amdzentemp.4

Log Message:
Some clean-up on the HISTORY and AUTHORS sections, and addition of a BUGS
section to document the fact that we don't yet handle the required temp
offset, nor do we expose the available thermal-trip value.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/man/man4/man4.x86/amdzentemp.4

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

Modified files:

Index: src/share/man/man4/man4.x86/amdzentemp.4
diff -u src/share/man/man4/man4.x86/amdzentemp.4:1.1 src/share/man/man4/man4.x86/amdzentemp.4:1.2
--- src/share/man/man4/man4.x86/amdzentemp.4:1.1	Thu Jan 25 01:25:39 2018
+++ src/share/man/man4/man4.x86/amdzentemp.4	Thu Jan 25 08:41:17 2018
@@ -1,4 +1,4 @@
-.\" $NetBSD: amdzentemp.4,v 1.1 2018/01/25 01:25:39 christos Exp $
+.\" $NetBSD: amdzentemp.4,v 1.2 2018/01/25 08:41:17 pgoyette Exp $
 .\"-
 .\" Copyright (c) 2008 Christoph Egger
 .\" All rights reserved.
@@ -57,6 +57,17 @@ API.
 .Xr envsys 4 ,
 .Xr envstat 8 ,
 .Xr powerd 8
+.Sh BUGS
+The temperature reading provided to
+.Xr envsys 4
+needs to have a CPU-dependant offset applied.
+For Ryzen X processors, the offset is 20C, while for Threadripper
+processors an offset of 27C is needed.
+.Pp
+The sensor has thermal-trip value which should be retrieved and
+provided to
+.Xr envsys 4
+as the sensors critical-maximum value.
 .Sh HISTORY
 The
 .Nm
@@ -65,8 +76,17 @@ driver first appeared in
 named
 .Dq kate .
 It was then ported to
-.Nx 5.0 .
-The driver has been renamed with support for newer AMD CPUs.
+.Nx 5.0
+under the name
+.Dq amdtemp .
+The
+.Fx
+version of the driver was updated with support for newer AMD CPUs.
+For
+.Nx ,
+the support for the newer CPUs was separated into its own
+.Nm
+driver.
 .Sh AUTHORS
 .An -nosplit
 The
@@ -74,3 +94,7 @@ The
 driver was written by
 .An Constantine A. Murenin Aq Mt c...@openbsd.org
 whilst at the University of Waterloo.
+Porting of support for the newer AMD CPUs from
+.Fx
+was provided by
+.An Ian Clark .