CVS commit: src/sys/dev/pci

2019-10-16 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Oct 17 05:55:19 UTC 2019

Modified Files:
src/sys/dev/pci: if_msk.c

Log Message:
 Fix order of m_freem(). Found by kASan. OK'd by jdolecek and mrg.


To generate a diff of this commit:
cvs rdiff -u -r1.91 -r1.92 src/sys/dev/pci/if_msk.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

2019-10-16 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Oct 17 05:55:19 UTC 2019

Modified Files:
src/sys/dev/pci: if_msk.c

Log Message:
 Fix order of m_freem(). Found by kASan. OK'd by jdolecek and mrg.


To generate a diff of this commit:
cvs rdiff -u -r1.91 -r1.92 src/sys/dev/pci/if_msk.c

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

Modified files:

Index: src/sys/dev/pci/if_msk.c
diff -u src/sys/dev/pci/if_msk.c:1.91 src/sys/dev/pci/if_msk.c:1.92
--- src/sys/dev/pci/if_msk.c:1.91	Mon Jun  3 05:22:57 2019
+++ src/sys/dev/pci/if_msk.c	Thu Oct 17 05:55:18 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: if_msk.c,v 1.91 2019/06/03 05:22:57 msaitoh Exp $ */
+/* $NetBSD: if_msk.c,v 1.92 2019/10/17 05:55:18 msaitoh Exp $ */
 /*	$OpenBSD: if_msk.c,v 1.79 2009/10/15 17:54:56 deraadt Exp $	*/
 
 /*
@@ -52,7 +52,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_msk.c,v 1.91 2019/06/03 05:22:57 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_msk.c,v 1.92 2019/10/17 05:55:18 msaitoh Exp $");
 
 #include 
 #include 
@@ -2118,9 +2118,6 @@ msk_txeof(struct sk_if_softc *sc_if)
 		if (sc_if->sk_cdata.sk_tx_chain[idx].sk_mbuf != NULL) {
 			entry = sc_if->sk_cdata.sk_tx_map[idx];
 
-			m_freem(sc_if->sk_cdata.sk_tx_chain[idx].sk_mbuf);
-			sc_if->sk_cdata.sk_tx_chain[idx].sk_mbuf = NULL;
-
 			bus_dmamap_sync(sc->sc_dmatag, entry->dmamap, 0,
 			entry->dmamap->dm_mapsize, BUS_DMASYNC_POSTWRITE);
 
@@ -2128,6 +2125,8 @@ msk_txeof(struct sk_if_softc *sc_if)
 			SIMPLEQ_INSERT_TAIL(_if->sk_txmap_head, entry,
 	  link);
 			sc_if->sk_cdata.sk_tx_map[idx] = NULL;
+			m_freem(sc_if->sk_cdata.sk_tx_chain[idx].sk_mbuf);
+			sc_if->sk_cdata.sk_tx_chain[idx].sk_mbuf = NULL;
 		}
 		sc_if->sk_cdata.sk_tx_cnt--;
 		SK_INC(idx, MSK_TX_RING_CNT);
@@ -2646,13 +2645,19 @@ msk_stop(struct ifnet *ifp, int disable)
 
 	for (i = 0; i < MSK_TX_RING_CNT; i++) {
 		if (sc_if->sk_cdata.sk_tx_chain[i].sk_mbuf != NULL) {
-			m_freem(sc_if->sk_cdata.sk_tx_chain[i].sk_mbuf);
-			sc_if->sk_cdata.sk_tx_chain[i].sk_mbuf = NULL;
+			dma = sc_if->sk_cdata.sk_tx_map[i];
+
+			bus_dmamap_sync(sc->sc_dmatag, dma->dmamap, 0,
+			dma->dmamap->dm_mapsize, BUS_DMASYNC_POSTWRITE);
+
+			bus_dmamap_unload(sc->sc_dmatag, dma->dmamap);
 #if 1
 			SIMPLEQ_INSERT_HEAD(_if->sk_txmap_head,
 			sc_if->sk_cdata.sk_tx_map[i], link);
 			sc_if->sk_cdata.sk_tx_map[i] = 0;
 #endif
+			m_freem(sc_if->sk_cdata.sk_tx_chain[i].sk_mbuf);
+			sc_if->sk_cdata.sk_tx_chain[i].sk_mbuf = NULL;
 		}
 	}
 



Re: CVS import: src/external/bsd/dhcpcd/dist

2019-10-16 Thread Roy Marples
This should now be fixed.

On 14 October 2019 16:39:24 BST, "Herbert J. Skuhra"  wrote:
>On Fri, 11 Oct 2019 13:01:23 +0200, "Roy Marples" wrote:
>> 
>> Module Name: src
>> Committed By:roy
>> Date:Fri Oct 11 11:01:23 UTC 2019
>> 
>> Update of /cvsroot/src/external/bsd/dhcpcd/dist
>> In directory ivanova.netbsd.org:/tmp/cvs-serv19794
>> 
>> Log Message:
>> Import dhcpcd-8.1.0 with the following changes:
>> 
>>  * Fix carrier status after a route socket overflow
>>  * Allow domain spaced options
>>  * DHCP: Allow not sending Force Renew Nonce or Reconf Accept
>>  * IPv4LL: Now passes Apple Bonjour test versions 1.4 and 1.5
>>  * ARP: Fix a typo and remove pragma (thus working with old gcc)
>>  * DHCP6: Fix a cosmetic issue with infinite leases
>>  * DHCP6: SLA 0 and Prefix Len 0 will now add a delegatd /64 address
>>  * Ignore some virtual interfaces such as Tap and Bridge by default
>>  * BPF: Move validation logic out of BPF and back into dhcpcd 
>
>Hi,
>
>this obviously breaks DHCP on my Raspberry PI 2B (earmv7hf).
>I've also checked daily snapshots:
>
>201910102350Z OK
>201910111300Z not OK usmsc0 169.254.x.x/16
>
>--
>Herbert

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

re: CVS commit: src/external/gpl3/gcc/dist/libobjc

2019-10-16 Thread matthew green
> >> > Module Name: src
> >> > Committed By:christos
> >> > Date:Wed Oct 16 15:01:56 UTC 2019
> >> > 
> >> > Modified Files:
> >> >  src/external/gpl3/gcc/dist/libobjc: encoding.c
> >> > 
> >> > Log Message:
> >> > prevent DFmode re-definition.
> >> 
> >> i'm not a fan of this one.  i'd like to figure out
> >> what is really happening here..
> >> 
> >> i've been using the same hack, but i didn't want to
> >> commit it because i don't understand it.
> >> 
> >> 
> >> .mrg.
> >
> >I'd like to note that upstream adopted the same choice.
> >https://gcc.gnu.org/viewcvs/gcc?view=revision=269429
> 
> That's what we'll keep then :-)

works for me.  thanks!


Re: CVS commit: src/external/gpl3/gcc/dist/libobjc

2019-10-16 Thread Christos Zoulas
In article <20191016220250.ga23...@homeworld.netbsd.org>,
  wrote:
>On Thu, Oct 17, 2019 at 07:08:45AM +1100, matthew green wrote:
>> "Christos Zoulas" writes:
>> > Module Name:   src
>> > Committed By:  christos
>> > Date:  Wed Oct 16 15:01:56 UTC 2019
>> > 
>> > Modified Files:
>> >src/external/gpl3/gcc/dist/libobjc: encoding.c
>> > 
>> > Log Message:
>> > prevent DFmode re-definition.
>> 
>> i'm not a fan of this one.  i'd like to figure out
>> what is really happening here..
>> 
>> i've been using the same hack, but i didn't want to
>> commit it because i don't understand it.
>> 
>> 
>> .mrg.
>
>I'd like to note that upstream adopted the same choice.
>https://gcc.gnu.org/viewcvs/gcc?view=revision=269429

That's what we'll keep then :-)

christos




Re: CVS commit: src/external/gpl3/gcc/dist/libobjc

2019-10-16 Thread maya
On Thu, Oct 17, 2019 at 07:08:45AM +1100, matthew green wrote:
> "Christos Zoulas" writes:
> > Module Name:src
> > Committed By:   christos
> > Date:   Wed Oct 16 15:01:56 UTC 2019
> > 
> > Modified Files:
> > src/external/gpl3/gcc/dist/libobjc: encoding.c
> > 
> > Log Message:
> > prevent DFmode re-definition.
> 
> i'm not a fan of this one.  i'd like to figure out
> what is really happening here..
> 
> i've been using the same hack, but i didn't want to
> commit it because i don't understand it.
> 
> 
> .mrg.

I'd like to note that upstream adopted the same choice.
https://gcc.gnu.org/viewcvs/gcc?view=revision=269429


CVS commit: src

2019-10-16 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Wed Oct 16 21:52:22 UTC 2019

Modified Files:
src/sbin/mount_nilfs: mount_nilfs.8 mount_nilfs.c
src/sbin/mount_udf: mount_udf.8 mount_udf.c
src/sys/arch/arm/iomd: qms.c
src/sys/dev/pci: auixp.c auixpreg.h auixpvar.h
src/sys/fs/nilfs: nilfs_mount.h
src/sys/fs/udf: udf_mount.h

Log Message:
Switch files copyright Reinoud Zandijk from BSD 4 clause to BSD 2 clause.

OK'd by reinoud in email (from 4 Feb 2019).


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sbin/mount_nilfs/mount_nilfs.8
cvs rdiff -u -r1.3 -r1.4 src/sbin/mount_nilfs/mount_nilfs.c
cvs rdiff -u -r1.13 -r1.14 src/sbin/mount_udf/mount_udf.8
cvs rdiff -u -r1.14 -r1.15 src/sbin/mount_udf/mount_udf.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/arm/iomd/qms.c
cvs rdiff -u -r1.47 -r1.48 src/sys/dev/pci/auixp.c
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/pci/auixpreg.h
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/pci/auixpvar.h
cvs rdiff -u -r1.1 -r1.2 src/sys/fs/nilfs/nilfs_mount.h
cvs rdiff -u -r1.3 -r1.4 src/sys/fs/udf/udf_mount.h

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

Modified files:

Index: src/sbin/mount_nilfs/mount_nilfs.8
diff -u src/sbin/mount_nilfs/mount_nilfs.8:1.4 src/sbin/mount_nilfs/mount_nilfs.8:1.5
--- src/sbin/mount_nilfs/mount_nilfs.8:1.4	Wed Jun  1 12:01:21 2016
+++ src/sbin/mount_nilfs/mount_nilfs.8	Wed Oct 16 21:52:22 2019
@@ -1,4 +1,4 @@
-.\" $NetBSD: mount_nilfs.8,v 1.4 2016/06/01 12:01:21 wiz Exp $
+.\" $NetBSD: mount_nilfs.8,v 1.5 2019/10/16 21:52:22 maya Exp $
 .\"
 .\" Copyright (c) 2008, 2009 Reinoud Zandijk
 .\" All rights reserved.
@@ -11,13 +11,6 @@
 .\" 2. Redistributions in binary form must reproduce the above copyright
 .\"notice, this list of conditions and the following disclaimer in the
 .\"documentation and/or other materials provided with the distribution.
-.\" 3. All advertising materials mentioning features or use of this software
-.\"must display the following acknowledgement:
-.\"  This product includes software developed for the
-.\"  NetBSD Project.  See http://www.NetBSD.org/ for
-.\"  information about NetBSD.
-.\" 4. The name of the author may not be used to endorse or promote products
-.\"derived from this software without specific prior written permission.
 .\"
 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES

Index: src/sbin/mount_nilfs/mount_nilfs.c
diff -u src/sbin/mount_nilfs/mount_nilfs.c:1.3 src/sbin/mount_nilfs/mount_nilfs.c:1.4
--- src/sbin/mount_nilfs/mount_nilfs.c:1.3	Sun Feb 21 22:51:29 2016
+++ src/sbin/mount_nilfs/mount_nilfs.c	Wed Oct 16 21:52:22 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: mount_nilfs.c,v 1.3 2016/02/21 22:51:29 christos Exp $ */
+/* $NetBSD: mount_nilfs.c,v 1.4 2019/10/16 21:52:22 maya Exp $ */
 
 /*
  * Copyright (c) 2008, 2009 Reinoud Zandijk
@@ -12,13 +12,6 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *notice, this list of conditions and the following disclaimer in the
  *documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *must display the following acknowledgement:
- *  This product includes software developed for the
- *  NetBSD Project.  See http://www.NetBSD.org/ for
- *  information about NetBSD.
- * 4. The name of the author may not be used to endorse or promote products
- *derived from this software without specific prior written permission.
  * 
  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
@@ -36,7 +29,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: mount_nilfs.c,v 1.3 2016/02/21 22:51:29 christos Exp $");
+__RCSID("$NetBSD: mount_nilfs.c,v 1.4 2019/10/16 21:52:22 maya Exp $");
 #endif /* not lint */
 
 

Index: src/sbin/mount_udf/mount_udf.8
diff -u src/sbin/mount_udf/mount_udf.8:1.13 src/sbin/mount_udf/mount_udf.8:1.14
--- src/sbin/mount_udf/mount_udf.8:1.13	Mon Sep 12 02:45:07 2016
+++ src/sbin/mount_udf/mount_udf.8	Wed Oct 16 21:52:22 2019
@@ -1,4 +1,4 @@
-.\" $NetBSD: mount_udf.8,v 1.13 2016/09/12 02:45:07 sevan Exp $
+.\" $NetBSD: mount_udf.8,v 1.14 2019/10/16 21:52:22 maya Exp $
 .\"
 .\" Copyright (c) 2006, 2008 Reinoud Zandijk
 .\" All rights reserved.
@@ -11,13 +11,6 @@
 .\" 2. Redistributions in binary form must reproduce the above copyright
 .\"notice, this list of conditions and the following disclaimer in the
 .\"documentation and/or other materials provided with the distribution.
-.\" 3. All advertising materials mentioning features or use of this software
-.\"must display the following acknowledgement:
-.\"  This product includes software 

CVS commit: src

2019-10-16 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Wed Oct 16 21:52:22 UTC 2019

Modified Files:
src/sbin/mount_nilfs: mount_nilfs.8 mount_nilfs.c
src/sbin/mount_udf: mount_udf.8 mount_udf.c
src/sys/arch/arm/iomd: qms.c
src/sys/dev/pci: auixp.c auixpreg.h auixpvar.h
src/sys/fs/nilfs: nilfs_mount.h
src/sys/fs/udf: udf_mount.h

Log Message:
Switch files copyright Reinoud Zandijk from BSD 4 clause to BSD 2 clause.

OK'd by reinoud in email (from 4 Feb 2019).


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sbin/mount_nilfs/mount_nilfs.8
cvs rdiff -u -r1.3 -r1.4 src/sbin/mount_nilfs/mount_nilfs.c
cvs rdiff -u -r1.13 -r1.14 src/sbin/mount_udf/mount_udf.8
cvs rdiff -u -r1.14 -r1.15 src/sbin/mount_udf/mount_udf.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/arm/iomd/qms.c
cvs rdiff -u -r1.47 -r1.48 src/sys/dev/pci/auixp.c
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/pci/auixpreg.h
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/pci/auixpvar.h
cvs rdiff -u -r1.1 -r1.2 src/sys/fs/nilfs/nilfs_mount.h
cvs rdiff -u -r1.3 -r1.4 src/sys/fs/udf/udf_mount.h

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



Re: CVS commit: src/external/gpl3/gcc/dist/libobjc

2019-10-16 Thread Christos Zoulas
In article <9715.1571256...@splode.eterna.com.au>,
matthew green   wrote:
>"Christos Zoulas" writes:
>> Module Name: src
>> Committed By:christos
>> Date:Wed Oct 16 15:01:56 UTC 2019
>> 
>> Modified Files:
>>  src/external/gpl3/gcc/dist/libobjc: encoding.c
>> 
>> Log Message:
>> prevent DFmode re-definition.
>
>i'm not a fan of this one.  i'd like to figure out
>what is really happening here..
>
>i've been using the same hack, but i didn't want to
>commit it because i don't understand it.

I've looked into it:
The definition comes from:

src/external/gpl3/gcc/usr.bin/gcc/arch/x86_64/insn-modes.h:317
#ifdef USE_ENUM_MODES
#define DFmode E_DFmode
#else
#define DFmode (scalar_float_mode ((scalar_float_mode::from_int) E_DFmode))
#endif

These defines are new in gcc8. The older gcc does not have E_DFmode,
and just uses the DFmode enum (which has now been renamed E_DFmode).

So the encoding.c has been changed to use the new E_DFmode in one place:


--- /usr/src/external/gpl3/gcc.old//dist/libobjc/encoding.c 2019-10-16 
17:44:57.910551512 -0400
+++ /usr/src/external/gpl3/gcc//dist/libobjc/encoding.c 2019-10-16 
17:45:05.111849735 -0400
@@ -1,5 +1,5 @@
 /* Encoding of types for Objective C.
-   Copyright (C) 1993-2017 Free Software Foundation, Inc.
+   Copyright (C) 1993-2018 Free Software Foundation, Inc.
Contributed by Kresten Krab Thorup
Bitfield support by Ovidiu Predescu
 
@@ -162,7 +162,7 @@
   case UNION_TYPE:
return MAX (MAX (comp, spec), objc_alignof_type (_stp) * __CHAR_BIT__);
break;
-  case DFmode:
+  case E_DFmode:
   case _C_LNG_LNG:
   case _C_ULNG_LNG:
return MAX (MAX (comp, spec), 64);

The only other place DFmode is used is:

/*  FIXME: while this file has no business including tm.h, this
definitely has no business defining this macro but it
is only way around without really rewritting this file,
should look after the branch of 3.4 to fix this.   */
#define rs6000_special_round_type_align(STRUCT, COMPUTED, SPECIFIED)\
  ({ const char *_fields = TYPE_FIELDS (STRUCT);\
  ((_fields != 0\
&& TYPE_MODE (strip_array_types (TREE_TYPE (_fields))) == DFmode)   \
   ? MAX (MAX (COMPUTED, SPECIFIED), 64)\
   : MAX (COMPUTED, SPECIFIED));})

So think that the right fix is to change the second DFmode to E_DFmode and
then delete the re-definition.

christos





CVS commit: src/doc

2019-10-16 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Wed Oct 16 20:49:59 UTC 2019

Modified Files:
src/doc: CHANGES

Log Message:
Mention support for FriendlyElec NanoPi R1 and Duo2.


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

2019-10-16 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Wed Oct 16 20:49:59 UTC 2019

Modified Files:
src/doc: CHANGES

Log Message:
Mention support for FriendlyElec NanoPi R1 and Duo2.


To generate a diff of this commit:
cvs rdiff -u -r1.2596 -r1.2597 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/CHANGES
diff -u src/doc/CHANGES:1.2596 src/doc/CHANGES:1.2597
--- src/doc/CHANGES:1.2596	Wed Oct 16 14:56:34 2019
+++ src/doc/CHANGES	Wed Oct 16 20:49:59 2019
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2596 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2597 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -59,3 +59,4 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	acpi(4): Updated ACPICA to 20190816. [christos 20191015]
 	sup: removed, use ftp://ftp.astron.com/pub/sup [christos 20191015]
 	dhcpcd(8): Import dhcpcd-8.1.1 [roy 20191016]
+	evbarm: Add support for the NanoPi R1 and Duo2. [bad 20191016]



CVS commit: src

2019-10-16 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Wed Oct 16 20:43:18 UTC 2019

Modified Files:
src/lib/libc/gen: sysconf.c
src/sys/sys: unistd.h

Log Message:
Provide sysconf(_SC_RTSIG_MAX) = SIGRTMAX - SIGRTMIN

Thanks nros@ for the correct definition


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/lib/libc/gen/sysconf.c
cvs rdiff -u -r1.61 -r1.62 src/sys/sys/unistd.h

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



CVS commit: src

2019-10-16 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Wed Oct 16 20:43:18 UTC 2019

Modified Files:
src/lib/libc/gen: sysconf.c
src/sys/sys: unistd.h

Log Message:
Provide sysconf(_SC_RTSIG_MAX) = SIGRTMAX - SIGRTMIN

Thanks nros@ for the correct definition


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/lib/libc/gen/sysconf.c
cvs rdiff -u -r1.61 -r1.62 src/sys/sys/unistd.h

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

Modified files:

Index: src/lib/libc/gen/sysconf.c
diff -u src/lib/libc/gen/sysconf.c:1.41 src/lib/libc/gen/sysconf.c:1.42
--- src/lib/libc/gen/sysconf.c:1.41	Thu Aug  4 06:43:43 2016
+++ src/lib/libc/gen/sysconf.c	Wed Oct 16 20:43:18 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: sysconf.c,v 1.41 2016/08/04 06:43:43 christos Exp $	*/
+/*	$NetBSD: sysconf.c,v 1.42 2019/10/16 20:43:18 maya Exp $	*/
 
 /*-
  * Copyright (c) 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)sysconf.c	8.2 (Berkeley) 3/20/94";
 #else
-__RCSID("$NetBSD: sysconf.c,v 1.41 2016/08/04 06:43:43 christos Exp $");
+__RCSID("$NetBSD: sysconf.c,v 1.42 2019/10/16 20:43:18 maya Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -339,6 +339,8 @@ sysconf(int name)
 		return _GETPW_R_SIZE_MAX;
 
 /* Unsorted */
+	case _SC_RTSIG_MAX:
+		return SIGRTMAX - SIGRTMIN;
 	case _SC_HOST_NAME_MAX:
 		return MAXHOSTNAMELEN;
 	case _SC_PASS_MAX:

Index: src/sys/sys/unistd.h
diff -u src/sys/sys/unistd.h:1.61 src/sys/sys/unistd.h:1.62
--- src/sys/sys/unistd.h:1.61	Thu Aug  4 06:43:43 2016
+++ src/sys/sys/unistd.h	Wed Oct 16 20:43:18 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: unistd.h,v 1.61 2016/08/04 06:43:43 christos Exp $	*/
+/*	$NetBSD: unistd.h,v 1.62 2019/10/16 20:43:18 maya Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -320,6 +320,7 @@
 #define	_SC_DELAYTIMER_MAX		92
 #define	_SC_SIGQUEUE_MAX		93
 #define	_SC_REALTIME_SIGNALS		94
+#define	_SC_RTSIG_MAX			95
 
 /* Extensions found in Solaris and Linux. */
 #define	_SC_PHYS_PAGES		121



re: CVS commit: src/external/gpl3/gcc/dist/libobjc

2019-10-16 Thread matthew green
"Christos Zoulas" writes:
> Module Name:  src
> Committed By: christos
> Date: Wed Oct 16 15:01:56 UTC 2019
> 
> Modified Files:
>   src/external/gpl3/gcc/dist/libobjc: encoding.c
> 
> Log Message:
> prevent DFmode re-definition.

i'm not a fan of this one.  i'd like to figure out
what is really happening here..

i've been using the same hack, but i didn't want to
commit it because i don't understand it.


.mrg.


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

2019-10-16 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Wed Oct 16 19:52:09 UTC 2019

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

Log Message:
use aprint_normal_dev() for the capacity message, same as e.g. wd(4) and sd(4)


To generate a diff of this commit:
cvs rdiff -u -r1.93 -r1.94 src/sys/arch/xen/xen/xbd_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/xbd_xenbus.c
diff -u src/sys/arch/xen/xen/xbd_xenbus.c:1.93 src/sys/arch/xen/xen/xbd_xenbus.c:1.94
--- src/sys/arch/xen/xen/xbd_xenbus.c:1.93	Wed Oct 16 19:38:13 2019
+++ src/sys/arch/xen/xen/xbd_xenbus.c	Wed Oct 16 19:52:08 2019
@@ -1,4 +1,4 @@
-/*  $NetBSD: xbd_xenbus.c,v 1.93 2019/10/16 19:38:13 jdolecek Exp $  */
+/*  $NetBSD: xbd_xenbus.c,v 1.94 2019/10/16 19:52:08 jdolecek Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -50,7 +50,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.93 2019/10/16 19:38:13 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.94 2019/10/16 19:52:08 jdolecek Exp $");
 
 #include "opt_xen.h"
 
@@ -588,7 +588,7 @@ xbd_backend_changed(void *arg, XenbusSta
 		sc->sc_backend_status = BLKIF_STATE_CONNECTED;
 
 		format_bytes(buf, sizeof(buf), sc->sc_sectors * sc->sc_secsize);
-		aprint_verbose_dev(sc->sc_dksc.sc_dev,
+		aprint_normal_dev(sc->sc_dksc.sc_dev,
 "%s, %d bytes/sect x %" PRIu64 " sectors\n",
 buf, (int)dg->dg_secsize, sc->sc_xbdsize);
 



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

2019-10-16 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Wed Oct 16 19:52:09 UTC 2019

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

Log Message:
use aprint_normal_dev() for the capacity message, same as e.g. wd(4) and sd(4)


To generate a diff of this commit:
cvs rdiff -u -r1.93 -r1.94 src/sys/arch/xen/xen/xbd_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

2019-10-16 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Wed Oct 16 19:38:13 UTC 2019

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

Log Message:
don't try to read disklabel for attached xbd* disk from (effectively) always
xbd0a device, there is no need for it and it is just wrong

same problem as PR kern/41704 for cgd

XXX perhaps xbd should use native block size passed from dom0 rather then
XXX recomputing in DEV_BSIZE


To generate a diff of this commit:
cvs rdiff -u -r1.92 -r1.93 src/sys/arch/xen/xen/xbd_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

2019-10-16 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Wed Oct 16 19:38:13 UTC 2019

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

Log Message:
don't try to read disklabel for attached xbd* disk from (effectively) always
xbd0a device, there is no need for it and it is just wrong

same problem as PR kern/41704 for cgd

XXX perhaps xbd should use native block size passed from dom0 rather then
XXX recomputing in DEV_BSIZE


To generate a diff of this commit:
cvs rdiff -u -r1.92 -r1.93 src/sys/arch/xen/xen/xbd_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/xbd_xenbus.c
diff -u src/sys/arch/xen/xen/xbd_xenbus.c:1.92 src/sys/arch/xen/xen/xbd_xenbus.c:1.93
--- src/sys/arch/xen/xen/xbd_xenbus.c:1.92	Sat Feb  2 12:32:55 2019
+++ src/sys/arch/xen/xen/xbd_xenbus.c	Wed Oct 16 19:38:13 2019
@@ -1,4 +1,4 @@
-/*  $NetBSD: xbd_xenbus.c,v 1.92 2019/02/02 12:32:55 cherry Exp $  */
+/*  $NetBSD: xbd_xenbus.c,v 1.93 2019/10/16 19:38:13 jdolecek Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -50,7 +50,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.92 2019/02/02 12:32:55 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.93 2019/10/16 19:38:13 jdolecek Exp $");
 
 #include "opt_xen.h"
 
@@ -587,12 +587,11 @@ xbd_backend_changed(void *arg, XenbusSta
 
 		sc->sc_backend_status = BLKIF_STATE_CONNECTED;
 
-		/* try to read the disklabel */
-		dk_getdisklabel(>sc_dksc, 0 /* XXX ? */);
 		format_bytes(buf, sizeof(buf), sc->sc_sectors * sc->sc_secsize);
 		aprint_verbose_dev(sc->sc_dksc.sc_dev,
 "%s, %d bytes/sect x %" PRIu64 " sectors\n",
 buf, (int)dg->dg_secsize, sc->sc_xbdsize);
+
 		/* Discover wedges on this disk. */
 		dkwedge_discover(>sc_dksc.sc_dkdev);
 



CVS commit: src/sbin/gpt

2019-10-16 Thread John Nemeth
Module Name:src
Committed By:   jnemeth
Date:   Wed Oct 16 19:03:53 UTC 2019

Modified Files:
src/sbin/gpt: destroy.c

Log Message:
Do the 'dkctl makewedges' dance to drop any wedges assoicated the
destroyed GPT.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sbin/gpt/destroy.c

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



CVS commit: src/sbin/gpt

2019-10-16 Thread John Nemeth
Module Name:src
Committed By:   jnemeth
Date:   Wed Oct 16 19:03:53 UTC 2019

Modified Files:
src/sbin/gpt: destroy.c

Log Message:
Do the 'dkctl makewedges' dance to drop any wedges assoicated the
destroyed GPT.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sbin/gpt/destroy.c

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

Modified files:

Index: src/sbin/gpt/destroy.c
diff -u src/sbin/gpt/destroy.c:1.12 src/sbin/gpt/destroy.c:1.13
--- src/sbin/gpt/destroy.c:1.12	Thu Apr  4 14:03:40 2019
+++ src/sbin/gpt/destroy.c	Wed Oct 16 19:03:53 2019
@@ -33,7 +33,7 @@
 __FBSDID("$FreeBSD: src/sbin/gpt/destroy.c,v 1.6 2005/08/31 01:47:19 marcel Exp $");
 #endif
 #ifdef __RCSID
-__RCSID("$NetBSD: destroy.c,v 1.12 2019/04/04 14:03:40 martin Exp $");
+__RCSID("$NetBSD: destroy.c,v 1.13 2019/10/16 19:03:53 jnemeth Exp $");
 #endif
 
 #include 
@@ -59,7 +59,7 @@ struct gpt_cmd c_destroy = {
 	"destroy",
 	cmd_destroy,
 	destroyhelp, __arraycount(destroyhelp),
-	0,
+	GPT_SYNC,
 };
 
 #define usage() gpt_usage(NULL, _destroy)



CVS commit: src/sys

2019-10-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Oct 16 18:29:49 UTC 2019

Modified Files:
src/sys/arch/x86/isa: clock.c
src/sys/arch/xen/xen: clock.c
src/sys/kern: kern_core.c kern_hook.c kern_sig.c kern_veriexec.c
subr_ipi.c subr_pool.c subr_vmem.c sys_ptrace_common.c
src/sys/net: if_ethersubr.c
src/sys/sys: cdefs.h sdt.h

Log Message:
Add and use __FPTRCAST, requested by uwe@


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/x86/isa/clock.c
cvs rdiff -u -r1.79 -r1.80 src/sys/arch/xen/xen/clock.c
cvs rdiff -u -r1.25 -r1.26 src/sys/kern/kern_core.c
cvs rdiff -u -r1.7 -r1.8 src/sys/kern/kern_hook.c
cvs rdiff -u -r1.374 -r1.375 src/sys/kern/kern_sig.c
cvs rdiff -u -r1.21 -r1.22 src/sys/kern/kern_veriexec.c
cvs rdiff -u -r1.6 -r1.7 src/sys/kern/subr_ipi.c
cvs rdiff -u -r1.260 -r1.261 src/sys/kern/subr_pool.c
cvs rdiff -u -r1.98 -r1.99 src/sys/kern/subr_vmem.c
cvs rdiff -u -r1.68 -r1.69 src/sys/kern/sys_ptrace_common.c
cvs rdiff -u -r1.279 -r1.280 src/sys/net/if_ethersubr.c
cvs rdiff -u -r1.146 -r1.147 src/sys/sys/cdefs.h
cvs rdiff -u -r1.11 -r1.12 src/sys/sys/sdt.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/arch/x86/isa/clock.c
diff -u src/sys/arch/x86/isa/clock.c:1.35 src/sys/arch/x86/isa/clock.c:1.36
--- src/sys/arch/x86/isa/clock.c:1.35	Wed Oct 16 11:01:10 2019
+++ src/sys/arch/x86/isa/clock.c	Wed Oct 16 14:29:49 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: clock.c,v 1.35 2019/10/16 15:01:10 christos Exp $	*/
+/*	$NetBSD: clock.c,v 1.36 2019/10/16 18:29:49 christos Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -121,7 +121,7 @@ WITH THE USE OR PERFORMANCE OF THIS SOFT
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.35 2019/10/16 15:01:10 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.36 2019/10/16 18:29:49 christos Exp $");
 
 /* #define CLOCKDEBUG */
 /* #define CLOCK_PARANOIA */
@@ -554,7 +554,7 @@ i8254_initclocks(void)
 	 * want to keep track of clock handlers.
 	 */
 	(void)isa_intr_establish(NULL, 0, IST_PULSE, IPL_CLOCK,
-	(int (*)(void *))(void *)clockintr, 0);
+	__FPTRCAST(int (*)(void *), clockintr), 0);
 }
 
 void

Index: src/sys/arch/xen/xen/clock.c
diff -u src/sys/arch/xen/xen/clock.c:1.79 src/sys/arch/xen/xen/clock.c:1.80
--- src/sys/arch/xen/xen/clock.c:1.79	Wed Oct 16 11:01:10 2019
+++ src/sys/arch/xen/xen/clock.c	Wed Oct 16 14:29:49 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: clock.c,v 1.79 2019/10/16 15:01:10 christos Exp $	*/
+/*	$NetBSD: clock.c,v 1.80 2019/10/16 18:29:49 christos Exp $	*/
 
 /*-
  * Copyright (c) 2017, 2018 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.79 2019/10/16 15:01:10 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.80 2019/10/16 18:29:49 christos Exp $");
 
 #include 
 #include 
@@ -765,7 +765,8 @@ xen_resumeclocks(struct cpu_info *ci)
 	/* XXX sketchy function pointer cast -- fix the API, please */
 	ci->ci_xen_timer_intrhand = xen_intr_establish_xname(-1, _pic,
 	evtch, IST_LEVEL, IPL_CLOCK,
-	(int (*)(void *))(void *)xen_timer_handler, ci, true, intr_xname);
+	__FPTRCAST(int (*)(void *), xen_timer_handler),
+	ci, true, intr_xname);
 	if (ci->ci_xen_timer_intrhand == NULL)
 		panic("failed to establish timer interrupt handler");
 

Index: src/sys/kern/kern_core.c
diff -u src/sys/kern/kern_core.c:1.25 src/sys/kern/kern_core.c:1.26
--- src/sys/kern/kern_core.c:1.25	Wed Oct 16 11:27:38 2019
+++ src/sys/kern/kern_core.c	Wed Oct 16 14:29:49 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_core.c,v 1.25 2019/10/16 15:27:38 christos Exp $	*/
+/*	$NetBSD: kern_core.c,v 1.26 2019/10/16 18:29:49 christos Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1991, 1993
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_core.c,v 1.25 2019/10/16 15:27:38 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_core.c,v 1.26 2019/10/16 18:29:49 christos Exp $");
 
 #include 
 #include 
@@ -78,7 +78,8 @@ coredump_modcmd(modcmd_t cmd, void *arg)
 		 * no references, and so can be unloaded, no user programs
 		 * can be running and so nothing can call *coredump_vec.
 		 */
-		coredump_vec = (int (*)(struct lwp *, const char *))(void *)enosys;
+		coredump_vec = __FPTRCAST(
+		int (*)(struct lwp *, const char *), enosys);
 		return 0;
 	default:
 		return ENOTTY;

Index: src/sys/kern/kern_hook.c
diff -u src/sys/kern/kern_hook.c:1.7 src/sys/kern/kern_hook.c:1.8
--- src/sys/kern/kern_hook.c:1.7	Wed Oct 16 11:27:38 2019
+++ src/sys/kern/kern_hook.c	Wed Oct 16 14:29:49 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_hook.c,v 1.7 2019/10/16 15:27:38 christos Exp $	*/
+/*	$NetBSD: kern_hook.c,v 1.8 2019/10/16 18:29:49 christos Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 1999, 2002, 2007, 2008 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 

CVS commit: src/sys

2019-10-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Oct 16 18:29:49 UTC 2019

Modified Files:
src/sys/arch/x86/isa: clock.c
src/sys/arch/xen/xen: clock.c
src/sys/kern: kern_core.c kern_hook.c kern_sig.c kern_veriexec.c
subr_ipi.c subr_pool.c subr_vmem.c sys_ptrace_common.c
src/sys/net: if_ethersubr.c
src/sys/sys: cdefs.h sdt.h

Log Message:
Add and use __FPTRCAST, requested by uwe@


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/x86/isa/clock.c
cvs rdiff -u -r1.79 -r1.80 src/sys/arch/xen/xen/clock.c
cvs rdiff -u -r1.25 -r1.26 src/sys/kern/kern_core.c
cvs rdiff -u -r1.7 -r1.8 src/sys/kern/kern_hook.c
cvs rdiff -u -r1.374 -r1.375 src/sys/kern/kern_sig.c
cvs rdiff -u -r1.21 -r1.22 src/sys/kern/kern_veriexec.c
cvs rdiff -u -r1.6 -r1.7 src/sys/kern/subr_ipi.c
cvs rdiff -u -r1.260 -r1.261 src/sys/kern/subr_pool.c
cvs rdiff -u -r1.98 -r1.99 src/sys/kern/subr_vmem.c
cvs rdiff -u -r1.68 -r1.69 src/sys/kern/sys_ptrace_common.c
cvs rdiff -u -r1.279 -r1.280 src/sys/net/if_ethersubr.c
cvs rdiff -u -r1.146 -r1.147 src/sys/sys/cdefs.h
cvs rdiff -u -r1.11 -r1.12 src/sys/sys/sdt.h

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



CVS commit: [netbsd-9] src/doc

2019-10-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 16 17:43:35 UTC 2019

Modified Files:
src/doc [netbsd-9]: CHANGES-9.0

Log Message:
Tickets #337, #338 and #340


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.78 -r1.1.2.79 src/doc/CHANGES-9.0

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

Modified files:

Index: src/doc/CHANGES-9.0
diff -u src/doc/CHANGES-9.0:1.1.2.78 src/doc/CHANGES-9.0:1.1.2.79
--- src/doc/CHANGES-9.0:1.1.2.78	Wed Oct 16 09:53:38 2019
+++ src/doc/CHANGES-9.0	Wed Oct 16 17:43:35 2019
@@ -1,5 +1,5 @@
 
-# $NetBSD: CHANGES-9.0,v 1.1.2.78 2019/10/16 09:53:38 martin Exp $
+# $NetBSD: CHANGES-9.0,v 1.1.2.79 2019/10/16 17:43:35 martin Exp $
 
 A complete list of changes from the initial NetBSD 9.0 branch on 2019-07-30
 until the 9.0 release:
@@ -4715,3 +4715,28 @@ sys/dev/isa/tpm_isa.c1.5-1.7
 	 - Provide a better abstraction for the TPM interface.
 	[maxv, ticket #336]
 
+sys/compat/netbsd32/netbsd32_fs.c		1.83
+
+	Fix netbsd32___mount50():
+	 - zero out fs_args32 to prevent info leaks
+	 - declare udata, and don't pass kernel pointers to copyout
+	 - make sure data_len is just big enough, to mimic the native behavior
+	 - don't forget to update *retval with the 32bit value
+	[maxv, ticket #337]
+
+sys/arch/x86/include/cpufunc.h			1.35
+
+	Add a memory barrier on wrmsr, because some MSRs control memory access
+	rights (we don't use them though). Also add barriers on fninit and clts
+	for safety.
+	[maxv, ticket #338]
+
+external/bsd/dhcpcd/dist/src/defs.h up to 1.1.1.32
+external/bsd/dhcpcd/dist/src/dhcp.c up to 1.29
+external/bsd/dhcpcd/dist/src/dhcpcd.c   up to 1.28
+external/bsd/dhcpcd/dist/src/ipv6.c up to 1.6
+src/doc/3RDPARTY(manually edited)
+
+	Import dhcpcd-8.1.1.
+	[roy, ticket #340]
+



CVS commit: [netbsd-9] src/doc

2019-10-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 16 17:43:35 UTC 2019

Modified Files:
src/doc [netbsd-9]: CHANGES-9.0

Log Message:
Tickets #337, #338 and #340


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.78 -r1.1.2.79 src/doc/CHANGES-9.0

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



CVS commit: [netbsd-9] src

2019-10-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 16 17:41:40 UTC 2019

Modified Files:
src/doc [netbsd-9]: 3RDPARTY
src/external/bsd/dhcpcd/dist/src [netbsd-9]: defs.h dhcp.c dhcpcd.c
ipv6.c

Log Message:
Pull up the following revisions, requested by roy in ticket #340:

external/bsd/dhcpcd/dist/src/defs.h up to 1.1.1.32
external/bsd/dhcpcd/dist/src/dhcp.c up to 1.29
external/bsd/dhcpcd/dist/src/dhcpcd.c   up to 1.28
external/bsd/dhcpcd/dist/src/ipv6.c up to 1.6
src/doc/3RDPARTY(manually edited)

Import dhcpcd-8.1.1 with the following changes:

 * IPv6: Fix a potential crash when learning interface addresses.
 * DHCP: Fix fallout from dhcpcd-8.1.0 for checksum calculation.


To generate a diff of this commit:
cvs rdiff -u -r1.1640.2.4 -r1.1640.2.5 src/doc/3RDPARTY
cvs rdiff -u -r1.1.1.25.2.2 -r1.1.1.25.2.3 \
src/external/bsd/dhcpcd/dist/src/defs.h
cvs rdiff -u -r1.23.2.2 -r1.23.2.3 src/external/bsd/dhcpcd/dist/src/dhcp.c \
src/external/bsd/dhcpcd/dist/src/dhcpcd.c
cvs rdiff -u -r1.3.2.2 -r1.3.2.3 src/external/bsd/dhcpcd/dist/src/ipv6.c

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



CVS commit: [netbsd-9] src

2019-10-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 16 17:41:40 UTC 2019

Modified Files:
src/doc [netbsd-9]: 3RDPARTY
src/external/bsd/dhcpcd/dist/src [netbsd-9]: defs.h dhcp.c dhcpcd.c
ipv6.c

Log Message:
Pull up the following revisions, requested by roy in ticket #340:

external/bsd/dhcpcd/dist/src/defs.h up to 1.1.1.32
external/bsd/dhcpcd/dist/src/dhcp.c up to 1.29
external/bsd/dhcpcd/dist/src/dhcpcd.c   up to 1.28
external/bsd/dhcpcd/dist/src/ipv6.c up to 1.6
src/doc/3RDPARTY(manually edited)

Import dhcpcd-8.1.1 with the following changes:

 * IPv6: Fix a potential crash when learning interface addresses.
 * DHCP: Fix fallout from dhcpcd-8.1.0 for checksum calculation.


To generate a diff of this commit:
cvs rdiff -u -r1.1640.2.4 -r1.1640.2.5 src/doc/3RDPARTY
cvs rdiff -u -r1.1.1.25.2.2 -r1.1.1.25.2.3 \
src/external/bsd/dhcpcd/dist/src/defs.h
cvs rdiff -u -r1.23.2.2 -r1.23.2.3 src/external/bsd/dhcpcd/dist/src/dhcp.c \
src/external/bsd/dhcpcd/dist/src/dhcpcd.c
cvs rdiff -u -r1.3.2.2 -r1.3.2.3 src/external/bsd/dhcpcd/dist/src/ipv6.c

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.1640.2.4 src/doc/3RDPARTY:1.1640.2.5
--- src/doc/3RDPARTY:1.1640.2.4	Sat Oct 12 14:44:31 2019
+++ src/doc/3RDPARTY	Wed Oct 16 17:41:40 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1640.2.4 2019/10/12 14:44:31 martin Exp $
+#	$NetBSD: 3RDPARTY,v 1.1640.2.5 2019/10/16 17:41:40 martin Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -341,12 +341,12 @@ Notes:
 Use the dhcp2netbsd script.
 
 Package:	dhcpcd
-Version:	8.1.0
-Current Vers:	8.1.0
+Version:	8.1.1
+Current Vers:	8.1.1
 Maintainer:	roy
 Archive Site:	ftp://roy.marples.name/pub/dhcpcd/
 Home Page:	http://roy.marples.name/projects/dhcpcd/
-Date:		2019-10-12
+Date:		2019-10-16
 Mailing List: 	dhcpcd-disc...@marples.name
 License:	BSD (2-clause)
 Location:	external/bsd/dhcpcd/dist

Index: src/external/bsd/dhcpcd/dist/src/defs.h
diff -u src/external/bsd/dhcpcd/dist/src/defs.h:1.1.1.25.2.2 src/external/bsd/dhcpcd/dist/src/defs.h:1.1.1.25.2.3
--- src/external/bsd/dhcpcd/dist/src/defs.h:1.1.1.25.2.2	Sat Oct 12 14:44:32 2019
+++ src/external/bsd/dhcpcd/dist/src/defs.h	Wed Oct 16 17:41:40 2019
@@ -29,7 +29,7 @@
 #define CONFIG_H
 
 #define PACKAGE			"dhcpcd"
-#define VERSION			"8.1.0"
+#define VERSION			"8.1.1"
 
 #ifndef CONFIG
 # define CONFIG			SYSCONFDIR "/" PACKAGE ".conf"

Index: src/external/bsd/dhcpcd/dist/src/dhcp.c
diff -u src/external/bsd/dhcpcd/dist/src/dhcp.c:1.23.2.2 src/external/bsd/dhcpcd/dist/src/dhcp.c:1.23.2.3
--- src/external/bsd/dhcpcd/dist/src/dhcp.c:1.23.2.2	Sat Oct 12 14:44:32 2019
+++ src/external/bsd/dhcpcd/dist/src/dhcp.c	Wed Oct 16 17:41:40 2019
@@ -164,8 +164,6 @@ dhcp_printoptions(const struct dhcpcd_ct
 	}
 }
 
-#define get_option_raw(ctx, bootp, bootp_len, opt)	\
-	get_option((ctx), (bootp), (bootp_len), NULL)
 static const uint8_t *
 get_option(struct dhcpcd_ctx *ctx,
 const struct bootp *bootp, size_t bootp_len,
@@ -3275,26 +3273,35 @@ is_packet_udp_bootp(void *packet, size_t
 {
 	struct ip *ip = packet;
 	size_t ip_hlen;
-	struct udphdr *udp;
+	struct udphdr udp;
 
-	if (sizeof(*ip) > plen)
+	if (plen < sizeof(*ip))
 		return false;
 
 	if (ip->ip_v != IPVERSION || ip->ip_p != IPPROTO_UDP)
 		return false;
 
 	/* Sanity. */
-	if (ntohs(ip->ip_len) != plen)
+	if (ntohs(ip->ip_len) > plen)
 		return false;
 
 	ip_hlen = (size_t)ip->ip_hl * 4;
+	if (ip_hlen < sizeof(*ip))
+		return false;
+
 	/* Check we have a UDP header and BOOTP. */
-	if (ip_hlen + sizeof(*udp) + offsetof(struct bootp, vend) > plen)
+	if (ip_hlen + sizeof(udp) + offsetof(struct bootp, vend) > plen)
+		return false;
+
+	/* Sanity. */
+	memcpy(, (char *)ip + ip_hlen, sizeof(udp));
+	if (ntohs(udp.uh_ulen) < sizeof(udp))
+		return false;
+	if (ip_hlen + ntohs(udp.uh_ulen) > plen)
 		return false;
 
 	/* Check it's to and from the right ports. */
-	udp = (struct udphdr *)(void *)((char *)ip + ip_hlen);
-	if (udp->uh_dport != htons(BOOTPC) || udp->uh_sport != htons(BOOTPS))
+	if (udp.uh_dport != htons(BOOTPC) || udp.uh_sport != htons(BOOTPS))
 		return false;
 
 	return true;
@@ -3306,14 +3313,17 @@ checksums_valid(void *packet,
 struct in_addr *from, unsigned int flags)
 {
 	struct ip *ip = packet;
-	struct ip pseudo_ip = {
-		.ip_p = IPPROTO_UDP,
-		.ip_src = ip->ip_src,
-		.ip_dst = ip->ip_dst
+	union pip {
+		struct ip ip;
+		uint16_t w[sizeof(struct ip)];
+	} pip = {
+		.ip.ip_p = IPPROTO_UDP,
+		.ip.ip_src = ip->ip_src,
+		.ip.ip_dst = ip->ip_dst,
 	};
 	size_t ip_hlen;
-	uint16_t udp_len, uh_sum;
-	struct udphdr *udp;
+	struct udphdr udp;
+	char *udpp, *uh_sump;
 	uint32_t csum;
 
 	

CVS commit: [netbsd-9] src/sys/arch/x86/include

2019-10-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 16 17:32:17 UTC 2019

Modified Files:
src/sys/arch/x86/include [netbsd-9]: cpufunc.h

Log Message:
Pull up following revision(s) (requested by maxv in ticket #338):

sys/arch/x86/include/cpufunc.h: revision 1.35

Add a memory barrier on wrmsr, because some MSRs control memory access
rights (we don't use them though). Also add barriers on fninit and clts
for safety.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.34.2.1 src/sys/arch/x86/include/cpufunc.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/arch/x86/include/cpufunc.h
diff -u src/sys/arch/x86/include/cpufunc.h:1.34 src/sys/arch/x86/include/cpufunc.h:1.34.2.1
--- src/sys/arch/x86/include/cpufunc.h:1.34	Fri Jul  5 17:08:55 2019
+++ src/sys/arch/x86/include/cpufunc.h	Wed Oct 16 17:32:17 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpufunc.h,v 1.34 2019/07/05 17:08:55 maxv Exp $	*/
+/*	$NetBSD: cpufunc.h,v 1.34.2.1 2019/10/16 17:32:17 martin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2007, 2019 The NetBSD Foundation, Inc.
@@ -271,7 +271,7 @@ union savefpu;
 static inline void
 fninit(void)
 {
-	__asm volatile ("fninit");
+	__asm volatile ("fninit" ::: "memory");
 }
 
 static inline void
@@ -303,7 +303,7 @@ fnstsw(uint16_t *val)
 static inline void
 clts(void)
 {
-	__asm volatile ("clts");
+	__asm volatile ("clts" ::: "memory");
 }
 
 void	stts(void);
@@ -433,6 +433,7 @@ wrmsr(u_int msr, uint64_t val)
 		"wrmsr"
 		:
 		: "a" (low), "d" (high), "c" (msr)
+		: "memory"
 	);
 }
 



CVS commit: [netbsd-9] src/sys/arch/x86/include

2019-10-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 16 17:32:17 UTC 2019

Modified Files:
src/sys/arch/x86/include [netbsd-9]: cpufunc.h

Log Message:
Pull up following revision(s) (requested by maxv in ticket #338):

sys/arch/x86/include/cpufunc.h: revision 1.35

Add a memory barrier on wrmsr, because some MSRs control memory access
rights (we don't use them though). Also add barriers on fninit and clts
for safety.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.34.2.1 src/sys/arch/x86/include/cpufunc.h

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



CVS commit: [netbsd-9] src/sys/compat/netbsd32

2019-10-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 16 17:29:50 UTC 2019

Modified Files:
src/sys/compat/netbsd32 [netbsd-9]: netbsd32_fs.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #337):

sys/compat/netbsd32/netbsd32_fs.c: revision 1.83

Fix netbsd32___mount50():
  - zero out fs_args32 to prevent info leaks
  - remove unused and non-functional copyin in NFS (lgtm bot)
  - declare udata, and don't pass kernel pointers to copyout (lgtm bot)
  - make sure data_len is just big enough, to mimic the native behavior
  - don't forget to update *retval with the 32bit value
  - add an XXX for NFS


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.82.4.1 src/sys/compat/netbsd32/netbsd32_fs.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/compat/netbsd32/netbsd32_fs.c
diff -u src/sys/compat/netbsd32/netbsd32_fs.c:1.82 src/sys/compat/netbsd32/netbsd32_fs.c:1.82.4.1
--- src/sys/compat/netbsd32/netbsd32_fs.c:1.82	Wed Dec 26 08:01:40 2018
+++ src/sys/compat/netbsd32/netbsd32_fs.c	Wed Oct 16 17:29:49 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_fs.c,v 1.82 2018/12/26 08:01:40 mrg Exp $	*/
+/*	$NetBSD: netbsd32_fs.c,v 1.82.4.1 2019/10/16 17:29:49 martin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_fs.c,v 1.82 2018/12/26 08:01:40 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_fs.c,v 1.82.4.1 2019/10/16 17:29:49 martin Exp $");
 
 #include 
 #include 
@@ -809,17 +809,21 @@ netbsd32___mount50(struct lwp *l, const 
 	const char *type = SCARG_P32(uap, type);
 	const char *path = SCARG_P32(uap, path);
 	int flags = SCARG(uap, flags);
-	void *data = SCARG_P32(uap, data);
+	void *data, *udata;
 	size_t data_len = SCARG(uap, data_len);
 	enum uio_seg data_seg;
 	size_t len;
 	int error;
  
+	udata = data = SCARG_P32(uap, data);
+	memset(_args32, 0, sizeof(fs_args32));
+
 	error = copyinstr(type, mtype, sizeof(mtype), );
 	if (error)
 		return error;
+
 	if (strcmp(mtype, MOUNT_TMPFS) == 0) {
-		if (data_len != sizeof(fs_args32.tmpfs_args))
+		if (data_len < sizeof(fs_args32.tmpfs_args))
 			return EINVAL;
 		if ((flags & MNT_GETARGS) == 0) {
 			error = copyin(data, _args32.tmpfs_args, 
@@ -843,7 +847,7 @@ netbsd32___mount50(struct lwp *l, const 
 		data = _args.tmpfs_args;
 		data_len = sizeof(fs_args.tmpfs_args);
 	} else if (strcmp(mtype, MOUNT_MFS) == 0) {
-		if (data_len != sizeof(fs_args32.mfs_args))
+		if (data_len < sizeof(fs_args32.mfs_args))
 			return EINVAL;
 		if ((flags & MNT_GETARGS) == 0) {
 			error = copyin(data, _args32.mfs_args, 
@@ -864,7 +868,7 @@ netbsd32___mount50(struct lwp *l, const 
 	} else if ((strcmp(mtype, MOUNT_UFS) == 0) ||
 		   (strcmp(mtype, MOUNT_EXT2FS) == 0) ||
 		   (strcmp(mtype, MOUNT_LFS) == 0)) {
-		if (data_len > sizeof(fs_args32.ufs_args))
+		if (data_len < sizeof(fs_args32.ufs_args))
 			return EINVAL;
 		if ((flags & MNT_GETARGS) == 0) {
 			error = copyin(data, _args32.ufs_args, 
@@ -878,7 +882,7 @@ netbsd32___mount50(struct lwp *l, const 
 		data = _args.ufs_args;
 		data_len = sizeof(fs_args.ufs_args);
 	} else if (strcmp(mtype, MOUNT_CD9660) == 0) {
-		if (data_len != sizeof(fs_args32.iso_args))
+		if (data_len < sizeof(fs_args32.iso_args))
 			return EINVAL;
 		if ((flags & MNT_GETARGS) == 0) {
 			error = copyin(data, _args32.iso_args, 
@@ -895,7 +899,7 @@ netbsd32___mount50(struct lwp *l, const 
 		data = _args.iso_args;
 		data_len = sizeof(fs_args.iso_args);
 	} else if (strcmp(mtype, MOUNT_MSDOS) == 0) {
-		if (data_len != sizeof(fs_args32.msdosfs_args))
+		if (data_len < sizeof(fs_args32.msdosfs_args))
 			return EINVAL;
 		if ((flags & MNT_GETARGS) == 0) {
 			error = copyin(data, _args32.msdosfs_args, 
@@ -925,8 +929,9 @@ netbsd32___mount50(struct lwp *l, const 
 		data = _args.msdosfs_args;
 		data_len = sizeof(fs_args.msdosfs_args);
 	} else if (strcmp(mtype, MOUNT_NFS) == 0) {
-		if (data_len != sizeof(fs_args32.nfs_args))
+		if (data_len < sizeof(fs_args32.nfs_args))
 			return EINVAL;
+		/* XXX: NFS requires copyin even with MNT_GETARGS */
 		if ((flags & MNT_GETARGS) == 0) {
 			error = copyin(data, _args32.nfs_args, 
 			sizeof(fs_args32.nfs_args));
@@ -952,7 +957,7 @@ netbsd32___mount50(struct lwp *l, const 
 		data = _args.nfs_args;
 		data_len = sizeof(fs_args.nfs_args);
 	} else if (strcmp(mtype, MOUNT_NULL) == 0) {
-		if (data_len > sizeof(fs_args32.null_args))
+		if (data_len < sizeof(fs_args32.null_args))
 			return EINVAL;
 		if ((flags & MNT_GETARGS) == 0) {
 			error = copyin(data, _args32.null_args, 
@@ -968,10 +973,12 @@ netbsd32___mount50(struct lwp *l, const 
 	} else {
 		data_seg = UIO_USERSPACE;
 	}
+
 	error = do_sys_mount(l, mtype, UIO_SYSSPACE, path, flags, data, data_seg,
 	data_len, retval);
 	if (error)
 		return error;
+
 	if (flags & MNT_GETARGS) {
 		data_len = *retval;
 		

CVS commit: [netbsd-9] src/sys/compat/netbsd32

2019-10-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 16 17:29:50 UTC 2019

Modified Files:
src/sys/compat/netbsd32 [netbsd-9]: netbsd32_fs.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #337):

sys/compat/netbsd32/netbsd32_fs.c: revision 1.83

Fix netbsd32___mount50():
  - zero out fs_args32 to prevent info leaks
  - remove unused and non-functional copyin in NFS (lgtm bot)
  - declare udata, and don't pass kernel pointers to copyout (lgtm bot)
  - make sure data_len is just big enough, to mimic the native behavior
  - don't forget to update *retval with the 32bit value
  - add an XXX for NFS


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.82.4.1 src/sys/compat/netbsd32/netbsd32_fs.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

2019-10-16 Thread Christos Zoulas
On Oct 16,  6:32pm, u...@stderr.spb.ru (Valery Ushakov) wrote:
-- Subject: Re: CVS commit: src/sys

| On Wed, Oct 16, 2019 at 11:27:39 -0400, Christos Zoulas wrote:
| 
| > Module Name:src
| > Committed By:   christos
| > Date:   Wed Oct 16 15:27:39 UTC 2019
| > 
| > Modified Files:
| > src/sys/kern: kern_core.c kern_hook.c kern_sig.c kern_veriexec.c
| > subr_ipi.c subr_pool.c subr_vmem.c sys_ptrace_common.c
| > src/sys/net: if_ethersubr.c
| > 
| > Log Message:
| > Add void * function pointer casts. There are different ways to "fix" those
| > warnings:
| > 1. this one: add a void * cast (which I think is the least intrusive)
| > 2. add pragmas to elide the warning
| > 3. add intermediate inline conversion functions
| > 4. change the called function prototypes, adding unused arguments and
| >converting some of the pointer arguments to void *.
| > 5. make the functions varyadic (which defeats the purpose of checking)
| > 6. pass command line flags to elide the warning
| > I did try 3 and 4 and I was not pleased with the result 
(sys_ptrace_common.c)
| > (3) added too much code and defines, and (4) made the regular use clumsy.
| 
| Can we maybe mark these (and others you did recently) with a macro
| akin to UNCONST, so that they can be found out later?
| 
| FCOERCE(int (*)(void *, void *), foo)
| 
| or something?

Sure,

__FUNCAST()?
__FPTRCAST()?

christos


Re: CVS commit: src/sys

2019-10-16 Thread Valery Ushakov
On Wed, Oct 16, 2019 at 11:27:39 -0400, Christos Zoulas wrote:

> Module Name:  src
> Committed By: christos
> Date: Wed Oct 16 15:27:39 UTC 2019
> 
> Modified Files:
>   src/sys/kern: kern_core.c kern_hook.c kern_sig.c kern_veriexec.c
>   subr_ipi.c subr_pool.c subr_vmem.c sys_ptrace_common.c
>   src/sys/net: if_ethersubr.c
> 
> Log Message:
> Add void * function pointer casts. There are different ways to "fix" those
> warnings:
> 1. this one: add a void * cast (which I think is the least intrusive)
> 2. add pragmas to elide the warning
> 3. add intermediate inline conversion functions
> 4. change the called function prototypes, adding unused arguments and
>converting some of the pointer arguments to void *.
> 5. make the functions varyadic (which defeats the purpose of checking)
> 6. pass command line flags to elide the warning
> I did try 3 and 4 and I was not pleased with the result (sys_ptrace_common.c)
> (3) added too much code and defines, and (4) made the regular use clumsy.

Can we maybe mark these (and others you did recently) with a macro
akin to UNCONST, so that they can be found out later?

FCOERCE(int (*)(void *, void *), foo)

or something?

-uwe


CVS commit: src/sys

2019-10-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Oct 16 15:27:39 UTC 2019

Modified Files:
src/sys/kern: kern_core.c kern_hook.c kern_sig.c kern_veriexec.c
subr_ipi.c subr_pool.c subr_vmem.c sys_ptrace_common.c
src/sys/net: if_ethersubr.c

Log Message:
Add void * function pointer casts. There are different ways to "fix" those
warnings:
1. this one: add a void * cast (which I think is the least intrusive)
2. add pragmas to elide the warning
3. add intermediate inline conversion functions
4. change the called function prototypes, adding unused arguments and
   converting some of the pointer arguments to void *.
5. make the functions varyadic (which defeats the purpose of checking)
6. pass command line flags to elide the warning
I did try 3 and 4 and I was not pleased with the result (sys_ptrace_common.c)
(3) added too much code and defines, and (4) made the regular use clumsy.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/kern/kern_core.c
cvs rdiff -u -r1.6 -r1.7 src/sys/kern/kern_hook.c
cvs rdiff -u -r1.373 -r1.374 src/sys/kern/kern_sig.c
cvs rdiff -u -r1.20 -r1.21 src/sys/kern/kern_veriexec.c
cvs rdiff -u -r1.5 -r1.6 src/sys/kern/subr_ipi.c
cvs rdiff -u -r1.259 -r1.260 src/sys/kern/subr_pool.c
cvs rdiff -u -r1.97 -r1.98 src/sys/kern/subr_vmem.c
cvs rdiff -u -r1.67 -r1.68 src/sys/kern/sys_ptrace_common.c
cvs rdiff -u -r1.278 -r1.279 src/sys/net/if_ethersubr.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/kern/kern_core.c
diff -u src/sys/kern/kern_core.c:1.24 src/sys/kern/kern_core.c:1.25
--- src/sys/kern/kern_core.c:1.24	Thu Jul  7 02:55:43 2016
+++ src/sys/kern/kern_core.c	Wed Oct 16 11:27:38 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_core.c,v 1.24 2016/07/07 06:55:43 msaitoh Exp $	*/
+/*	$NetBSD: kern_core.c,v 1.25 2019/10/16 15:27:38 christos Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1991, 1993
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_core.c,v 1.24 2016/07/07 06:55:43 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_core.c,v 1.25 2019/10/16 15:27:38 christos Exp $");
 
 #include 
 #include 
@@ -78,7 +78,7 @@ coredump_modcmd(modcmd_t cmd, void *arg)
 		 * no references, and so can be unloaded, no user programs
 		 * can be running and so nothing can call *coredump_vec.
 		 */
-		coredump_vec = (int (*)(struct lwp *, const char *))enosys;
+		coredump_vec = (int (*)(struct lwp *, const char *))(void *)enosys;
 		return 0;
 	default:
 		return ENOTTY;

Index: src/sys/kern/kern_hook.c
diff -u src/sys/kern/kern_hook.c:1.6 src/sys/kern/kern_hook.c:1.7
--- src/sys/kern/kern_hook.c:1.6	Fri Nov 22 16:04:11 2013
+++ src/sys/kern/kern_hook.c	Wed Oct 16 11:27:38 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_hook.c,v 1.6 2013/11/22 21:04:11 christos Exp $	*/
+/*	$NetBSD: kern_hook.c,v 1.7 2019/10/16 15:27:38 christos Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 1999, 2002, 2007, 2008 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_hook.c,v 1.6 2013/11/22 21:04:11 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_hook.c,v 1.7 2019/10/16 15:27:38 christos Exp $");
 
 #include 
 #include 
@@ -102,7 +102,7 @@ hook_proc_run(hook_list_t *list, struct 
 	struct hook_desc *hd;
 
 	LIST_FOREACH(hd, list, hk_list)
-		((void (*)(struct proc *, void *))*hd->hk_fn)(p, hd->hk_arg);
+		((void (*)(struct proc *, void *))(void *)*hd->hk_fn)(p, hd->hk_arg);
 }
 
 /*
@@ -201,7 +201,7 @@ static hook_list_t exechook_list = LIST_
 void *
 exechook_establish(void (*fn)(struct proc *, void *), void *arg)
 {
-	return hook_establish(_list, (void (*)(void *))fn, arg);
+	return hook_establish(_list, (void (*)(void *))(void *)fn, arg);
 }
 
 void
@@ -228,7 +228,7 @@ exithook_establish(void (*fn)(struct pro
 	void *rv;
 
 	rw_enter(_lock, RW_WRITER);
-	rv = hook_establish(_list, (void (*)(void *))fn, arg);
+	rv = hook_establish(_list, (void (*)(void *))(void *)fn, arg);
 	rw_exit(_lock);
 	return rv;
 }
@@ -256,7 +256,7 @@ static hook_list_t forkhook_list = LIST_
 void *
 forkhook_establish(void (*fn)(struct proc *, struct proc *))
 {
-	return hook_establish(_list, (void (*)(void *))fn, NULL);
+	return hook_establish(_list, (void (*)(void *))(void *)fn, NULL);
 }
 
 void
@@ -274,7 +274,7 @@ doforkhooks(struct proc *p2, struct proc
 	struct hook_desc *hd;
 
 	LIST_FOREACH(hd, _list, hk_list) {
-		((void (*)(struct proc *, struct proc *))*hd->hk_fn)
+		((void (*)(struct proc *, struct proc *))(void *)*hd->hk_fn)
 		(p2, p1);
 	}
 }

Index: src/sys/kern/kern_sig.c
diff -u src/sys/kern/kern_sig.c:1.373 src/sys/kern/kern_sig.c:1.374
--- src/sys/kern/kern_sig.c:1.373	Tue Oct 15 09:59:57 2019
+++ src/sys/kern/kern_sig.c	Wed Oct 16 11:27:38 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_sig.c,v 1.373 2019/10/15 13:59:57 kamil Exp $	*/
+/*	$NetBSD: kern_sig.c,v 1.374 2019/10/16 

CVS commit: src/sys

2019-10-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Oct 16 15:27:39 UTC 2019

Modified Files:
src/sys/kern: kern_core.c kern_hook.c kern_sig.c kern_veriexec.c
subr_ipi.c subr_pool.c subr_vmem.c sys_ptrace_common.c
src/sys/net: if_ethersubr.c

Log Message:
Add void * function pointer casts. There are different ways to "fix" those
warnings:
1. this one: add a void * cast (which I think is the least intrusive)
2. add pragmas to elide the warning
3. add intermediate inline conversion functions
4. change the called function prototypes, adding unused arguments and
   converting some of the pointer arguments to void *.
5. make the functions varyadic (which defeats the purpose of checking)
6. pass command line flags to elide the warning
I did try 3 and 4 and I was not pleased with the result (sys_ptrace_common.c)
(3) added too much code and defines, and (4) made the regular use clumsy.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/kern/kern_core.c
cvs rdiff -u -r1.6 -r1.7 src/sys/kern/kern_hook.c
cvs rdiff -u -r1.373 -r1.374 src/sys/kern/kern_sig.c
cvs rdiff -u -r1.20 -r1.21 src/sys/kern/kern_veriexec.c
cvs rdiff -u -r1.5 -r1.6 src/sys/kern/subr_ipi.c
cvs rdiff -u -r1.259 -r1.260 src/sys/kern/subr_pool.c
cvs rdiff -u -r1.97 -r1.98 src/sys/kern/subr_vmem.c
cvs rdiff -u -r1.67 -r1.68 src/sys/kern/sys_ptrace_common.c
cvs rdiff -u -r1.278 -r1.279 src/sys/net/if_ethersubr.c

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



CVS commit: src/sys/sys

2019-10-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Oct 16 15:08:09 UTC 2019

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

Log Message:
void * cast the probe functions that take more than 5 uintptr_t arguments
(dtrace_probe takes 5).


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/sys/sdt.h

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

Modified files:

Index: src/sys/sys/sdt.h
diff -u src/sys/sys/sdt.h:1.10 src/sys/sys/sdt.h:1.11
--- src/sys/sys/sdt.h:1.10	Sun Aug 26 12:54:38 2018
+++ src/sys/sys/sdt.h	Wed Oct 16 11:08:09 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdt.h,v 1.10 2018/08/26 16:54:38 riastradh Exp $	*/
+/*	$NetBSD: sdt.h,v 1.11 2019/10/16 15:08:09 christos Exp $	*/
 
 /*-
  * Copyright 2006-2008 John Birrell 
@@ -309,11 +309,13 @@
 	SDT_PROBE(prov, mod, func, name, arg0, arg1, arg2, arg3, 0)
 #define	SDT_PROBE5(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4) \
 	SDT_PROBE(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4)
+/* XXX: void * function casts */
 #define	SDT_PROBE6(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4, arg5)  \
 	do {   \
 		if (sdt_##prov##_##mod##_##func##_##name->id)		   \
 			(*(void (*)(uint32_t, uintptr_t, uintptr_t, uintptr_t, \
-			uintptr_t, uintptr_t, uintptr_t))sdt_probe_func)(  \
+			uintptr_t, uintptr_t, uintptr_t))(void *)	   \
+			sdt_probe_func)(     \
 			sdt_##prov##_##mod##_##func##_##name->id,	   \
 			(uintptr_t)arg0, (uintptr_t)arg1, (uintptr_t)arg2, \
 			(uintptr_t)arg3, (uintptr_t)arg4, (uintptr_t)arg5);\
@@ -324,7 +326,7 @@
 		if (sdt_##prov##_##mod##_##func##_##name->id)		   \
 			(*(void (*)(uint32_t, uintptr_t, uintptr_t, uintptr_t, \
 			uintptr_t, uintptr_t, uintptr_t, uintptr_t))   \
-			sdt_probe_func)(   \
+			(void *)sdt_probe_func)(			   \
 			sdt_##prov##_##mod##_##func##_##name->id,	   \
 			(uintptr_t)arg0, (uintptr_t)arg1, (uintptr_t)arg2, \
 			(uintptr_t)arg3, (uintptr_t)arg4, (uintptr_t)arg5, \



CVS commit: src/sys/sys

2019-10-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Oct 16 15:08:09 UTC 2019

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

Log Message:
void * cast the probe functions that take more than 5 uintptr_t arguments
(dtrace_probe takes 5).


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/sys/sdt.h

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



CVS commit: src/external/gpl3/gcc/dist/libobjc

2019-10-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Oct 16 15:01:56 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/libobjc: encoding.c

Log Message:
prevent DFmode re-definition.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/gpl3/gcc/dist/libobjc/encoding.c

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

Modified files:

Index: src/external/gpl3/gcc/dist/libobjc/encoding.c
diff -u src/external/gpl3/gcc/dist/libobjc/encoding.c:1.10 src/external/gpl3/gcc/dist/libobjc/encoding.c:1.11
--- src/external/gpl3/gcc/dist/libobjc/encoding.c:1.10	Tue Oct  1 06:38:22 2019
+++ src/external/gpl3/gcc/dist/libobjc/encoding.c	Wed Oct 16 11:01:56 2019
@@ -81,6 +81,7 @@ see the files COPYING3 and COPYING.RUNTI
 #define DECL_MODE(TYPE) *(TYPE)
 #define TYPE_MODE(TYPE) *(TYPE)
 
+#undef DFmode
 #define DFmode  _C_DBL
 
 #define strip_array_types(TYPE)  ({const char *_field = (TYPE); \



CVS commit: src/external/gpl3/gcc/dist/libobjc

2019-10-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Oct 16 15:01:56 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/libobjc: encoding.c

Log Message:
prevent DFmode re-definition.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/gpl3/gcc/dist/libobjc/encoding.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

2019-10-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Oct 16 15:01:10 UTC 2019

Modified Files:
src/sys/arch/x86/isa: clock.c
src/sys/arch/xen/xen: clock.c

Log Message:
add void * casts for the clock interrupt handlers.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/x86/isa/clock.c
cvs rdiff -u -r1.78 -r1.79 src/sys/arch/xen/xen/clock.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/isa/clock.c
diff -u src/sys/arch/x86/isa/clock.c:1.34 src/sys/arch/x86/isa/clock.c:1.35
--- src/sys/arch/x86/isa/clock.c:1.34	Fri Feb 15 03:54:01 2019
+++ src/sys/arch/x86/isa/clock.c	Wed Oct 16 11:01:10 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: clock.c,v 1.34 2019/02/15 08:54:01 nonaka Exp $	*/
+/*	$NetBSD: clock.c,v 1.35 2019/10/16 15:01:10 christos Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -121,7 +121,7 @@ WITH THE USE OR PERFORMANCE OF THIS SOFT
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.34 2019/02/15 08:54:01 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.35 2019/10/16 15:01:10 christos Exp $");
 
 /* #define CLOCKDEBUG */
 /* #define CLOCK_PARANOIA */
@@ -554,7 +554,7 @@ i8254_initclocks(void)
 	 * want to keep track of clock handlers.
 	 */
 	(void)isa_intr_establish(NULL, 0, IST_PULSE, IPL_CLOCK,
-	(int (*)(void *))clockintr, 0);
+	(int (*)(void *))(void *)clockintr, 0);
 }
 
 void

Index: src/sys/arch/xen/xen/clock.c
diff -u src/sys/arch/xen/xen/clock.c:1.78 src/sys/arch/xen/xen/clock.c:1.79
--- src/sys/arch/xen/xen/clock.c:1.78	Sat Mar  9 04:51:29 2019
+++ src/sys/arch/xen/xen/clock.c	Wed Oct 16 11:01:10 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: clock.c,v 1.78 2019/03/09 09:51:29 kre Exp $	*/
+/*	$NetBSD: clock.c,v 1.79 2019/10/16 15:01:10 christos Exp $	*/
 
 /*-
  * Copyright (c) 2017, 2018 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.78 2019/03/09 09:51:29 kre Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.79 2019/10/16 15:01:10 christos Exp $");
 
 #include 
 #include 
@@ -763,9 +763,9 @@ xen_resumeclocks(struct cpu_info *ci)
 	snprintf(intr_xname, sizeof(intr_xname), "%s clock",
 	device_xname(ci->ci_dev));
 	/* XXX sketchy function pointer cast -- fix the API, please */
-	ci->ci_xen_timer_intrhand = xen_intr_establish_xname(-1, _pic, evtch,
-	IST_LEVEL, IPL_CLOCK, (int (*)(void *))xen_timer_handler, ci, true,
-	intr_xname);
+	ci->ci_xen_timer_intrhand = xen_intr_establish_xname(-1, _pic,
+	evtch, IST_LEVEL, IPL_CLOCK,
+	(int (*)(void *))(void *)xen_timer_handler, ci, true, intr_xname);
 	if (ci->ci_xen_timer_intrhand == NULL)
 		panic("failed to establish timer interrupt handler");
 



CVS commit: src/sys/arch

2019-10-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Oct 16 15:01:10 UTC 2019

Modified Files:
src/sys/arch/x86/isa: clock.c
src/sys/arch/xen/xen: clock.c

Log Message:
add void * casts for the clock interrupt handlers.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/x86/isa/clock.c
cvs rdiff -u -r1.78 -r1.79 src/sys/arch/xen/xen/clock.c

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



CVS commit: src/doc

2019-10-16 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Wed Oct 16 14:56:34 UTC 2019

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
Note import of dhcpcd-8.1.1


To generate a diff of this commit:
cvs rdiff -u -r1.1663 -r1.1664 src/doc/3RDPARTY
cvs rdiff -u -r1.2595 -r1.2596 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.1663 src/doc/3RDPARTY:1.1664
--- src/doc/3RDPARTY:1.1663	Tue Oct 15 16:17:43 2019
+++ src/doc/3RDPARTY	Wed Oct 16 14:56:34 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1663 2019/10/15 16:17:43 christos Exp $
+#	$NetBSD: 3RDPARTY,v 1.1664 2019/10/16 14:56:34 roy Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -327,12 +327,12 @@ Notes:
 Use the dhcp2netbsd script.
 
 Package:	dhcpcd
-Version:	8.1.0
-Current Vers:	8.1.0
+Version:	8.1.1
+Current Vers:	8.1.1
 Maintainer:	roy
 Archive Site:	ftp://roy.marples.name/pub/dhcpcd/
 Home Page:	http://roy.marples.name/projects/dhcpcd/
-Date:		2019-10-11
+Date:		2019-10-16
 Mailing List: 	dhcpcd-disc...@marples.name
 License:	BSD (2-clause)
 Location:	external/bsd/dhcpcd/dist

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2595 src/doc/CHANGES:1.2596
--- src/doc/CHANGES:1.2595	Tue Oct 15 18:35:29 2019
+++ src/doc/CHANGES	Wed Oct 16 14:56:34 2019
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2595 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2596 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -58,3 +58,4 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	OpenSSH: Import 8.1. [christos 20191012]
 	acpi(4): Updated ACPICA to 20190816. [christos 20191015]
 	sup: removed, use ftp://ftp.astron.com/pub/sup [christos 20191015]
+	dhcpcd(8): Import dhcpcd-8.1.1 [roy 20191016]



CVS commit: src/doc

2019-10-16 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Wed Oct 16 14:56:34 UTC 2019

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
Note import of dhcpcd-8.1.1


To generate a diff of this commit:
cvs rdiff -u -r1.1663 -r1.1664 src/doc/3RDPARTY
cvs rdiff -u -r1.2595 -r1.2596 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/external/bsd/dhcpcd/dist/src

2019-10-16 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Wed Oct 16 14:54:39 UTC 2019

Modified Files:
src/external/bsd/dhcpcd/dist/src: dhcp.c dhcpcd.c ipv6.c

Log Message:
Sync


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/external/bsd/dhcpcd/dist/src/dhcp.c
cvs rdiff -u -r1.27 -r1.28 src/external/bsd/dhcpcd/dist/src/dhcpcd.c
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/dhcpcd/dist/src/ipv6.c

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

Modified files:

Index: src/external/bsd/dhcpcd/dist/src/dhcp.c
diff -u src/external/bsd/dhcpcd/dist/src/dhcp.c:1.28 src/external/bsd/dhcpcd/dist/src/dhcp.c:1.29
--- src/external/bsd/dhcpcd/dist/src/dhcp.c:1.28	Fri Oct 11 11:03:59 2019
+++ src/external/bsd/dhcpcd/dist/src/dhcp.c	Wed Oct 16 14:54:39 2019
@@ -164,8 +164,6 @@ dhcp_printoptions(const struct dhcpcd_ct
 	}
 }
 
-#define get_option_raw(ctx, bootp, bootp_len, opt)	\
-	get_option((ctx), (bootp), (bootp_len), NULL)
 static const uint8_t *
 get_option(struct dhcpcd_ctx *ctx,
 const struct bootp *bootp, size_t bootp_len,
@@ -3275,26 +3273,35 @@ is_packet_udp_bootp(void *packet, size_t
 {
 	struct ip *ip = packet;
 	size_t ip_hlen;
-	struct udphdr *udp;
+	struct udphdr udp;
 
-	if (sizeof(*ip) > plen)
+	if (plen < sizeof(*ip))
 		return false;
 
 	if (ip->ip_v != IPVERSION || ip->ip_p != IPPROTO_UDP)
 		return false;
 
 	/* Sanity. */
-	if (ntohs(ip->ip_len) != plen)
+	if (ntohs(ip->ip_len) > plen)
 		return false;
 
 	ip_hlen = (size_t)ip->ip_hl * 4;
+	if (ip_hlen < sizeof(*ip))
+		return false;
+
 	/* Check we have a UDP header and BOOTP. */
-	if (ip_hlen + sizeof(*udp) + offsetof(struct bootp, vend) > plen)
+	if (ip_hlen + sizeof(udp) + offsetof(struct bootp, vend) > plen)
+		return false;
+
+	/* Sanity. */
+	memcpy(, (char *)ip + ip_hlen, sizeof(udp));
+	if (ntohs(udp.uh_ulen) < sizeof(udp))
+		return false;
+	if (ip_hlen + ntohs(udp.uh_ulen) > plen)
 		return false;
 
 	/* Check it's to and from the right ports. */
-	udp = (struct udphdr *)(void *)((char *)ip + ip_hlen);
-	if (udp->uh_dport != htons(BOOTPC) || udp->uh_sport != htons(BOOTPS))
+	if (udp.uh_dport != htons(BOOTPC) || udp.uh_sport != htons(BOOTPS))
 		return false;
 
 	return true;
@@ -3306,14 +3313,17 @@ checksums_valid(void *packet,
 struct in_addr *from, unsigned int flags)
 {
 	struct ip *ip = packet;
-	struct ip pseudo_ip = {
-		.ip_p = IPPROTO_UDP,
-		.ip_src = ip->ip_src,
-		.ip_dst = ip->ip_dst
+	union pip {
+		struct ip ip;
+		uint16_t w[sizeof(struct ip)];
+	} pip = {
+		.ip.ip_p = IPPROTO_UDP,
+		.ip.ip_src = ip->ip_src,
+		.ip.ip_dst = ip->ip_dst,
 	};
 	size_t ip_hlen;
-	uint16_t udp_len, uh_sum;
-	struct udphdr *udp;
+	struct udphdr udp;
+	char *udpp, *uh_sump;
 	uint32_t csum;
 
 	if (from != NULL)
@@ -3324,22 +3334,32 @@ checksums_valid(void *packet,
 		return false;
 
 	if (flags & BPF_PARTIALCSUM)
-		return 0;
+		return true;
 
-	udp = (struct udphdr *)(void *)((char *)ip + ip_hlen);
-	if (udp->uh_sum == 0)
-		return 0;
+	udpp = (char *)ip + ip_hlen;
+	memcpy(, udpp, sizeof(udp));
+	if (udp.uh_sum == 0)
+		return true;
 
 	/* UDP checksum is based on a pseudo IP header alongside
 	 * the UDP header and payload. */
-	udp_len = ntohs(udp->uh_ulen);
-	uh_sum = udp->uh_sum;
-	udp->uh_sum = 0;
-	pseudo_ip.ip_len = udp->uh_ulen;
+	pip.ip.ip_len = udp.uh_ulen;
 	csum = 0;
-	in_cksum(_ip, sizeof(pseudo_ip), );
-	csum = in_cksum(udp, udp_len, );
-	return csum == uh_sum;
+
+	/* Need to zero the UDP sum in the packet for the checksum to work. */
+	uh_sump = udpp + offsetof(struct udphdr, uh_sum);
+	memset(uh_sump, 0, sizeof(udp.uh_sum));
+
+	/* Checksum psuedo header and then UDP + payload. */
+	in_cksum(pip.w, sizeof(pip.w), );
+	csum = in_cksum(udpp, ntohs(udp.uh_ulen), );
+
+#if 0	/* Not needed, just here for completeness. */
+	/* Put the checksum back. */
+	memcpy(uh_sump, _sum, sizeof(udp.uh_sum));
+#endif
+
+	return csum == udp.uh_sum;
 }
 
 static void

Index: src/external/bsd/dhcpcd/dist/src/dhcpcd.c
diff -u src/external/bsd/dhcpcd/dist/src/dhcpcd.c:1.27 src/external/bsd/dhcpcd/dist/src/dhcpcd.c:1.28
--- src/external/bsd/dhcpcd/dist/src/dhcpcd.c:1.27	Fri Oct 11 11:03:59 2019
+++ src/external/bsd/dhcpcd/dist/src/dhcpcd.c	Wed Oct 16 14:54:39 2019
@@ -1984,12 +1984,10 @@ printpidfile:
 	logdebugx(PACKAGE "-" VERSION " starting");
 	ctx.options |= DHCPCD_STARTED;
 
-#ifdef HAVE_SETPROCTITLE
 	setproctitle("%s%s%s",
 	ctx.options & DHCPCD_MASTER ? "[master]" : argv[optind],
 	ctx.options & DHCPCD_IPV4 ? " [ip4]" : "",
 	ctx.options & DHCPCD_IPV6 ? " [ip6]" : "");
-#endif
 
 	if (if_opensockets() == -1) {
 		logerr("%s: if_opensockets", __func__);
@@ -2155,6 +2153,9 @@ exit1:
 		loginfox(PACKAGE " exited");
 	logclose();
 	free(ctx.logfile);
+#ifdef SETPROCTITLE_H
+	setproctitle_free();
+#endif
 #ifdef USE_SIGNALS
 	if (ctx.options & DHCPCD_FORKED)
 		_exit(i); /* so atexit won't remove our pidfile */

Index: 

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

2019-10-16 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Wed Oct 16 14:54:39 UTC 2019

Modified Files:
src/external/bsd/dhcpcd/dist/src: dhcp.c dhcpcd.c ipv6.c

Log Message:
Sync


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/external/bsd/dhcpcd/dist/src/dhcp.c
cvs rdiff -u -r1.27 -r1.28 src/external/bsd/dhcpcd/dist/src/dhcpcd.c
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/dhcpcd/dist/src/ipv6.c

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



CVS import: src/external/bsd/dhcpcd/dist

2019-10-16 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Wed Oct 16 14:53:23 UTC 2019

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

Log Message:
Import dhcpcd-8.1.1 with the following changes:

 * IPv6: Fix a potential crash when learning interface addresses.
 * DHCP: Fix fallout from dhcpcd-8.1.0 for checksum calculation.

Status:

Vendor Tag: ROY
Release Tags:   dhcpcd-8_1_1

U src/external/bsd/dhcpcd/dist/LICENSE
U src/external/bsd/dhcpcd/dist/README.md
U src/external/bsd/dhcpcd/dist/src/defs.h
U src/external/bsd/dhcpcd/dist/src/common.c
U src/external/bsd/dhcpcd/dist/src/control.c
C src/external/bsd/dhcpcd/dist/src/dhcpcd.c
U src/external/bsd/dhcpcd/dist/src/duid.c
U src/external/bsd/dhcpcd/dist/src/eloop.c
U src/external/bsd/dhcpcd/dist/src/logerr.c
U src/external/bsd/dhcpcd/dist/src/if.c
U src/external/bsd/dhcpcd/dist/src/if-options.c
U src/external/bsd/dhcpcd/dist/src/sa.c
U src/external/bsd/dhcpcd/dist/src/route.c
U src/external/bsd/dhcpcd/dist/src/dhcp-common.c
U src/external/bsd/dhcpcd/dist/src/script.c
U src/external/bsd/dhcpcd/dist/src/auth.c
U src/external/bsd/dhcpcd/dist/src/if-bsd.c
C src/external/bsd/dhcpcd/dist/src/dhcp.c
U src/external/bsd/dhcpcd/dist/src/ipv4.c
U src/external/bsd/dhcpcd/dist/src/bpf.c
U src/external/bsd/dhcpcd/dist/src/arp.c
U src/external/bsd/dhcpcd/dist/src/ipv4ll.c
C src/external/bsd/dhcpcd/dist/src/ipv6.c
C src/external/bsd/dhcpcd/dist/src/ipv6nd.c
C src/external/bsd/dhcpcd/dist/src/dhcp6.c
U src/external/bsd/dhcpcd/dist/src/dhcpcd-embedded.c
U src/external/bsd/dhcpcd/dist/src/common.h
U src/external/bsd/dhcpcd/dist/src/control.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd.h
U src/external/bsd/dhcpcd/dist/src/duid.h
U src/external/bsd/dhcpcd/dist/src/eloop.h
U src/external/bsd/dhcpcd/dist/src/logerr.h
U src/external/bsd/dhcpcd/dist/src/if.h
U src/external/bsd/dhcpcd/dist/src/if-options.h
U src/external/bsd/dhcpcd/dist/src/sa.h
U src/external/bsd/dhcpcd/dist/src/route.h
U src/external/bsd/dhcpcd/dist/src/dhcp-common.h
U src/external/bsd/dhcpcd/dist/src/script.h
U src/external/bsd/dhcpcd/dist/src/auth.h
U src/external/bsd/dhcpcd/dist/src/dhcp.h
U src/external/bsd/dhcpcd/dist/src/ipv4.h
U src/external/bsd/dhcpcd/dist/src/bpf.h
U src/external/bsd/dhcpcd/dist/src/arp.h
U src/external/bsd/dhcpcd/dist/src/ipv4ll.h
U src/external/bsd/dhcpcd/dist/src/ipv6.h
U src/external/bsd/dhcpcd/dist/src/ipv6nd.h
U src/external/bsd/dhcpcd/dist/src/dhcp6.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd-embedded.h
U src/external/bsd/dhcpcd/dist/src/dev.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd.conf.5.in
U src/external/bsd/dhcpcd/dist/src/dhcpcd.8.in
U src/external/bsd/dhcpcd/dist/src/dhcpcd.conf
U src/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.in
U src/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.8.in
U src/external/bsd/dhcpcd/dist/hooks/01-test
U src/external/bsd/dhcpcd/dist/hooks/02-dump
U src/external/bsd/dhcpcd/dist/hooks/10-wpa_supplicant
U src/external/bsd/dhcpcd/dist/hooks/15-timezone
U src/external/bsd/dhcpcd/dist/hooks/20-resolv.conf
U src/external/bsd/dhcpcd/dist/hooks/29-lookup-hostname
U src/external/bsd/dhcpcd/dist/hooks/30-hostname
U src/external/bsd/dhcpcd/dist/hooks/50-ntp.conf
U src/external/bsd/dhcpcd/dist/hooks/50-ypbind.in

5 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jROY:yesterday -jROY src/external/bsd/dhcpcd/dist



CVS import: src/external/bsd/dhcpcd/dist

2019-10-16 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Wed Oct 16 14:53:23 UTC 2019

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

Log Message:
Import dhcpcd-8.1.1 with the following changes:

 * IPv6: Fix a potential crash when learning interface addresses.
 * DHCP: Fix fallout from dhcpcd-8.1.0 for checksum calculation.

Status:

Vendor Tag: ROY
Release Tags:   dhcpcd-8_1_1

U src/external/bsd/dhcpcd/dist/LICENSE
U src/external/bsd/dhcpcd/dist/README.md
U src/external/bsd/dhcpcd/dist/src/defs.h
U src/external/bsd/dhcpcd/dist/src/common.c
U src/external/bsd/dhcpcd/dist/src/control.c
C src/external/bsd/dhcpcd/dist/src/dhcpcd.c
U src/external/bsd/dhcpcd/dist/src/duid.c
U src/external/bsd/dhcpcd/dist/src/eloop.c
U src/external/bsd/dhcpcd/dist/src/logerr.c
U src/external/bsd/dhcpcd/dist/src/if.c
U src/external/bsd/dhcpcd/dist/src/if-options.c
U src/external/bsd/dhcpcd/dist/src/sa.c
U src/external/bsd/dhcpcd/dist/src/route.c
U src/external/bsd/dhcpcd/dist/src/dhcp-common.c
U src/external/bsd/dhcpcd/dist/src/script.c
U src/external/bsd/dhcpcd/dist/src/auth.c
U src/external/bsd/dhcpcd/dist/src/if-bsd.c
C src/external/bsd/dhcpcd/dist/src/dhcp.c
U src/external/bsd/dhcpcd/dist/src/ipv4.c
U src/external/bsd/dhcpcd/dist/src/bpf.c
U src/external/bsd/dhcpcd/dist/src/arp.c
U src/external/bsd/dhcpcd/dist/src/ipv4ll.c
C src/external/bsd/dhcpcd/dist/src/ipv6.c
C src/external/bsd/dhcpcd/dist/src/ipv6nd.c
C src/external/bsd/dhcpcd/dist/src/dhcp6.c
U src/external/bsd/dhcpcd/dist/src/dhcpcd-embedded.c
U src/external/bsd/dhcpcd/dist/src/common.h
U src/external/bsd/dhcpcd/dist/src/control.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd.h
U src/external/bsd/dhcpcd/dist/src/duid.h
U src/external/bsd/dhcpcd/dist/src/eloop.h
U src/external/bsd/dhcpcd/dist/src/logerr.h
U src/external/bsd/dhcpcd/dist/src/if.h
U src/external/bsd/dhcpcd/dist/src/if-options.h
U src/external/bsd/dhcpcd/dist/src/sa.h
U src/external/bsd/dhcpcd/dist/src/route.h
U src/external/bsd/dhcpcd/dist/src/dhcp-common.h
U src/external/bsd/dhcpcd/dist/src/script.h
U src/external/bsd/dhcpcd/dist/src/auth.h
U src/external/bsd/dhcpcd/dist/src/dhcp.h
U src/external/bsd/dhcpcd/dist/src/ipv4.h
U src/external/bsd/dhcpcd/dist/src/bpf.h
U src/external/bsd/dhcpcd/dist/src/arp.h
U src/external/bsd/dhcpcd/dist/src/ipv4ll.h
U src/external/bsd/dhcpcd/dist/src/ipv6.h
U src/external/bsd/dhcpcd/dist/src/ipv6nd.h
U src/external/bsd/dhcpcd/dist/src/dhcp6.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd-embedded.h
U src/external/bsd/dhcpcd/dist/src/dev.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd.conf.5.in
U src/external/bsd/dhcpcd/dist/src/dhcpcd.8.in
U src/external/bsd/dhcpcd/dist/src/dhcpcd.conf
U src/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.in
U src/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.8.in
U src/external/bsd/dhcpcd/dist/hooks/01-test
U src/external/bsd/dhcpcd/dist/hooks/02-dump
U src/external/bsd/dhcpcd/dist/hooks/10-wpa_supplicant
U src/external/bsd/dhcpcd/dist/hooks/15-timezone
U src/external/bsd/dhcpcd/dist/hooks/20-resolv.conf
U src/external/bsd/dhcpcd/dist/hooks/29-lookup-hostname
U src/external/bsd/dhcpcd/dist/hooks/30-hostname
U src/external/bsd/dhcpcd/dist/hooks/50-ntp.conf
U src/external/bsd/dhcpcd/dist/hooks/50-ypbind.in

5 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jROY:yesterday -jROY src/external/bsd/dhcpcd/dist



CVS import: src/external/bsd/dhcpcd/dist

2019-10-16 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Wed Oct 16 14:50:28 UTC 2019

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

Log Message:
Import dhcpcd-8.1.1 with the following changes:

 * IPv6: Fix a potential crash when learning interface addresses.
 * DHCP: Fix fallout from dhcpcd-8.1.0 for checksum calculation.

Status:

Vendor Tag: ROY
Release Tags:   dhcpcd-8_1_1

U src/external/bsd/dhcpcd/dist/LICENSE
U src/external/bsd/dhcpcd/dist/README.md
U src/external/bsd/dhcpcd/dist/src/defs.h
U src/external/bsd/dhcpcd/dist/src/common.c
U src/external/bsd/dhcpcd/dist/src/control.c
C src/external/bsd/dhcpcd/dist/src/dhcpcd.c
U src/external/bsd/dhcpcd/dist/src/duid.c
U src/external/bsd/dhcpcd/dist/src/eloop.c
U src/external/bsd/dhcpcd/dist/src/logerr.c
U src/external/bsd/dhcpcd/dist/src/if.c
U src/external/bsd/dhcpcd/dist/src/if-options.c
U src/external/bsd/dhcpcd/dist/src/sa.c
U src/external/bsd/dhcpcd/dist/src/route.c
U src/external/bsd/dhcpcd/dist/src/dhcp-common.c
U src/external/bsd/dhcpcd/dist/src/script.c
U src/external/bsd/dhcpcd/dist/src/auth.c
U src/external/bsd/dhcpcd/dist/src/if-bsd.c
C src/external/bsd/dhcpcd/dist/src/dhcp.c
U src/external/bsd/dhcpcd/dist/src/ipv4.c
U src/external/bsd/dhcpcd/dist/src/bpf.c
U src/external/bsd/dhcpcd/dist/src/arp.c
U src/external/bsd/dhcpcd/dist/src/ipv4ll.c
C src/external/bsd/dhcpcd/dist/src/ipv6.c
C src/external/bsd/dhcpcd/dist/src/ipv6nd.c
C src/external/bsd/dhcpcd/dist/src/dhcp6.c
U src/external/bsd/dhcpcd/dist/src/dhcpcd-embedded.c
U src/external/bsd/dhcpcd/dist/src/common.h
U src/external/bsd/dhcpcd/dist/src/control.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd.h
U src/external/bsd/dhcpcd/dist/src/duid.h
U src/external/bsd/dhcpcd/dist/src/eloop.h
U src/external/bsd/dhcpcd/dist/src/logerr.h
U src/external/bsd/dhcpcd/dist/src/if.h
U src/external/bsd/dhcpcd/dist/src/if-options.h
U src/external/bsd/dhcpcd/dist/src/sa.h
U src/external/bsd/dhcpcd/dist/src/route.h
U src/external/bsd/dhcpcd/dist/src/dhcp-common.h
U src/external/bsd/dhcpcd/dist/src/script.h
U src/external/bsd/dhcpcd/dist/src/auth.h
U src/external/bsd/dhcpcd/dist/src/dhcp.h
U src/external/bsd/dhcpcd/dist/src/ipv4.h
U src/external/bsd/dhcpcd/dist/src/bpf.h
U src/external/bsd/dhcpcd/dist/src/arp.h
U src/external/bsd/dhcpcd/dist/src/ipv4ll.h
U src/external/bsd/dhcpcd/dist/src/ipv6.h
U src/external/bsd/dhcpcd/dist/src/ipv6nd.h
U src/external/bsd/dhcpcd/dist/src/dhcp6.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd-embedded.h
U src/external/bsd/dhcpcd/dist/src/dev.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd.conf.5.in
U src/external/bsd/dhcpcd/dist/src/dhcpcd.8.in
U src/external/bsd/dhcpcd/dist/src/dhcpcd.conf
U src/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.in
U src/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.8.in
U src/external/bsd/dhcpcd/dist/hooks/01-test
U src/external/bsd/dhcpcd/dist/hooks/02-dump
U src/external/bsd/dhcpcd/dist/hooks/10-wpa_supplicant
U src/external/bsd/dhcpcd/dist/hooks/15-timezone
U src/external/bsd/dhcpcd/dist/hooks/20-resolv.conf
U src/external/bsd/dhcpcd/dist/hooks/29-lookup-hostname
U src/external/bsd/dhcpcd/dist/hooks/30-hostname
U src/external/bsd/dhcpcd/dist/hooks/50-ntp.conf
U src/external/bsd/dhcpcd/dist/hooks/50-ypbind.in

5 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jROY:yesterday -jROY src/external/bsd/dhcpcd/dist



CVS import: src/external/bsd/dhcpcd/dist

2019-10-16 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Wed Oct 16 14:50:28 UTC 2019

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

Log Message:
Import dhcpcd-8.1.1 with the following changes:

 * IPv6: Fix a potential crash when learning interface addresses.
 * DHCP: Fix fallout from dhcpcd-8.1.0 for checksum calculation.

Status:

Vendor Tag: ROY
Release Tags:   dhcpcd-8_1_1

U src/external/bsd/dhcpcd/dist/LICENSE
U src/external/bsd/dhcpcd/dist/README.md
U src/external/bsd/dhcpcd/dist/src/defs.h
U src/external/bsd/dhcpcd/dist/src/common.c
U src/external/bsd/dhcpcd/dist/src/control.c
C src/external/bsd/dhcpcd/dist/src/dhcpcd.c
U src/external/bsd/dhcpcd/dist/src/duid.c
U src/external/bsd/dhcpcd/dist/src/eloop.c
U src/external/bsd/dhcpcd/dist/src/logerr.c
U src/external/bsd/dhcpcd/dist/src/if.c
U src/external/bsd/dhcpcd/dist/src/if-options.c
U src/external/bsd/dhcpcd/dist/src/sa.c
U src/external/bsd/dhcpcd/dist/src/route.c
U src/external/bsd/dhcpcd/dist/src/dhcp-common.c
U src/external/bsd/dhcpcd/dist/src/script.c
U src/external/bsd/dhcpcd/dist/src/auth.c
U src/external/bsd/dhcpcd/dist/src/if-bsd.c
C src/external/bsd/dhcpcd/dist/src/dhcp.c
U src/external/bsd/dhcpcd/dist/src/ipv4.c
U src/external/bsd/dhcpcd/dist/src/bpf.c
U src/external/bsd/dhcpcd/dist/src/arp.c
U src/external/bsd/dhcpcd/dist/src/ipv4ll.c
C src/external/bsd/dhcpcd/dist/src/ipv6.c
C src/external/bsd/dhcpcd/dist/src/ipv6nd.c
C src/external/bsd/dhcpcd/dist/src/dhcp6.c
U src/external/bsd/dhcpcd/dist/src/dhcpcd-embedded.c
U src/external/bsd/dhcpcd/dist/src/common.h
U src/external/bsd/dhcpcd/dist/src/control.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd.h
U src/external/bsd/dhcpcd/dist/src/duid.h
U src/external/bsd/dhcpcd/dist/src/eloop.h
U src/external/bsd/dhcpcd/dist/src/logerr.h
U src/external/bsd/dhcpcd/dist/src/if.h
U src/external/bsd/dhcpcd/dist/src/if-options.h
U src/external/bsd/dhcpcd/dist/src/sa.h
U src/external/bsd/dhcpcd/dist/src/route.h
U src/external/bsd/dhcpcd/dist/src/dhcp-common.h
U src/external/bsd/dhcpcd/dist/src/script.h
U src/external/bsd/dhcpcd/dist/src/auth.h
U src/external/bsd/dhcpcd/dist/src/dhcp.h
U src/external/bsd/dhcpcd/dist/src/ipv4.h
U src/external/bsd/dhcpcd/dist/src/bpf.h
U src/external/bsd/dhcpcd/dist/src/arp.h
U src/external/bsd/dhcpcd/dist/src/ipv4ll.h
U src/external/bsd/dhcpcd/dist/src/ipv6.h
U src/external/bsd/dhcpcd/dist/src/ipv6nd.h
U src/external/bsd/dhcpcd/dist/src/dhcp6.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd-embedded.h
U src/external/bsd/dhcpcd/dist/src/dev.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd.conf.5.in
U src/external/bsd/dhcpcd/dist/src/dhcpcd.8.in
U src/external/bsd/dhcpcd/dist/src/dhcpcd.conf
U src/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.in
U src/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.8.in
U src/external/bsd/dhcpcd/dist/hooks/01-test
U src/external/bsd/dhcpcd/dist/hooks/02-dump
U src/external/bsd/dhcpcd/dist/hooks/10-wpa_supplicant
U src/external/bsd/dhcpcd/dist/hooks/15-timezone
U src/external/bsd/dhcpcd/dist/hooks/20-resolv.conf
U src/external/bsd/dhcpcd/dist/hooks/29-lookup-hostname
U src/external/bsd/dhcpcd/dist/hooks/30-hostname
U src/external/bsd/dhcpcd/dist/hooks/50-ntp.conf
U src/external/bsd/dhcpcd/dist/hooks/50-ypbind.in

5 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jROY:yesterday -jROY src/external/bsd/dhcpcd/dist



CVS commit: src/sys/dev/usb

2019-10-16 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Wed Oct 16 13:11:16 UTC 2019

Modified Files:
src/sys/dev/usb: if_ure.c

Log Message:
allocate a random mac address if on-chip mac is all zeroes.

helps ure(4) on NanoPi R1.

partly from ganbold@freebsd r346052.

XXX pullup-9


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/usb/if_ure.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/usb

2019-10-16 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Wed Oct 16 13:11:16 UTC 2019

Modified Files:
src/sys/dev/usb: if_ure.c

Log Message:
allocate a random mac address if on-chip mac is all zeroes.

helps ure(4) on NanoPi R1.

partly from ganbold@freebsd r346052.

XXX pullup-9


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/usb/if_ure.c

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

Modified files:

Index: src/sys/dev/usb/if_ure.c
diff -u src/sys/dev/usb/if_ure.c:1.32 src/sys/dev/usb/if_ure.c:1.33
--- src/sys/dev/usb/if_ure.c:1.32	Wed Oct 16 13:02:51 2019
+++ src/sys/dev/usb/if_ure.c	Wed Oct 16 13:11:16 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ure.c,v 1.32 2019/10/16 13:02:51 bad Exp $	*/
+/*	$NetBSD: if_ure.c,v 1.33 2019/10/16 13:11:16 bad Exp $	*/
 /*	$OpenBSD: if_ure.c,v 1.10 2018/11/02 21:32:30 jcs Exp $	*/
 
 /*-
@@ -30,7 +30,7 @@
 /* RealTek RTL8152/RTL8153 10/100/Gigabit USB Ethernet device */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_ure.c,v 1.32 2019/10/16 13:02:51 bad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ure.c,v 1.33 2019/10/16 13:11:16 bad Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -38,6 +38,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_ure.c,v 1
 #endif
 
 #include 
+#include 
 
 #include 
 
@@ -66,6 +67,9 @@ int	uredebug = 0;
 #define DPRINTFN(n, x)
 #endif
 
+#define ETHER_IS_ZERO(addr) \
+	(!(addr[0] | addr[1] | addr[2] | addr[3] | addr[4] | addr[5]))
+
 static const struct usb_devno ure_devs[] = {
 	{ USB_VENDOR_REALTEK, USB_PRODUCT_REALTEK_RTL8152 },
 	{ USB_VENDOR_REALTEK, USB_PRODUCT_REALTEK_RTL8153 }
@@ -848,6 +852,7 @@ ure_attach(device_t parent, device_t sel
 	uint16_t ver;
 	uint8_t eaddr[8]; /* 2byte padded */
 	char *devinfop;
+	uint32_t maclo, machi;
 
 	aprint_naive("\n");
 	aprint_normal("\n");
@@ -949,6 +954,16 @@ ure_attach(device_t parent, device_t sel
 		ure_read_mem(un, URE_PLA_BACKUP, URE_MCU_TYPE_PLA, eaddr,
 		sizeof(eaddr));
 	usbnet_unlock(un);
+	if (ETHER_IS_ZERO(eaddr)) {
+		maclo = 0x00f2 | (cprng_strong32() & 0x);
+		machi = cprng_strong32() & 0x;
+		eaddr[0] = maclo & 0xff;
+		eaddr[1] = (maclo >> 8) & 0xff;
+		eaddr[2] = (maclo >> 16) & 0xff;
+		eaddr[3] = (maclo >> 24) & 0xff;
+		eaddr[4] = machi & 0xff;
+		eaddr[5] = (machi >> 8) & 0xff;
+	}
 	memcpy(un->un_eaddr, eaddr, sizeof un->un_eaddr);
 
 	struct ifnet *ifp = usbnet_ifp(un);



CVS commit: src/sys/dev/usb

2019-10-16 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Wed Oct 16 13:02:51 UTC 2019

Modified Files:
src/sys/dev/usb: if_ure.c

Log Message:
read mac address of ure version 4c10 from URE_PLA_IDR, save as 4c00.

from ganbold@freebsd r346052.

XXX pullup-9


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/usb/if_ure.c

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

Modified files:

Index: src/sys/dev/usb/if_ure.c
diff -u src/sys/dev/usb/if_ure.c:1.31 src/sys/dev/usb/if_ure.c:1.32
--- src/sys/dev/usb/if_ure.c:1.31	Fri Aug 23 04:32:57 2019
+++ src/sys/dev/usb/if_ure.c	Wed Oct 16 13:02:51 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ure.c,v 1.31 2019/08/23 04:32:57 mrg Exp $	*/
+/*	$NetBSD: if_ure.c,v 1.32 2019/10/16 13:02:51 bad Exp $	*/
 /*	$OpenBSD: if_ure.c,v 1.10 2018/11/02 21:32:30 jcs Exp $	*/
 
 /*-
@@ -30,7 +30,7 @@
 /* RealTek RTL8152/RTL8153 10/100/Gigabit USB Ethernet device */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_ure.c,v 1.31 2019/08/23 04:32:57 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ure.c,v 1.32 2019/10/16 13:02:51 bad Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -941,7 +941,8 @@ ure_attach(device_t parent, device_t sel
 	else
 		ure_rtl8153_init(un);
 
-	if (un->un_flags & URE_FLAG_VER_4C00)
+	if ((un->un_flags & URE_FLAG_VER_4C00) ||
+	(un->un_flags & URE_FLAG_VER_4C10))
 		ure_read_mem(un, URE_PLA_IDR, URE_MCU_TYPE_PLA, eaddr,
 		sizeof(eaddr));
 	else



CVS commit: src/sys/dev/usb

2019-10-16 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Wed Oct 16 13:02:51 UTC 2019

Modified Files:
src/sys/dev/usb: if_ure.c

Log Message:
read mac address of ure version 4c10 from URE_PLA_IDR, save as 4c00.

from ganbold@freebsd r346052.

XXX pullup-9


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/usb/if_ure.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/arm/imx

2019-10-16 Thread Kenichi Hashimoto
Module Name:src
Committed By:   hkenken
Date:   Wed Oct 16 11:16:31 UTC 2019

Modified Files:
src/sys/arch/arm/imx: imx6_pcie.c imxpcie.c imxpciereg.h imxpcievar.h
src/sys/arch/arm/imx/fdt: imx6_pcie.c

Log Message:
Fixed bug when using PCIe external clock.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/arm/imx/imx6_pcie.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/imx/imxpcie.c \
src/sys/arch/arm/imx/imxpciereg.h src/sys/arch/arm/imx/imxpcievar.h
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/imx/fdt/imx6_pcie.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/arm/imx

2019-10-16 Thread Kenichi Hashimoto
Module Name:src
Committed By:   hkenken
Date:   Wed Oct 16 11:16:31 UTC 2019

Modified Files:
src/sys/arch/arm/imx: imx6_pcie.c imxpcie.c imxpciereg.h imxpcievar.h
src/sys/arch/arm/imx/fdt: imx6_pcie.c

Log Message:
Fixed bug when using PCIe external clock.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/arm/imx/imx6_pcie.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/imx/imxpcie.c \
src/sys/arch/arm/imx/imxpciereg.h src/sys/arch/arm/imx/imxpcievar.h
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/imx/fdt/imx6_pcie.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/arm/imx/imx6_pcie.c
diff -u src/sys/arch/arm/imx/imx6_pcie.c:1.13 src/sys/arch/arm/imx/imx6_pcie.c:1.14
--- src/sys/arch/arm/imx/imx6_pcie.c:1.13	Sat Jul 27 08:02:04 2019
+++ src/sys/arch/arm/imx/imx6_pcie.c	Wed Oct 16 11:16:30 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx6_pcie.c,v 1.13 2019/07/27 08:02:04 skrll Exp $	*/
+/*	$NetBSD: imx6_pcie.c,v 1.14 2019/10/16 11:16:30 hkenken Exp $	*/
 
 /*
  * Copyright (c) 2016  Genetec Corporation.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: imx6_pcie.c,v 1.13 2019/07/27 08:02:04 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imx6_pcie.c,v 1.14 2019/10/16 11:16:30 hkenken Exp $");
 
 #include "opt_pci.h"
 
@@ -151,19 +151,19 @@ imx6_pcie_attach(device_t parent, device
 	imx6_set_gpio(self, "imxpcie-reset-gpio", >sc_gpio_reset,
 	>sc_gpio_reset_active, GPIO_PIN_OUTPUT);
 
-	sc->sc_clk_pcie_axi = imx6_get_clock("pcie_axi");
-	if (sc->sc_clk_pcie_axi == NULL) {
-		aprint_error(": couldn't get clock pcie_axi\n");
+	sc->sc_clk_pcie = imx6_get_clock("pcie_axi");
+	if (sc->sc_clk_pcie == NULL) {
+		aprint_error(": couldn't get clock pcie\n");
 		return;
 	}
-	sc->sc_clk_lvds1_gate = imx6_get_clock("lvds1_gate");
-	if (sc->sc_clk_lvds1_gate == NULL) {
-		aprint_error(": couldn't get clock lvds1_gate\n");
+	sc->sc_clk_pcie_bus = imx6_get_clock("lvds1_gate");
+	if (sc->sc_clk_pcie_bus == NULL) {
+		aprint_error(": couldn't get clock pcie_bus\n");
 		return;
 	}
-	sc->sc_clk_pcie_ref = imx6_get_clock("pcie_ref_125m");
-	if (sc->sc_clk_pcie_ref == NULL) {
-		aprint_error(": couldn't get clock pcie_ref\n");
+	sc->sc_clk_pcie_phy = imx6_get_clock("pcie_ref_125m");
+	if (sc->sc_clk_pcie_phy == NULL) {
+		aprint_error(": couldn't get clock pcie_phy\n");
 		return;
 	}
 

Index: src/sys/arch/arm/imx/imxpcie.c
diff -u src/sys/arch/arm/imx/imxpcie.c:1.2 src/sys/arch/arm/imx/imxpcie.c:1.3
--- src/sys/arch/arm/imx/imxpcie.c:1.2	Mon Sep  2 01:28:41 2019
+++ src/sys/arch/arm/imx/imxpcie.c	Wed Oct 16 11:16:30 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: imxpcie.c,v 1.2 2019/09/02 01:28:41 hkenken Exp $	*/
+/*	$NetBSD: imxpcie.c,v 1.3 2019/10/16 11:16:30 hkenken Exp $	*/
 
 /*
  * Copyright (c) 2019  Genetec Corporation.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: imxpcie.c,v 1.2 2019/09/02 01:28:41 hkenken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imxpcie.c,v 1.3 2019/10/16 11:16:30 hkenken Exp $");
 
 #include "opt_pci.h"
 #include "opt_fdt.h"
@@ -133,6 +133,7 @@ imxpcie_init_phy(struct imxpcie_softc *s
 	v |= __SHIFTIN(20, IOMUX_GPR8_PCS_TX_DEEMPH_GEN1);
 	sc->sc_gpr_write(sc, IOMUX_GPR8, v);
 
+	v = sc->sc_gpr_read(sc, IOMUX_GPR12);
 	v &= ~IOMUX_GPR12_DEVICE_TYPE;
 	v |= IOMUX_GPR12_DEVICE_TYPE_PCIE_RC;
 	sc->sc_gpr_write(sc, IOMUX_GPR12, v);
@@ -244,12 +245,12 @@ imxpcie_phy_read(struct imxpcie_softc *s
 static int
 imxpcie_assert_core_reset(struct imxpcie_softc *sc)
 {
+	uint32_t gpr1 = sc->sc_gpr_read(sc, IOMUX_GPR1);
+
 	if (sc->sc_have_sw_reset) {
-		uint32_t gpr1 = sc->sc_gpr_read(sc, IOMUX_GPR1);
 		gpr1 |= IOMUX_GPR1_PCIE_SW_RST;
 		sc->sc_gpr_write(sc, IOMUX_GPR1, gpr1);
 	} else {
-		uint32_t gpr1 = sc->sc_gpr_read(sc, IOMUX_GPR1);
 		uint32_t gpr12 = sc->sc_gpr_read(sc, IOMUX_GPR12);
 
 		/* already enabled by bootloader */
@@ -263,13 +264,13 @@ imxpcie_assert_core_reset(struct imxpcie
 			gpr12 &= ~IOMUX_GPR12_APP_LTSSM_ENABLE;
 			sc->sc_gpr_write(sc, IOMUX_GPR12, gpr12);
 		}
-
-		gpr1 |= IOMUX_GPR1_TEST_POWERDOWN;
-		sc->sc_gpr_write(sc, IOMUX_GPR1, gpr1);
-		gpr1 &= ~IOMUX_GPR1_REF_SSP_EN;
-		sc->sc_gpr_write(sc, IOMUX_GPR1, gpr1);
 	}
 
+	gpr1 |= IOMUX_GPR1_TEST_POWERDOWN;
+	sc->sc_gpr_write(sc, IOMUX_GPR1, gpr1);
+	gpr1 &= ~IOMUX_GPR1_REF_SSP_EN;
+	sc->sc_gpr_write(sc, IOMUX_GPR1, gpr1);
+
 	return 0;
 }
 
@@ -278,29 +279,28 @@ imxpcie_deassert_core_reset(struct imxpc
 {
 	int error;
 
-	error = clk_enable(sc->sc_clk_pcie_axi);
+	error = clk_enable(sc->sc_clk_pcie);
 	if (error) {
-		aprint_error_dev(sc->sc_dev, "couldn't enable pcie_axi: %d\n", error);
+		aprint_error_dev(sc->sc_dev, "couldn't enable pcie: %d\n", error);
 		return error;
 	}
 
 	if (sc->sc_ext_osc) {
-		clk_set_parent(sc->sc_clk_pcie_ext, sc->sc_clk_pcie_ext_src);
 		error = clk_enable(sc->sc_clk_pcie_ext);
 		if (error) {
 	

CVS commit: [netbsd-9] src/doc

2019-10-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 16 09:53:38 UTC 2019

Modified Files:
src/doc [netbsd-9]: CHANGES-9.0

Log Message:
Tickets #335 and #336


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.77 -r1.1.2.78 src/doc/CHANGES-9.0

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

Modified files:

Index: src/doc/CHANGES-9.0
diff -u src/doc/CHANGES-9.0:1.1.2.77 src/doc/CHANGES-9.0:1.1.2.78
--- src/doc/CHANGES-9.0:1.1.2.77	Tue Oct 15 19:44:45 2019
+++ src/doc/CHANGES-9.0	Wed Oct 16 09:53:38 2019
@@ -1,5 +1,5 @@
 
-# $NetBSD: CHANGES-9.0,v 1.1.2.77 2019/10/15 19:44:45 martin Exp $
+# $NetBSD: CHANGES-9.0,v 1.1.2.78 2019/10/16 09:53:38 martin Exp $
 
 A complete list of changes from the initial NetBSD 9.0 branch on 2019-07-30
 until the 9.0 release:
@@ -4692,3 +4692,26 @@ sys/arch/arm/cortex/gic_v2m.h			1.2
 	Add support for Amazon's Graviton MSI controller.
 	[jmcneill, ticket #334]
 
+sys/net/bpf.c	1.230,1.231
+
+	Add KASSERT. Skip zero sized packets.
+	[maxv, ticket #335]
+
+share/man/man4/tpm.41.5
+sys/dev/acpi/tpm_acpi.c1.9-1.11
+sys/dev/acpi/tpm_acpi.c1.9
+sys/dev/ic/tpm.c1.14-1.16
+sys/dev/ic/tpmreg.h1.5,1.6
+sys/dev/ic/tpmvar.h1.5-1.7
+sys/dev/isa/tpm_isa.c1.5-1.7
+
+	Improvements in tpm(4):
+	 - Remove interrupt support, do polling only.
+	 - Simplify a few things.
+	 - Fix the suspend function.
+	 - Make the driver MP-safe.
+	 - Sync the man page with reality.
+	 - Add suspend support for TPM 2.0 chips.
+	 - Provide a better abstraction for the TPM interface.
+	[maxv, ticket #336]
+



CVS commit: [netbsd-9] src/doc

2019-10-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 16 09:53:38 UTC 2019

Modified Files:
src/doc [netbsd-9]: CHANGES-9.0

Log Message:
Tickets #335 and #336


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.77 -r1.1.2.78 src/doc/CHANGES-9.0

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



CVS commit: [netbsd-9] src

2019-10-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 16 09:52:38 UTC 2019

Modified Files:
src/share/man/man4 [netbsd-9]: tpm.4
src/sys/dev/acpi [netbsd-9]: tpm_acpi.c
src/sys/dev/ic [netbsd-9]: tpm.c tpmreg.h tpmvar.h
src/sys/dev/isa [netbsd-9]: tpm_isa.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #336):

sys/dev/isa/tpm_isa.c: revision 1.6
sys/dev/ic/tpm.c: revision 1.16
sys/dev/isa/tpm_isa.c: revision 1.7
sys/dev/acpi/tpm_acpi.c: revision 1.10
sys/dev/acpi/tpm_acpi.c: revision 1.11
sys/dev/ic/tpmreg.h: revision 1.5
sys/dev/ic/tpmreg.h: revision 1.6
sys/dev/acpi/tpm_acpi.c: revision 1.9
sys/dev/ic/tpmvar.h: revision 1.5
sys/dev/ic/tpmvar.h: revision 1.6
sys/dev/ic/tpmvar.h: revision 1.7
sys/dev/ic/tpm.c: revision 1.14
share/man/man4/tpm.4: revision 1.5
sys/dev/isa/tpm_isa.c: revision 1.5
sys/dev/ic/tpm.c: revision 1.15

Improvements in tpm(4):
  - Remove interrupt support, do polling only, avoids unnecessary trouble.
  - Simplify a few things.
  - Fix the suspend function, the SaveState command is 0x98, not 0x9C.
  - Make the driver MP-safe.
  - Sync the man page with reality.

 -

Add suspend support for TPM 2.0 chips. Check the TPM response also for 1.2
chips. Unfortunately I cannot really test this change since ACPI suspend
does not work on any of my laptops.

 -

Provide a better abstraction for the TPM interface. Report it in the ioctl.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.6.1 src/share/man/man4/tpm.4
cvs rdiff -u -r1.8 -r1.8.2.1 src/sys/dev/acpi/tpm_acpi.c
cvs rdiff -u -r1.13 -r1.13.2.1 src/sys/dev/ic/tpm.c
cvs rdiff -u -r1.4 -r1.4.2.1 src/sys/dev/ic/tpmreg.h src/sys/dev/ic/tpmvar.h
cvs rdiff -u -r1.4 -r1.4.2.1 src/sys/dev/isa/tpm_isa.c

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/tpm.4
diff -u src/share/man/man4/tpm.4:1.4 src/share/man/man4/tpm.4:1.4.6.1
--- src/share/man/man4/tpm.4:1.4	Thu Feb 22 01:40:49 2018
+++ src/share/man/man4/tpm.4	Wed Oct 16 09:52:38 2019
@@ -1,20 +1,33 @@
-.\"	$NetBSD: tpm.4,v 1.4 2018/02/22 01:40:49 pgoyette Exp $
+.\"	$NetBSD: tpm.4,v 1.4.6.1 2019/10/16 09:52:38 martin Exp $
 .\"
-.\" Copyright (c) 2010 Hans-Jörg Höxer, 
+.\" Copyright (c) 2019 The NetBSD Foundation, Inc.
+.\" All rights reserved.
 .\"
-.\" Permission to use, copy, modify, and distribute this software for any
-.\" purpose with or without fee is hereby granted, provided that the above
-.\" copyright notice and this permission notice appear in all copies.
+.\" This code is derived from software contributed to The NetBSD Foundation
+.\" by Maxime Villard.
 .\"
-.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"notice, this list of conditions and the following disclaimer in the
+.\"documentation and/or other materials provided with the distribution.
 .\"
-.Dd February 22, 2018
+.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+.\" POSSIBILITY OF SUCH DAMAGE.
+.\"
+.Dd October 6, 2019
 .Dt TPM 4
 .Os
 .Sh NAME
@@ -22,40 +35,22 @@
 .Nd Trusted Platform Module
 .Sh SYNOPSIS
 .Cd "tpm* at isa? iomem 0xfed4"
-.Cd "tpm* at isa? iomem 0xfed4 irq 7"
 .Cd "tpm* at acpi?"
 .Sh DESCRIPTION
 The
 .Nm
-driver provides support 

CVS commit: [netbsd-9] src

2019-10-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 16 09:52:38 UTC 2019

Modified Files:
src/share/man/man4 [netbsd-9]: tpm.4
src/sys/dev/acpi [netbsd-9]: tpm_acpi.c
src/sys/dev/ic [netbsd-9]: tpm.c tpmreg.h tpmvar.h
src/sys/dev/isa [netbsd-9]: tpm_isa.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #336):

sys/dev/isa/tpm_isa.c: revision 1.6
sys/dev/ic/tpm.c: revision 1.16
sys/dev/isa/tpm_isa.c: revision 1.7
sys/dev/acpi/tpm_acpi.c: revision 1.10
sys/dev/acpi/tpm_acpi.c: revision 1.11
sys/dev/ic/tpmreg.h: revision 1.5
sys/dev/ic/tpmreg.h: revision 1.6
sys/dev/acpi/tpm_acpi.c: revision 1.9
sys/dev/ic/tpmvar.h: revision 1.5
sys/dev/ic/tpmvar.h: revision 1.6
sys/dev/ic/tpmvar.h: revision 1.7
sys/dev/ic/tpm.c: revision 1.14
share/man/man4/tpm.4: revision 1.5
sys/dev/isa/tpm_isa.c: revision 1.5
sys/dev/ic/tpm.c: revision 1.15

Improvements in tpm(4):
  - Remove interrupt support, do polling only, avoids unnecessary trouble.
  - Simplify a few things.
  - Fix the suspend function, the SaveState command is 0x98, not 0x9C.
  - Make the driver MP-safe.
  - Sync the man page with reality.

 -

Add suspend support for TPM 2.0 chips. Check the TPM response also for 1.2
chips. Unfortunately I cannot really test this change since ACPI suspend
does not work on any of my laptops.

 -

Provide a better abstraction for the TPM interface. Report it in the ioctl.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.6.1 src/share/man/man4/tpm.4
cvs rdiff -u -r1.8 -r1.8.2.1 src/sys/dev/acpi/tpm_acpi.c
cvs rdiff -u -r1.13 -r1.13.2.1 src/sys/dev/ic/tpm.c
cvs rdiff -u -r1.4 -r1.4.2.1 src/sys/dev/ic/tpmreg.h src/sys/dev/ic/tpmvar.h
cvs rdiff -u -r1.4 -r1.4.2.1 src/sys/dev/isa/tpm_isa.c

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



CVS commit: [netbsd-9] src/sys/net

2019-10-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 16 09:46:55 UTC 2019

Modified Files:
src/sys/net [netbsd-9]: bpf.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #335):

sys/net/bpf.c: revision 1.230
sys/net/bpf.c: revision 1.231

Add KASSERT to catch bugs. Something tells me it could easily fire.

 -

As I suspected, the KASSERT I added yesterday can fire if we try to process
zero-sized packets. Skip them to prevent a type confusion that can trigger
random page faults later.


To generate a diff of this commit:
cvs rdiff -u -r1.229 -r1.229.2.1 src/sys/net/bpf.c

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



CVS commit: [netbsd-9] src/sys/net

2019-10-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 16 09:46:55 UTC 2019

Modified Files:
src/sys/net [netbsd-9]: bpf.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #335):

sys/net/bpf.c: revision 1.230
sys/net/bpf.c: revision 1.231

Add KASSERT to catch bugs. Something tells me it could easily fire.

 -

As I suspected, the KASSERT I added yesterday can fire if we try to process
zero-sized packets. Skip them to prevent a type confusion that can trigger
random page faults later.


To generate a diff of this commit:
cvs rdiff -u -r1.229 -r1.229.2.1 src/sys/net/bpf.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/bpf.c
diff -u src/sys/net/bpf.c:1.229 src/sys/net/bpf.c:1.229.2.1
--- src/sys/net/bpf.c:1.229	Wed Jul 10 17:55:33 2019
+++ src/sys/net/bpf.c	Wed Oct 16 09:46:55 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: bpf.c,v 1.229 2019/07/10 17:55:33 maxv Exp $	*/
+/*	$NetBSD: bpf.c,v 1.229.2.1 2019/10/16 09:46:55 martin Exp $	*/
 
 /*
  * Copyright (c) 1990, 1991, 1993
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.229 2019/07/10 17:55:33 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.229.2.1 2019/10/16 09:46:55 martin Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_bpf.h"
@@ -1676,10 +1676,16 @@ _bpf_mtap(struct bpf_if *bp, struct mbuf
 
 	pktlen = m_length(m);
 
+	/* Skip zero-sized packets. */
+	if (__predict_false(pktlen == 0)) {
+		return;
+	}
+
 	if (pktlen == m->m_len) {
 		cpfn = (void *)memcpy;
 		marg = mtod(m, void *);
 		buflen = pktlen;
+		KASSERT(buflen != 0);
 	} else {
 		cpfn = bpf_mcpy;
 		marg = m;



CVS commit: src/external/bsd/openldap/lib/libldap

2019-10-16 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Oct 16 07:39:19 UTC 2019

Modified Files:
src/external/bsd/openldap/lib/libldap: Makefile.libldap

Log Message:
use GCC_NO_STRINGOP_OVERFLOW for charray.c.

this only affects some platforms.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 \
src/external/bsd/openldap/lib/libldap/Makefile.libldap

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

Modified files:

Index: src/external/bsd/openldap/lib/libldap/Makefile.libldap
diff -u src/external/bsd/openldap/lib/libldap/Makefile.libldap:1.9 src/external/bsd/openldap/lib/libldap/Makefile.libldap:1.10
--- src/external/bsd/openldap/lib/libldap/Makefile.libldap:1.9	Sun Feb  4 03:19:52 2018
+++ src/external/bsd/openldap/lib/libldap/Makefile.libldap	Wed Oct 16 07:39:18 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.libldap,v 1.9 2018/02/04 03:19:52 christos Exp $
+#	$NetBSD: Makefile.libldap,v 1.10 2019/10/16 07:39:18 mrg Exp $
 
 .include "../../openldap.mk"
 
@@ -25,3 +25,5 @@ LIBDPLIBS+=	lber	${.CURDIR}/../liblber
 
 LIBDPLIBS+=	crypto	${NETBSDSRCDIR}/crypto/external/bsd/${EXTERNAL_OPENSSL_SUBDIR}/lib/libcrypto
 LIBDPLIBS+=	ssl	${NETBSDSRCDIR}/crypto/external/bsd/${EXTERNAL_OPENSSL_SUBDIR}/lib/libssl
+
+COPTS.charray.c+=	${GCC_NO_STRINGOP_OVERFLOW}



CVS commit: src/sys/netinet6

2019-10-16 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Wed Oct 16 07:40:40 UTC 2019

Modified Files:
src/sys/netinet6: in6_ifattach.c in6_ifattach.h in6_var.h ip6_input.c

Log Message:
Reorganize in6_tmpaddrtimer stuffs

- Move the related functions to where in6_tmpaddrtimer_ch exists
- Hide global variable in6_tmpaddrtimer_ch
- Rename ip6_init2 to in6_tmpaddrtimer_init
- Reduce callers of callout_reset
- Use callout_schedule


To generate a diff of this commit:
cvs rdiff -u -r1.115 -r1.116 src/sys/netinet6/in6_ifattach.c
cvs rdiff -u -r1.13 -r1.14 src/sys/netinet6/in6_ifattach.h
cvs rdiff -u -r1.100 -r1.101 src/sys/netinet6/in6_var.h
cvs rdiff -u -r1.211 -r1.212 src/sys/netinet6/ip6_input.c

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



CVS commit: src/tests/net/ndp

2019-10-16 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Wed Oct 16 07:42:23 UTC 2019

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

Log Message:
tests: add tests for the validateion of net.inet6.ip6.temppltime


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

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



CVS commit: src/sys/netinet6

2019-10-16 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Wed Oct 16 07:41:28 UTC 2019

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

Log Message:
Validate ip6_temp_preferred_lifetime (net.inet6.ip6.temppltime) on a change

ip6_temp_preferred_lifetime is used to calculate an interval period to
regenerate temporary addresse by
  TEMP_PREFERRED_LIFETIME - REGEN_ADVANCE - DESYNC_FACTOR
as per RFC 3041 3.5.  So it must be greater than (REGEN_ADVANCE +
DESYNC_FACTOR), otherwise it will be negative and go wrong, for example
KASSERT(to_ticks >= 0) in callout_schedule_locked fails.


To generate a diff of this commit:
cvs rdiff -u -r1.212 -r1.213 src/sys/netinet6/ip6_input.c

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



CVS commit: src/external/bsd/openldap/lib/libldap

2019-10-16 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Oct 16 07:39:19 UTC 2019

Modified Files:
src/external/bsd/openldap/lib/libldap: Makefile.libldap

Log Message:
use GCC_NO_STRINGOP_OVERFLOW for charray.c.

this only affects some platforms.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 \
src/external/bsd/openldap/lib/libldap/Makefile.libldap

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



CVS commit: src/tests/net/ndp

2019-10-16 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Wed Oct 16 07:42:23 UTC 2019

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

Log Message:
tests: add tests for the validateion of net.inet6.ip6.temppltime


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

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

Modified files:

Index: src/tests/net/ndp/t_ra.sh
diff -u src/tests/net/ndp/t_ra.sh:1.32 src/tests/net/ndp/t_ra.sh:1.33
--- src/tests/net/ndp/t_ra.sh:1.32	Sat Nov 25 07:58:47 2017
+++ src/tests/net/ndp/t_ra.sh	Wed Oct 16 07:42:22 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: t_ra.sh,v 1.32 2017/11/25 07:58:47 kre Exp $
+#	$NetBSD: t_ra.sh,v 1.33 2019/10/16 07:42:22 ozaki-r Exp $
 #
 # Copyright (c) 2015 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -695,6 +695,15 @@ ra_temporary_address_body()
 	# autoconf, temporal address should be used as the source address
 	check_echo_request_pkt bus1 $ip_temp $IP6SRV
 
+	#
+	# Testing the validation of net.inet6.ip6.temppltime
+	#
+	# XXX should move to a better place
+	atf_check -s not-exit:0 -e match:'Invalid argument' \
+	rump.sysctl -w net.inet6.ip6.temppltime=$((600 + 5))
+	atf_check -s exit:0 -o match:'86400 -> 606' \
+	rump.sysctl -w net.inet6.ip6.temppltime=$((600 + 5 + 1))
+
 	unset RUMP_SERVER
 
 	terminate_rtadvd $PIDFILE



CVS commit: src/sys/netinet6

2019-10-16 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Wed Oct 16 07:40:40 UTC 2019

Modified Files:
src/sys/netinet6: in6_ifattach.c in6_ifattach.h in6_var.h ip6_input.c

Log Message:
Reorganize in6_tmpaddrtimer stuffs

- Move the related functions to where in6_tmpaddrtimer_ch exists
- Hide global variable in6_tmpaddrtimer_ch
- Rename ip6_init2 to in6_tmpaddrtimer_init
- Reduce callers of callout_reset
- Use callout_schedule


To generate a diff of this commit:
cvs rdiff -u -r1.115 -r1.116 src/sys/netinet6/in6_ifattach.c
cvs rdiff -u -r1.13 -r1.14 src/sys/netinet6/in6_ifattach.h
cvs rdiff -u -r1.100 -r1.101 src/sys/netinet6/in6_var.h
cvs rdiff -u -r1.211 -r1.212 src/sys/netinet6/ip6_input.c

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

Modified files:

Index: src/sys/netinet6/in6_ifattach.c
diff -u src/sys/netinet6/in6_ifattach.c:1.115 src/sys/netinet6/in6_ifattach.c:1.116
--- src/sys/netinet6/in6_ifattach.c:1.115	Tue May  1 07:21:39 2018
+++ src/sys/netinet6/in6_ifattach.c	Wed Oct 16 07:40:40 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: in6_ifattach.c,v 1.115 2018/05/01 07:21:39 maxv Exp $	*/
+/*	$NetBSD: in6_ifattach.c,v 1.116 2019/10/16 07:40:40 ozaki-r Exp $	*/
 /*	$KAME: in6_ifattach.c,v 1.124 2001/07/18 08:32:51 jinmei Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: in6_ifattach.c,v 1.115 2018/05/01 07:21:39 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6_ifattach.c,v 1.116 2019/10/16 07:40:40 ozaki-r Exp $");
 
 #include 
 #include 
@@ -63,7 +63,7 @@ unsigned long in6_maxmtu = 0;
 
 int ip6_auto_linklocal = 1;	/* enable by default */
 
-callout_t in6_tmpaddrtimer_ch;
+static callout_t in6_tmpaddrtimer_ch;
 
 
 #if 0
@@ -75,6 +75,9 @@ static int get_ifid(struct ifnet *, stru
 static int in6_ifattach_linklocal(struct ifnet *, struct ifnet *);
 static int in6_ifattach_loopback(struct ifnet *);
 
+static void in6_tmpaddrtimer_schedule(void);
+static void in6_tmpaddrtimer(void *);
+
 #define EUI64_GBIT	0x01
 #define EUI64_UBIT	0x02
 #define EUI64_TO_IFID(in6)	do {(in6)->s6_addr[8] ^= EUI64_UBIT; } while (/*CONSTCOND*/ 0)
@@ -849,6 +852,25 @@ in6_get_tmpifid(struct ifnet *ifp, u_int
 }
 
 void
+in6_tmpaddrtimer_init(void)
+{
+
+	/* timer for regeneration of temporary addresses randomize ID */
+	callout_init(_tmpaddrtimer_ch, CALLOUT_MPSAFE);
+	callout_setfunc(_tmpaddrtimer_ch, in6_tmpaddrtimer, NULL);
+	in6_tmpaddrtimer_schedule();
+}
+
+static void
+in6_tmpaddrtimer_schedule(void)
+{
+
+	callout_schedule(_tmpaddrtimer_ch,
+	(ip6_temp_preferred_lifetime - ip6_desync_factor -
+	ip6_temp_regen_advance) * hz);
+}
+
+static void
 in6_tmpaddrtimer(void *ignored_arg)
 {
 	struct nd_ifinfo *ndi;
@@ -860,9 +882,7 @@ in6_tmpaddrtimer(void *ignored_arg)
 	mutex_enter(softnet_lock);
 	KERNEL_LOCK(1, NULL);
 
-	callout_reset(_tmpaddrtimer_ch,
-	(ip6_temp_preferred_lifetime - ip6_desync_factor -
-	ip6_temp_regen_advance) * hz, in6_tmpaddrtimer, NULL);
+	in6_tmpaddrtimer_schedule();
 
 	memset(nullbuf, 0, sizeof(nullbuf));
 	s = pserialize_read_enter();

Index: src/sys/netinet6/in6_ifattach.h
diff -u src/sys/netinet6/in6_ifattach.h:1.13 src/sys/netinet6/in6_ifattach.h:1.14
--- src/sys/netinet6/in6_ifattach.h:1.13	Sat Sep 19 13:11:02 2009
+++ src/sys/netinet6/in6_ifattach.h	Wed Oct 16 07:40:40 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: in6_ifattach.h,v 1.13 2009/09/19 13:11:02 christos Exp $	*/
+/*	$NetBSD: in6_ifattach.h,v 1.14 2019/10/16 07:40:40 ozaki-r Exp $	*/
 /*	$KAME: in6_ifattach.h,v 1.8 2000/04/12 03:51:30 itojun Exp $	*/
 
 /*
@@ -37,7 +37,6 @@
 void in6_ifattach(struct ifnet *, struct ifnet *);
 void in6_ifdetach(struct ifnet *);
 int in6_get_tmpifid(struct ifnet *, u_int8_t *, const u_int8_t *, int);
-void in6_tmpaddrtimer(void *);
 int in6_get_hw_ifid(struct ifnet *, struct in6_addr *);
 int in6_nigroup(struct ifnet *, const char *, int, struct sockaddr_in6 *);
 #endif /* _KERNEL */

Index: src/sys/netinet6/in6_var.h
diff -u src/sys/netinet6/in6_var.h:1.100 src/sys/netinet6/in6_var.h:1.101
--- src/sys/netinet6/in6_var.h:1.100	Tue May 29 04:38:29 2018
+++ src/sys/netinet6/in6_var.h	Wed Oct 16 07:40:40 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: in6_var.h,v 1.100 2018/05/29 04:38:29 ozaki-r Exp $	*/
+/*	$NetBSD: in6_var.h,v 1.101 2019/10/16 07:40:40 ozaki-r Exp $	*/
 /*	$KAME: in6_var.h,v 1.81 2002/06/08 11:16:51 itojun Exp $	*/
 
 /*
@@ -584,7 +584,6 @@ extern const struct in6_addr zeroin6_add
 extern const u_char inet6ctlerrmap[];
 extern unsigned long in6_maxmtu;
 extern bool in6_present;
-extern callout_t in6_tmpaddrtimer_ch;
 
 /*
  * Macro for finding the internet address structure (in6_ifaddr) corresponding
@@ -680,6 +679,7 @@ do {	\
 #endif
 
 void	in6_init(void);
+void	in6_tmpaddrtimer_init(void);
 
 void	in6_multi_lock(int);
 void	in6_multi_unlock(void);

Index: src/sys/netinet6/ip6_input.c
diff -u src/sys/netinet6/ip6_input.c:1.211 src/sys/netinet6/ip6_input.c:1.212
--- 

CVS commit: src/sys/netinet6

2019-10-16 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Wed Oct 16 07:41:28 UTC 2019

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

Log Message:
Validate ip6_temp_preferred_lifetime (net.inet6.ip6.temppltime) on a change

ip6_temp_preferred_lifetime is used to calculate an interval period to
regenerate temporary addresse by
  TEMP_PREFERRED_LIFETIME - REGEN_ADVANCE - DESYNC_FACTOR
as per RFC 3041 3.5.  So it must be greater than (REGEN_ADVANCE +
DESYNC_FACTOR), otherwise it will be negative and go wrong, for example
KASSERT(to_ticks >= 0) in callout_schedule_locked fails.


To generate a diff of this commit:
cvs rdiff -u -r1.212 -r1.213 src/sys/netinet6/ip6_input.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/ip6_input.c
diff -u src/sys/netinet6/ip6_input.c:1.212 src/sys/netinet6/ip6_input.c:1.213
--- src/sys/netinet6/ip6_input.c:1.212	Wed Oct 16 07:40:40 2019
+++ src/sys/netinet6/ip6_input.c	Wed Oct 16 07:41:28 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip6_input.c,v 1.212 2019/10/16 07:40:40 ozaki-r Exp $	*/
+/*	$NetBSD: ip6_input.c,v 1.213 2019/10/16 07:41:28 ozaki-r Exp $	*/
 /*	$KAME: ip6_input.c,v 1.188 2001/03/29 05:34:31 itojun Exp $	*/
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip6_input.c,v 1.212 2019/10/16 07:40:40 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip6_input.c,v 1.213 2019/10/16 07:41:28 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_gateway.h"
@@ -1531,6 +1531,28 @@ sysctl_net_inet6_ip6_stats(SYSCTLFN_ARGS
 	return (NETSTAT_SYSCTL(ip6stat_percpu, IP6_NSTATS));
 }
 
+static int
+sysctl_net_inet6_ip6_temppltime(SYSCTLFN_ARGS)
+{
+	int error;
+	uint32_t pltime;
+	struct sysctlnode node;
+
+	node = *rnode;
+	node.sysctl_data = 
+	pltime = ip6_temp_preferred_lifetime;
+	error = sysctl_lookup(SYSCTLFN_CALL());
+	if (error || newp == NULL)
+		return error;
+
+	if (pltime <= (MAX_TEMP_DESYNC_FACTOR + TEMPADDR_REGEN_ADVANCE))
+		return EINVAL;
+
+	ip6_temp_preferred_lifetime = pltime;
+
+	return 0;
+}
+
 static void
 sysctl_net_inet6_ip6_setup(struct sysctllog **clog)
 {
@@ -1742,7 +1764,7 @@ sysctl_net_inet6_ip6_setup(struct sysctl
 		   CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
 		   CTLTYPE_INT, "temppltime",
 		   SYSCTL_DESCR("preferred lifetime of a temporary address"),
-		   NULL, 0, _temp_preferred_lifetime, 0,
+		   sysctl_net_inet6_ip6_temppltime, 0, NULL, 0,
 		   CTL_NET, PF_INET6, IPPROTO_IPV6,
 		   CTL_CREATE, CTL_EOL);
 	sysctl_createv(clog, 0, NULL, NULL,



CVS commit: src/external/gpl3/gcc/usr.bin/gcc/arch

2019-10-16 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Oct 16 07:38:04 UTC 2019

Modified Files:
src/external/gpl3/gcc/usr.bin/gcc/arch/aarch64: configargs.h
src/external/gpl3/gcc/usr.bin/gcc/arch/arm: configargs.h defs.mk
gtyp-input.list tm.h
src/external/gpl3/gcc/usr.bin/gcc/arch/armeb: configargs.h defs.mk
gtyp-input.list tm.h
src/external/gpl3/gcc/usr.bin/gcc/arch/earm: configargs.h defs.mk
gtyp-input.list tm.h
src/external/gpl3/gcc/usr.bin/gcc/arch/earmeb: configargs.h defs.mk
gtyp-input.list tm.h
src/external/gpl3/gcc/usr.bin/gcc/arch/earmhf: configargs.h defs.mk
gtyp-input.list tm.h
src/external/gpl3/gcc/usr.bin/gcc/arch/earmhfeb: configargs.h defs.mk
gtyp-input.list tm.h
src/external/gpl3/gcc/usr.bin/gcc/arch/earmv4: configargs.h defs.mk
gtyp-input.list tm.h
src/external/gpl3/gcc/usr.bin/gcc/arch/earmv4eb: configargs.h defs.mk
gtyp-input.list tm.h
src/external/gpl3/gcc/usr.bin/gcc/arch/earmv6: configargs.h defs.mk
gtyp-input.list tm.h
src/external/gpl3/gcc/usr.bin/gcc/arch/earmv6eb: configargs.h defs.mk
gtyp-input.list tm.h
src/external/gpl3/gcc/usr.bin/gcc/arch/earmv6hf: configargs.h defs.mk
gtyp-input.list tm.h
src/external/gpl3/gcc/usr.bin/gcc/arch/earmv6hfeb: configargs.h defs.mk
gtyp-input.list tm.h
src/external/gpl3/gcc/usr.bin/gcc/arch/earmv7: configargs.h defs.mk
gtyp-input.list tm.h
src/external/gpl3/gcc/usr.bin/gcc/arch/earmv7eb: configargs.h defs.mk
gtyp-input.list tm.h
src/external/gpl3/gcc/usr.bin/gcc/arch/earmv7hf: configargs.h defs.mk
gtyp-input.list tm.h
src/external/gpl3/gcc/usr.bin/gcc/arch/earmv7hfeb: configargs.h defs.mk
gtyp-input.list tm.h
Added Files:
src/external/gpl3/gcc/usr.bin/gcc/arch/arm: arm-cpu.h arm-isa.h
src/external/gpl3/gcc/usr.bin/gcc/arch/armeb: arm-cpu.h arm-isa.h
src/external/gpl3/gcc/usr.bin/gcc/arch/earm: arm-cpu.h arm-isa.h
src/external/gpl3/gcc/usr.bin/gcc/arch/earmeb: arm-cpu.h arm-isa.h
src/external/gpl3/gcc/usr.bin/gcc/arch/earmhf: arm-cpu.h arm-isa.h
src/external/gpl3/gcc/usr.bin/gcc/arch/earmhfeb: arm-cpu.h arm-isa.h
src/external/gpl3/gcc/usr.bin/gcc/arch/earmv4: arm-cpu.h arm-isa.h
src/external/gpl3/gcc/usr.bin/gcc/arch/earmv4eb: arm-cpu.h arm-isa.h
src/external/gpl3/gcc/usr.bin/gcc/arch/earmv6: arm-cpu.h arm-isa.h
src/external/gpl3/gcc/usr.bin/gcc/arch/earmv6eb: arm-cpu.h arm-isa.h
src/external/gpl3/gcc/usr.bin/gcc/arch/earmv6hf: arm-cpu.h arm-isa.h
src/external/gpl3/gcc/usr.bin/gcc/arch/earmv6hfeb: arm-cpu.h arm-isa.h
src/external/gpl3/gcc/usr.bin/gcc/arch/earmv7: arm-cpu.h arm-isa.h
src/external/gpl3/gcc/usr.bin/gcc/arch/earmv7eb: arm-cpu.h arm-isa.h
src/external/gpl3/gcc/usr.bin/gcc/arch/earmv7hf: arm-cpu.h arm-isa.h
src/external/gpl3/gcc/usr.bin/gcc/arch/earmv7hfeb: arm-cpu.h arm-isa.h

Log Message:
regen arm ports for config.gcc fix.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 \
src/external/gpl3/gcc/usr.bin/gcc/arch/aarch64/configargs.h
cvs rdiff -u -r0 -r1.1 src/external/gpl3/gcc/usr.bin/gcc/arch/arm/arm-cpu.h \
src/external/gpl3/gcc/usr.bin/gcc/arch/arm/arm-isa.h
cvs rdiff -u -r1.34 -r1.35 \
src/external/gpl3/gcc/usr.bin/gcc/arch/arm/configargs.h
cvs rdiff -u -r1.19 -r1.20 src/external/gpl3/gcc/usr.bin/gcc/arch/arm/defs.mk
cvs rdiff -u -r1.7 -r1.8 \
src/external/gpl3/gcc/usr.bin/gcc/arch/arm/gtyp-input.list
cvs rdiff -u -r1.10 -r1.11 src/external/gpl3/gcc/usr.bin/gcc/arch/arm/tm.h
cvs rdiff -u -r0 -r1.1 src/external/gpl3/gcc/usr.bin/gcc/arch/armeb/arm-cpu.h \
src/external/gpl3/gcc/usr.bin/gcc/arch/armeb/arm-isa.h
cvs rdiff -u -r1.35 -r1.36 \
src/external/gpl3/gcc/usr.bin/gcc/arch/armeb/configargs.h
cvs rdiff -u -r1.19 -r1.20 \
src/external/gpl3/gcc/usr.bin/gcc/arch/armeb/defs.mk
cvs rdiff -u -r1.7 -r1.8 \
src/external/gpl3/gcc/usr.bin/gcc/arch/armeb/gtyp-input.list
cvs rdiff -u -r1.11 -r1.12 src/external/gpl3/gcc/usr.bin/gcc/arch/armeb/tm.h
cvs rdiff -u -r0 -r1.1 src/external/gpl3/gcc/usr.bin/gcc/arch/earm/arm-cpu.h \
src/external/gpl3/gcc/usr.bin/gcc/arch/earm/arm-isa.h
cvs rdiff -u -r1.35 -r1.36 \
src/external/gpl3/gcc/usr.bin/gcc/arch/earm/configargs.h
cvs rdiff -u -r1.18 -r1.19 \
src/external/gpl3/gcc/usr.bin/gcc/arch/earm/defs.mk
cvs rdiff -u -r1.7 -r1.8 \
src/external/gpl3/gcc/usr.bin/gcc/arch/earm/gtyp-input.list
cvs rdiff -u -r1.9 -r1.10 src/external/gpl3/gcc/usr.bin/gcc/arch/earm/tm.h
cvs rdiff -u -r0 -r1.1 \
src/external/gpl3/gcc/usr.bin/gcc/arch/earmeb/arm-cpu.h \
src/external/gpl3/gcc/usr.bin/gcc/arch/earmeb/arm-isa.h
cvs rdiff -u -r1.29 -r1.30 \

CVS commit: src/external/gpl3/gcc/dist/gcc

2019-10-16 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Oct 16 07:35:14 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc: config.gcc

Log Message:
make sure to include bpabi.h before arm.h.


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/external/gpl3/gcc/dist/gcc/config.gcc

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



CVS commit: src/external/gpl3/gcc/dist/gcc

2019-10-16 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Oct 16 07:35:14 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc: config.gcc

Log Message:
make sure to include bpabi.h before arm.h.


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/external/gpl3/gcc/dist/gcc/config.gcc

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

Modified files:

Index: src/external/gpl3/gcc/dist/gcc/config.gcc
diff -u src/external/gpl3/gcc/dist/gcc/config.gcc:1.59 src/external/gpl3/gcc/dist/gcc/config.gcc:1.60
--- src/external/gpl3/gcc/dist/gcc/config.gcc:1.59	Wed Oct  2 05:58:03 2019
+++ src/external/gpl3/gcc/dist/gcc/config.gcc	Wed Oct 16 07:35:14 2019
@@ -1148,7 +1148,7 @@ arm*-*-freebsd*)# ARM Fr
 	with_tls=${with_tls:-gnu}
 	;;
 arm*-*-netbsdelf*)
-	tm_file="dbxelf.h elfos.h ${nbsd_tm_file} arm/elf.h arm/aout.h ${tm_file} arm/netbsd-elf.h"
+	tm_file="dbxelf.h elfos.h ${nbsd_tm_file} arm/elf.h arm/aout.h arm/netbsd-elf.h"
 	extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
 	tmake_file="${tmake_file} arm/t-arm"
 	case ${target} in
@@ -1169,6 +1169,7 @@ arm*-*-netbsdelf*)
 	with_cpu=${with_cpu:-strongarm}
 	;;
 	esac
+	tm_file="${tm_file} vxworks-dummy.h arm/arm.h"
 	case ${target} in
 	arm*-*-netbsdelf-*eabihf*)
 	tm_defines="${tm_defines} TARGET_DEFAULT_FLOAT_ABI=ARM_FLOAT_ABI_HARD"



CVS commit: src/tools/gcc

2019-10-16 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Oct 16 06:57:24 UTC 2019

Modified Files:
src/tools/gcc: mknative-gcc

Log Message:
copy arm-cpu.h and arm-isa.h for arm platforms.


To generate a diff of this commit:
cvs rdiff -u -r1.101 -r1.102 src/tools/gcc/mknative-gcc

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



CVS commit: src/tools/gcc

2019-10-16 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Oct 16 06:57:24 UTC 2019

Modified Files:
src/tools/gcc: mknative-gcc

Log Message:
copy arm-cpu.h and arm-isa.h for arm platforms.


To generate a diff of this commit:
cvs rdiff -u -r1.101 -r1.102 src/tools/gcc/mknative-gcc

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

Modified files:

Index: src/tools/gcc/mknative-gcc
diff -u src/tools/gcc/mknative-gcc:1.101 src/tools/gcc/mknative-gcc:1.102
--- src/tools/gcc/mknative-gcc:1.101	Sat Feb 23 06:54:45 2019
+++ src/tools/gcc/mknative-gcc	Wed Oct 16 06:57:24 2019
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$NetBSD: mknative-gcc,v 1.101 2019/02/23 06:54:45 mrg Exp $
+#	$NetBSD: mknative-gcc,v 1.102 2019/10/16 06:57:24 mrg Exp $
 #
 # Shell script for generating all the constants needed for a native
 # platform build of gcc.
@@ -422,6 +422,13 @@ __EOF__
 	if [ "${MACHINE_ARCH}" = "i386" -o "${MACHINE_ARCH}" = "x86_64" ]; then
 		write_c $_OUTDIRBASE/usr.bin/$_subdir/arch/$MACHINE_ARCH/i386-builtin-types.inc <$_TMPDIR/gcc/i386-builtin-types.inc
 	fi
+
+	case "${MACHINE_ARCH}" in
+	(*arm*)
+		write_c $_OUTDIRBASE/usr.bin/$_subdir/arch/$MACHINE_ARCH/arm-cpu.h <$_TMPDIR/gcc/arm-cpu.h
+		write_c $_OUTDIRBASE/usr.bin/$_subdir/arch/$MACHINE_ARCH/arm-isa.h <$_TMPDIR/gcc/arm-isa.h
+		;;
+	esac
 }
 
 # main #



CVS commit: src/sys/net

2019-10-16 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Wed Oct 16 06:53:34 UTC 2019

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

Log Message:
Fix missing kpreempt_disable() before softint_schedule() like if_vmx.c:r1.51.


To generate a diff of this commit:
cvs rdiff -u -r1.175 -r1.176 src/sys/net/if_gre.c
cvs rdiff -u -r1.39 -r1.40 src/sys/net/if_l2tp.c
cvs rdiff -u -r1.113 -r1.114 src/sys/net/if_tap.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_gre.c
diff -u src/sys/net/if_gre.c:1.175 src/sys/net/if_gre.c:1.176
--- src/sys/net/if_gre.c:1.175	Fri Apr 26 11:51:56 2019
+++ src/sys/net/if_gre.c	Wed Oct 16 06:53:34 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_gre.c,v 1.175 2019/04/26 11:51:56 pgoyette Exp $ */
+/*	$NetBSD: if_gre.c,v 1.176 2019/10/16 06:53:34 knakahara Exp $ */
 
 /*
  * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc.
@@ -45,7 +45,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_gre.c,v 1.175 2019/04/26 11:51:56 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_gre.c,v 1.176 2019/10/16 06:53:34 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_atalk.h"
@@ -964,8 +964,11 @@ gre_output(struct ifnet *ifp, struct mbu
 	if ((error = gre_bufq_enqueue(>sc_snd, m)) != 0) {
 		sc->sc_oflow_ev.ev_count++;
 		m_freem(m);
-	} else
+	} else {
+		kpreempt_disable();
 		softint_schedule(sc->sc_si);
+		kpreempt_enable();
+	}
 
 end:
 	if (error)

Index: src/sys/net/if_l2tp.c
diff -u src/sys/net/if_l2tp.c:1.39 src/sys/net/if_l2tp.c:1.40
--- src/sys/net/if_l2tp.c:1.39	Thu Sep 19 06:09:52 2019
+++ src/sys/net/if_l2tp.c	Wed Oct 16 06:53:34 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_l2tp.c,v 1.39 2019/09/19 06:09:52 knakahara Exp $	*/
+/*	$NetBSD: if_l2tp.c,v 1.40 2019/10/16 06:53:34 knakahara Exp $	*/
 
 /*
  * Copyright (c) 2017 Internet Initiative Japan Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_l2tp.c,v 1.39 2019/09/19 06:09:52 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_l2tp.c,v 1.40 2019/10/16 06:53:34 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -673,7 +673,9 @@ l2tp_start(struct ifnet *ifp)
 	if (var->lv_psrc == NULL || var->lv_pdst == NULL)
 		return;
 
+	kpreempt_disable();
 	softint_schedule(sc->l2tp_si);
+	kpreempt_enable();
 	l2tp_putref_variant(var, );
 }
 

Index: src/sys/net/if_tap.c
diff -u src/sys/net/if_tap.c:1.113 src/sys/net/if_tap.c:1.114
--- src/sys/net/if_tap.c:1.113	Wed May 29 10:07:30 2019
+++ src/sys/net/if_tap.c	Wed Oct 16 06:53:34 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_tap.c,v 1.113 2019/05/29 10:07:30 msaitoh Exp $	*/
+/*	$NetBSD: if_tap.c,v 1.114 2019/10/16 06:53:34 knakahara Exp $	*/
 
 /*
  *  Copyright (c) 2003, 2004, 2008, 2009 The NetBSD Foundation.
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_tap.c,v 1.113 2019/05/29 10:07:30 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_tap.c,v 1.114 2019/10/16 06:53:34 knakahara Exp $");
 
 #if defined(_KERNEL_OPT)
 
@@ -533,8 +533,11 @@ tap_start(struct ifnet *ifp)
 		ifp->if_flags |= IFF_OACTIVE;
 		cv_broadcast(>sc_cv);
 		selnotify(>sc_rsel, 0, 1);
-		if (sc->sc_flags & TAP_ASYNCIO)
+		if (sc->sc_flags & TAP_ASYNCIO) {
+			kpreempt_disable();
 			softint_schedule(sc->sc_sih);
+			kpreempt_enable();
+		}
 	}
 done:
 	mutex_exit(>sc_lock);
@@ -643,8 +646,11 @@ tap_stop(struct ifnet *ifp, int disable)
 	ifp->if_flags &= ~IFF_RUNNING;
 	cv_broadcast(>sc_cv);
 	selnotify(>sc_rsel, 0, 1);
-	if (sc->sc_flags & TAP_ASYNCIO)
+	if (sc->sc_flags & TAP_ASYNCIO) {
+		kpreempt_disable();
 		softint_schedule(sc->sc_sih);
+		kpreempt_enable();
+	}
 	mutex_exit(>sc_lock);
 }
 



CVS commit: src/sys/dev/pci/ixgbe

2019-10-16 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Wed Oct 16 06:36:00 UTC 2019

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c

Log Message:
Fix missing kpreempt_disable() before softint_schedule() like if_vmx.c:r1.51.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/dev/pci/ixgbe/ix_txrx.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/ixgbe

2019-10-16 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Wed Oct 16 06:36:00 UTC 2019

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c

Log Message:
Fix missing kpreempt_disable() before softint_schedule() like if_vmx.c:r1.51.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/dev/pci/ixgbe/ix_txrx.c

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

Modified files:

Index: src/sys/dev/pci/ixgbe/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.55 src/sys/dev/pci/ixgbe/ix_txrx.c:1.56
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.55	Wed Sep  4 07:29:34 2019
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Wed Oct 16 06:36:00 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.55 2019/09/04 07:29:34 msaitoh Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.56 2019/10/16 06:36:00 knakahara Exp $ */
 
 /**
 
@@ -266,8 +266,11 @@ ixgbe_mq_start(struct ifnet *ifp, struct
 >wq_cookie, curcpu());
 			} else
 percpu_putref(adapter->txr_wq_enqueued);
-		} else
+		} else {
+			kpreempt_disable();
 			softint_schedule(txr->txr_si);
+			kpreempt_enable();
+		}
 	}
 
 	return (0);