CVS commit: src/etc

2016-01-07 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Thu Jan  7 11:51:07 UTC 2016

Modified Files:
src/etc/defaults: rc.conf
src/etc/rc.d: network

Log Message:
Instead of waiting for a duration based in IPv6 DAD count sysctl,
wait for 15 seconds for tentative flags to clear allowing 5 seconds
for detached flags to clear as well from configured addresses.

This is now protocol independant and allows time for the interfaces to
work out if they have a carrier or not.


To generate a diff of this commit:
cvs rdiff -u -r1.135 -r1.136 src/etc/defaults/rc.conf
cvs rdiff -u -r1.69 -r1.70 src/etc/rc.d/network

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

Modified files:

Index: src/etc/defaults/rc.conf
diff -u src/etc/defaults/rc.conf:1.135 src/etc/defaults/rc.conf:1.136
--- src/etc/defaults/rc.conf:1.135	Sat Dec 26 21:05:11 2015
+++ src/etc/defaults/rc.conf	Thu Jan  7 11:51:07 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: rc.conf,v 1.135 2015/12/26 21:05:11 plunky Exp $
+#	$NetBSD: rc.conf,v 1.136 2016/01/07 11:51:07 roy Exp $
 #
 # /etc/defaults/rc.conf --
 #	default configuration of /etc/rc.conf
@@ -162,6 +162,13 @@ securelevel=""	# securelevel to set 
 
 # Networking startup.
 #
+# Wait up to 15 seconds for the tentative flag to clear from all addresses.
+# Wait up to 5 seconds for the detached flag to clear from all addresses.
+# Addresses are detached if there is no carrier, thus we have a small
+# wait to see if we get a carrier.
+# Even a wired interface may not recognise it has a carrier right away.
+ifconfig_wait_dad_flags="-w 15 -W 5"
+
 mdnsd=NO
 npf=NO
 ipfilter=NO		ipfilter_flags=""	# uses /etc/ipf.conf

Index: src/etc/rc.d/network
diff -u src/etc/rc.d/network:1.69 src/etc/rc.d/network:1.70
--- src/etc/rc.d/network:1.69	Tue Oct 14 20:49:47 2014
+++ src/etc/rc.d/network	Thu Jan  7 11:51:07 2016
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: network,v 1.69 2014/10/14 20:49:47 christos Exp $
+# $NetBSD: network,v 1.70 2016/01/07 11:51:07 roy Exp $
 #
 
 # PROVIDE: network
@@ -51,6 +51,7 @@ network_start()
 	network_start_defaultroute6
 	have_inet6 &&
 	network_start_ipv6_autoconf
+	network_wait_dad
 	network_start_local
 }
 
@@ -433,18 +434,6 @@ network_start_ipv6_autoconf()
 {
 	# IPv6 interface autoconfiguration.
 
-	dadcount=$(/sbin/sysctl -n net.inet6.ip6.dad_count 2>/dev/null)
-	if [ -n "$dadcount" -a "$dadcount" != 0 ]; then
-		# wait till DAD is completed
-		echo 'Waiting for DAD to complete for' \
-		'statically configured addresses...'
-		# Add 1 for MAX_RTR_SOLICITATION_DELAY and another
-		# to give time for the last DAD packet to respond and
-		# a few more for luck.
-		waitsecs=$((dadcount + 4))
-		/sbin/ifconfig -w $waitsecs
-	fi
-
 	# dhcpcd will ensure DAD completes before forking
 	if checkyesnox rtsol && ! checkyesno dhcpcd; then
 		if [ "$ip6mode" = "autohost" ]; then
@@ -455,6 +444,16 @@ network_start_ipv6_autoconf()
 	fi
 }
 
+network_wait_dad()
+{
+	# Wait for the DAD flags to clear form all addresses.
+	if [ -n "$ifconfig_wait_dad_flags" ]; then
+		echo 'Waiting for DAD to complete for' \
+		'statically configured addresses...'
+		ifconfig $ifconfig_wait_dad_flags
+	fi
+}
+
 network_start_local()
 {
 	# XXX this must die



CVS commit: src/sys/dev/pci

2016-01-07 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan  7 10:08:18 UTC 2016

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

Log Message:
- printf->DPRINTF in wm_serdes_mediastatus().
- KNF.


To generate a diff of this commit:
cvs rdiff -u -r1.387 -r1.388 src/sys/dev/pci/if_wm.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_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.387 src/sys/dev/pci/if_wm.c:1.388
--- src/sys/dev/pci/if_wm.c:1.387	Fri Dec 25 05:45:40 2015
+++ src/sys/dev/pci/if_wm.c	Thu Jan  7 10:08:18 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.387 2015/12/25 05:45:40 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.388 2016/01/07 10:08:18 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -83,7 +83,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.387 2015/12/25 05:45:40 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.388 2016/01/07 10:08:18 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -310,7 +310,7 @@ struct wm_rxqueue {
 
 	bus_addr_t rxq_rdt_reg;		/* offset of RDT register */
 
-	int rxq_ptr;			/* next ready Rx descriptor/queue ent */
+	int rxq_ptr;			/* next ready Rx desc/queue ent */
 	int rxq_discard;
 	int rxq_len;
 	struct mbuf *rxq_head;
@@ -406,7 +406,7 @@ struct wm_softc {
 	struct evcnt sc_ev_txtsopain;	/* painful header manip. for TSO */
 
 	struct evcnt sc_ev_txseg[WM_NTXSEGS]; /* Tx packets w/ N segments */
-	struct evcnt sc_ev_txdrop;	/* Tx packets dropped (too many segs) */
+	struct evcnt sc_ev_txdrop;	/* Tx packets dropped(too many segs) */
 
 	struct evcnt sc_ev_tu;		/* Tx underrun */
 
@@ -1408,7 +1408,7 @@ wm_init_rxdesc(struct wm_rxqueue *rxq, i
 	rxd->wrx_status = 0;
 	rxd->wrx_errors = 0;
 	rxd->wrx_special = 0;
-	wm_cdrxsync(rxq, start, BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE);
+	wm_cdrxsync(rxq, start, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
 
 	CSR_WRITE(sc, rxq->rxq_rdt_reg, start);
 }
@@ -1494,7 +1494,7 @@ wm_attach(device_t parent, device_t self
 		sc->sc_dmat = pa->pa_dmat;
 
 	sc->sc_pcidevid = PCI_PRODUCT(pa->pa_id);
-	sc->sc_rev = PCI_REVISION(pci_conf_read(pc, pa->pa_tag, PCI_CLASS_REG));
+	sc->sc_rev = PCI_REVISION(pci_conf_read(pc, pa->pa_tag,PCI_CLASS_REG));
 	pci_aprint_devinfo_fancy(pa, "Ethernet controller", wmp->wmp_name, 1);
 
 	sc->sc_type = wmp->wmp_type;
@@ -1741,11 +1741,9 @@ alloc_retry:
 pcix_sts = pci_conf_read(pa->pa_pc, pa->pa_tag,
 sc->sc_pcixe_capoff + PCIX_STATUS);
 
-bytecnt =
-(pcix_cmd & PCIX_CMD_BYTECNT_MASK) >>
+bytecnt = (pcix_cmd & PCIX_CMD_BYTECNT_MASK) >>
 PCIX_CMD_BYTECNT_SHIFT;
-maxb =
-(pcix_sts & PCIX_STATUS_MAXB_MASK) >>
+maxb = (pcix_sts & PCIX_STATUS_MAXB_MASK) >>
 PCIX_STATUS_MAXB_SHIFT;
 if (bytecnt > maxb) {
 	aprint_verbose_dev(sc->sc_dev,
@@ -1895,7 +1893,7 @@ alloc_retry:
 		/* FLASH */
 		sc->sc_flags |= WM_F_EEPROM_FLASH | WM_F_LOCK_EXTCNF;
 		sc->sc_nvm_wordsize = 2048;
-		memtype = pci_mapreg_type(pa->pa_pc, pa->pa_tag, WM_ICH8_FLASH);
+		memtype = pci_mapreg_type(pa->pa_pc, pa->pa_tag,WM_ICH8_FLASH);
 		if (pci_mapreg_map(pa, WM_ICH8_FLASH, memtype, 0,
 		>sc_flasht, >sc_flashh, NULL, >sc_flashs)) {
 			aprint_error_dev(sc->sc_dev,
@@ -1904,11 +1902,10 @@ alloc_retry:
 		}
 		reg = ICH8_FLASH_READ32(sc, ICH_FLASH_GFPREG);
 		sc->sc_ich8_flash_base = (reg & ICH_GFPREG_BASE_MASK) *
-		ICH_FLASH_SECTOR_SIZE;
+		ICH_FLASH_SECTOR_SIZE;
 		sc->sc_ich8_flash_bank_size =
 		((reg >> 16) & ICH_GFPREG_BASE_MASK) + 1;
-		sc->sc_ich8_flash_bank_size -=
-		(reg & ICH_GFPREG_BASE_MASK);
+		sc->sc_ich8_flash_bank_size -= (reg & ICH_GFPREG_BASE_MASK);
 		sc->sc_ich8_flash_bank_size *= ICH_FLASH_SECTOR_SIZE;
 		sc->sc_ich8_flash_bank_size /= 2 * sizeof(uint16_t);
 		break;
@@ -2755,7 +2752,7 @@ wm_ifflags_cb(struct ethercom *ec)
 	if (change != 0)
 		sc->sc_if_flags = ifp->if_flags;
 
-	if ((change & ~(IFF_CANTCHANGE|IFF_DEBUG)) != 0) {
+	if ((change & ~(IFF_CANTCHANGE | IFF_DEBUG)) != 0) {
 		rc = ENETRESET;
 		goto out;
 	}
@@ -3982,7 +3979,7 @@ wm_add_rxbuf(struct wm_rxqueue *rxq, int
 
 	m->m_len = m->m_pkthdr.len = m->m_ext.ext_size;
 	error = bus_dmamap_load_mbuf(sc->sc_dmat, rxs->rxs_dmamap, m,
-	BUS_DMA_READ|BUS_DMA_NOWAIT);
+	BUS_DMA_READ | BUS_DMA_NOWAIT);
 	if (error) {
 		/* XXX XXX XXX */
 		aprint_error_dev(sc->sc_dev,
@@ -4383,8 +4380,7 @@ wm_setup_msix(struct wm_softc *sc)
 	intrstr = pci_intr_string(pc, sc->sc_intrs[intr_idx], intrbuf,
 	sizeof(intrbuf));
 #ifdef WM_MPSAFE
-	pci_intr_setattr(pc, >sc_intrs[intr_idx],
-	PCI_INTR_MPSAFE, true);
+	pci_intr_setattr(pc, >sc_intrs[intr_idx], PCI_INTR_MPSAFE, true);
 #endif
 	memset(intr_xname, 0, sizeof(intr_xname));
 	snprintf(intr_xname, sizeof(intr_xname), "%sLINK",
@@ -4412,13 +4408,13 @@ wm_setup_msix(struct wm_softc *sc)
  fail_1:
 	for (qidx = 0; qidx < 

CVS commit: src/doc

2016-01-07 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Jan  7 10:13:37 UTC 2016

Modified Files:
src/doc: 3RDPARTY

Log Message:
sqlite3-3.10 out.


To generate a diff of this commit:
cvs rdiff -u -r1.1282 -r1.1283 src/doc/3RDPARTY

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.1282 src/doc/3RDPARTY:1.1283
--- src/doc/3RDPARTY:1.1282	Wed Jan  6 04:42:10 2016
+++ src/doc/3RDPARTY	Thu Jan  7 10:13:37 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1282 2016/01/06 04:42:10 kamil Exp $
+#	$NetBSD: 3RDPARTY,v 1.1283 2016/01/07 10:13:37 wiz Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1249,7 +1249,7 @@ original.
 
 Package:	sqlite
 Version:	3.8.3.1
-Current Vers:	3.8.3.1
+Current Vers:	3.10
 Maintainer:	Richard Hipp 
 Home Page:	http://www.sqlite.org
 Responsible:	joerg



CVS commit: src/sys/dev/raidframe

2016-01-07 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Thu Jan  7 08:58:01 UTC 2016

Modified Files:
src/sys/dev/raidframe: rf_netbsdkintf.c

Log Message:
CID 1347189:  Null pointer dereferences


To generate a diff of this commit:
cvs rdiff -u -r1.341 -r1.342 src/sys/dev/raidframe/rf_netbsdkintf.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/raidframe/rf_netbsdkintf.c
diff -u src/sys/dev/raidframe/rf_netbsdkintf.c:1.341 src/sys/dev/raidframe/rf_netbsdkintf.c:1.342
--- src/sys/dev/raidframe/rf_netbsdkintf.c:1.341	Wed Jan  6 17:40:50 2016
+++ src/sys/dev/raidframe/rf_netbsdkintf.c	Thu Jan  7 08:58:01 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_netbsdkintf.c,v 1.341 2016/01/06 17:40:50 christos Exp $	*/
+/*	$NetBSD: rf_netbsdkintf.c,v 1.342 2016/01/07 08:58:01 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2008-2011 The NetBSD Foundation, Inc.
@@ -101,7 +101,7 @@
  ***/
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.341 2016/01/06 17:40:50 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.342 2016/01/07 08:58:01 mlelstv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -725,6 +725,10 @@ raid_dumpblocks(device_t dev, void *va, 
 	}
 
 	bdev = bdevsw_lookup(raidPtr->Disks[dumpto].dev);
+	if (bdev == NULL) {
+		error = ENXIO;
+		goto out;
+	}
 
 	error = (*bdev->d_dump)(raidPtr->Disks[dumpto].dev, 
 blkno, va, nblk * raidPtr->bytesPerSector);



CVS commit: src/share/man/man4

2016-01-07 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Thu Jan  7 12:31:55 UTC 2016

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

Log Message:
Add Buffalo LUA4-U3-AGT.


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

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

Modified files:

Index: src/share/man/man4/axen.4
diff -u src/share/man/man4/axen.4:1.4 src/share/man/man4/axen.4:1.5
--- src/share/man/man4/axen.4:1.4	Tue Apr 21 11:53:53 2015
+++ src/share/man/man4/axen.4	Thu Jan  7 12:31:55 2016
@@ -1,4 +1,4 @@
-.\"	$NetBSD: axen.4,v 1.4 2015/04/21 11:53:53 ryoon Exp $
+.\"	$NetBSD: axen.4,v 1.5 2016/01/07 12:31:55 nonaka Exp $
 .\"	$OpenBSD: axen.4,v 1.2 2013/10/07 07:18:36 jmc Exp $
 .\"
 .\" Copyright (c) 2013 Yojiro UO 
@@ -34,6 +34,7 @@ Electronics AX88178a and AX88779 USB 2.0
 including the following:
 .Pp
 .Bl -tag -width Ds -offset indent -compact
+.It Buffalo LUA4-U3-AGT
 .It Kurotoshiko GbE-USB3.0
 .It Kurotoshiko GbE-USB3.0S2
 .It Logitec LAN-GTJU3



CVS commit: src/sys/rump/include/rump

2016-01-07 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Jan  7 13:54:08 UTC 2016

Modified Files:
src/sys/rump/include/rump: rumpdefs.h

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/rump/include/rump/rumpdefs.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/rump/include/rump/rumpdefs.h
diff -u src/sys/rump/include/rump/rumpdefs.h:1.33 src/sys/rump/include/rump/rumpdefs.h:1.34
--- src/sys/rump/include/rump/rumpdefs.h:1.33	Tue Sep 15 14:55:55 2015
+++ src/sys/rump/include/rump/rumpdefs.h	Thu Jan  7 13:54:08 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpdefs.h,v 1.33 2015/09/15 14:55:55 pooka Exp $	*/
+/*	$NetBSD: rumpdefs.h,v 1.34 2016/01/07 13:54:08 pooka Exp $	*/
 
 /*
  *	AUTOMATICALLY GENERATED.  DO NOT EDIT.
@@ -170,7 +170,7 @@ enum rump_vtype	{ RUMP_VNON, RUMP_VREG, 
 #define	RUMP_AB_SILENT	0x0004	
 #define	RUMP_AB_DEBUG	0x0008	
 
-/*	NetBSD: socket.h,v 1.117 2015/04/03 20:01:08 rtr Exp 	*/
+/*	NetBSD: socket.h,v 1.118 2015/10/13 21:28:34 rjs Exp 	*/
 #define	RUMP_SOCK_STREAM	1		
 #define	RUMP_SOCK_DGRAM	2		
 #define	RUMP_SOCK_RAW	3		
@@ -291,13 +291,14 @@ enum rump_vtype	{ RUMP_VNON, RUMP_VREG, 
 #define	RUMP_MSG_CRUMP_MSG_CLOEXEC 0x0800		
 #define	RUMP_MSG_NBIO	0x1000		
 #define	RUMP_MSG_WAITFORONE	0x2000		
+#define	RUMP_MSG_NOTIFICATION 0x4000		
 #define	RUMP_MSG_USERFLAGS	0x0ff
 #define RUMP_MSG_NAMEMBUF	0x100	
 #define RUMP_MSG_CONTROLMBUF	0x200	
 #define RUMP_MSG_IOVUSRSPACE	0x400	
 #define RUMP_MSG_LENUSRSPACE	0x800	
 
-/*	NetBSD: in.h,v 1.97 2015/05/02 14:41:32 roy Exp 	*/
+/*	NetBSD: in.h,v 1.98 2015/10/13 21:28:35 rjs Exp 	*/
 #define	RUMP_IP_OPTIONS		1
 #define	RUMP_IP_HDRINCL		2
 #define	RUMP_IP_TOS			3
@@ -359,6 +360,7 @@ enum rump_vtype	{ RUMP_VNON, RUMP_VREG, 
 #define	RUMP_IPPROTO_IPCOMP		108		
 #define	RUMP_IPPROTO_VRRP		112		
 #define	RUMP_IPPROTO_CARP		112		
+#define	RUMP_IPPROTO_SCTP		132		
 #define RUMP_IPPROTO_PFSYNC  240 
 #define	RUMP_IPPROTO_RAW		255		
 #define	RUMP_IPPROTO_MAX		256
@@ -383,7 +385,7 @@ enum rump_vtype	{ RUMP_VNON, RUMP_VREG, 
 #define	RUMP_TCP_MD5SIG	0x10	
 #define	RUMP_TCP_CONGCTL	0x20	
 
-/*	NetBSD: mount.h,v 1.217 2015/05/06 15:57:08 hannken Exp 	*/
+/*	NetBSD: mount.h,v 1.218 2015/10/23 19:40:10 maxv Exp 	*/
 #define	RUMP_MOUNT_FFS	"ffs"		
 #define	RUMP_MOUNT_UFS	RUMP_MOUNT_FFS	
 #define	RUMP_MOUNT_NFS	"nfs"		
@@ -520,7 +522,7 @@ enum rump_vtype	{ RUMP_VNON, RUMP_VREG, 
 #define	RUMP_KTRFACv1	(1 << RUMP_KTRFAC_VER_SHIFT)
 #define	RUMP_KTRFACv2	(2 << RUMP_KTRFAC_VER_SHIFT)
 
-/*	NetBSD: module.h,v 1.38 2015/06/22 16:35:13 matt Exp 	*/
+/*	NetBSD: module.h,v 1.39 2015/11/04 04:28:58 pgoyette Exp 	*/
 struct rump_modctl_load {
 	const char *ml_filename;
 



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

2016-01-07 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Jan  8 02:25:15 UTC 2016

Modified Files:
src/sys/arch/x86/include: cacheinfo.h

Log Message:
 Index 0x6c is not 126 entries but 128 entries. The old value was from
previous SDM.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/x86/include/cacheinfo.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/cacheinfo.h
diff -u src/sys/arch/x86/include/cacheinfo.h:1.20 src/sys/arch/x86/include/cacheinfo.h:1.21
--- src/sys/arch/x86/include/cacheinfo.h:1.20	Mon Oct 19 02:45:26 2015
+++ src/sys/arch/x86/include/cacheinfo.h	Fri Jan  8 02:25:15 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: cacheinfo.h,v 1.20 2015/10/19 02:45:26 msaitoh Exp $	*/
+/*	$NetBSD: cacheinfo.h,v 1.21 2016/01/08 02:25:15 msaitoh Exp $	*/
 
 #ifndef _X86_CACHEINFO_H_
 #define _X86_CACHEINFO_H_
@@ -236,7 +236,7 @@ __CI_TBL(CAI_ITLB, 0x61, 0xff, 48,  
 __CI_TBL(CAI_L1_1GBDTLB,0x63,   4,  4,1024*1024 * 1024, NULL), \
 __CI_TBL(CAI_ITLB, 0x6a,8, 64,4 * 1024, NULL), \
 __CI_TBL(CAI_DTLB, 0x6b,8,256,4 * 1024, NULL), \
-__CI_TBL(CAI_L2_DTLB2, 0x6c,8,126,   0, "2M/4M: 126 entries"),\
+__CI_TBL(CAI_L2_DTLB2, 0x6c,8,128,   0, "2M/4M: 128 entries"),\
 __CI_TBL(CAI_L1_1GBDTLB,0x6d,0xff, 16,1024*1024 * 1024, NULL), \
 __CI_TBL(CAI_ITLB2,0x76, 0xff,  8, 4 * 1024 * 1024, "2M/4M: 8 entries"), \
 __CI_TBL(CAI_DTLB, 0xa0, 0xff, 32,4 * 1024, NULL), \



CVS commit: src/usr.sbin/cpuctl/arch

2016-01-07 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Jan  8 02:28:44 UTC 2016

Modified Files:
src/usr.sbin/cpuctl/arch: i386.c

Log Message:
>From the latest Intel SDM:
- Add Xeon E3-1200 v5
- Change 0x1c from "Atom Family" to "45nm Atom Family"


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/usr.sbin/cpuctl/arch/i386.c

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

Modified files:

Index: src/usr.sbin/cpuctl/arch/i386.c
diff -u src/usr.sbin/cpuctl/arch/i386.c:1.69 src/usr.sbin/cpuctl/arch/i386.c:1.70
--- src/usr.sbin/cpuctl/arch/i386.c:1.69	Fri Dec  4 05:34:59 2015
+++ src/usr.sbin/cpuctl/arch/i386.c	Fri Jan  8 02:28:44 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: i386.c,v 1.69 2015/12/04 05:34:59 msaitoh Exp $	*/
+/*	$NetBSD: i386.c,v 1.70 2016/01/08 02:28:44 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: i386.c,v 1.69 2015/12/04 05:34:59 msaitoh Exp $");
+__RCSID("$NetBSD: i386.c,v 1.70 2016/01/08 02:28:44 msaitoh Exp $");
 #endif /* not lint */
 
 #include 
@@ -333,7 +333,7 @@ const struct cpu_cpuid_nameclass i386_cp
 	 "Core 2 Quad 8xxx and 9xxx",
 [0x1a] = "Core i7, Xeon 34xx, 35xx and 55xx "
 	 "(Nehalem)",
-[0x1c] = "Atom Family",
+[0x1c] = "45nm Atom Family",
 [0x1d] = "XeonMP 74xx (Nehalem)",
 [0x1e] = "Core i7 and i5",
 [0x1f] = "Core i7 and i5",
@@ -367,13 +367,13 @@ const struct cpu_cpuid_nameclass i386_cp
 [0x4a] = "Atom Z3400",
 [0x4c] = "Atom X[57]-Z8000 (Airmont)",
 [0x4d] = "Atom C2000",
-[0x4e] = "6th gen Core, Xeon E3-1500 v5 (Skylake)",
+[0x4e] = "6th gen Core, Xeon E3-1[25]00 v5 (Skylake)",
 [0x4f] = "Future gen Xeon (Broadwell)",
 [0x56] = "Xeon D-1500 (Broadwell)",
 [0x57] = "Next gen Xeon Phi",
 [0x5a] = "Atom E3500",
 [0x5d] = "Atom X3-C3000 (Silvermont)",
-[0x5e] = "6th gen Core, Xeon E3-1500 v5 (Skylake)",
+[0x5e] = "6th gen Core, Xeon E3-1[25]00 v5 (Skylake)",
 			},
 			"Pentium Pro, II or III",	/* Default */
 			NULL,



CVS commit: src/sys/rump/include/opt

2016-01-07 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Fri Jan  8 04:06:48 UTC 2016

Modified Files:
src/sys/rump/include/opt: gif.h

Log Message:
conform rump behavior to NetBSD kernel (in paticular net.inet.ip.gifttl sysctl)


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/rump/include/opt/gif.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/rump/include/opt/gif.h
diff -u src/sys/rump/include/opt/gif.h:1.1 src/sys/rump/include/opt/gif.h:1.2
--- src/sys/rump/include/opt/gif.h:1.1	Mon Aug 24 23:04:42 2015
+++ src/sys/rump/include/opt/gif.h	Fri Jan  8 04:06:48 2016
@@ -1,3 +1,3 @@
-/*	$NetBSD: gif.h,v 1.1 2015/08/24 23:04:42 pooka Exp $	*/
+/*	$NetBSD: gif.h,v 1.2 2016/01/08 04:06:48 knakahara Exp $	*/
 
-/* dummy */
+#define NGIF 1



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

2016-01-07 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Jan  8 02:27:08 UTC 2016

Modified Files:
src/sys/arch/x86/include: specialreg.h

Log Message:
 Add x86 FPU Data Pointer Updated Only bit from Intel SDM.


To generate a diff of this commit:
cvs rdiff -u -r1.83 -r1.84 src/sys/arch/x86/include/specialreg.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/specialreg.h
diff -u src/sys/arch/x86/include/specialreg.h:1.83 src/sys/arch/x86/include/specialreg.h:1.84
--- src/sys/arch/x86/include/specialreg.h:1.83	Fri Aug 14 06:54:22 2015
+++ src/sys/arch/x86/include/specialreg.h	Fri Jan  8 02:27:07 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: specialreg.h,v 1.83 2015/08/14 06:54:22 msaitoh Exp $	*/
+/*	$NetBSD: specialreg.h,v 1.84 2016/01/08 02:27:07 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1991 The Regents of the University of California.
@@ -321,6 +321,7 @@
 #define CPUID_SEF_BMI1		__BIT(3)
 #define CPUID_SEF_HLE		__BIT(4)
 #define CPUID_SEF_AVX2		__BIT(5)
+#define CPUID_SEF_FDPEXONLY	__BIT(6)
 #define CPUID_SEF_SMEP		__BIT(7)
 #define CPUID_SEF_BMI2		__BIT(8)
 #define CPUID_SEF_ERMS		__BIT(9)
@@ -342,7 +343,7 @@
 
 #define CPUID_SEF_FLAGS	"\20" \
 	"\1" "FSGSBASE"	"\2" "TSCADJUST"		"\4" "BMI1"	\
-	"\5" "HLE"	"\6" "AVX2"			"\10" "SMEP"	\
+	"\5" "HLE"	"\6" "AVX2"	"\7" "FDPEXONLY" "\10" "SMEP"	\
 	"\11" "BMI2"	"\12" "ERMS"	"\13" "INVPCID"	"\14" "RTM"	\
 	"\15" "QM"	"\16" "FPUCSDS"	"\17" "MPX"	"\20" "PQE"	\
 	"\21" "AVX512F"			"\23" "RDSEED"	"\24" "ADX"	\



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

2016-01-07 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Jan  8 03:26:35 UTC 2016

Modified Files:
src/sys/arch/x86/include: specialreg.h

Log Message:
 Add CLFLUSHOPT bit.


To generate a diff of this commit:
cvs rdiff -u -r1.84 -r1.85 src/sys/arch/x86/include/specialreg.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/specialreg.h
diff -u src/sys/arch/x86/include/specialreg.h:1.84 src/sys/arch/x86/include/specialreg.h:1.85
--- src/sys/arch/x86/include/specialreg.h:1.84	Fri Jan  8 02:27:07 2016
+++ src/sys/arch/x86/include/specialreg.h	Fri Jan  8 03:26:35 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: specialreg.h,v 1.84 2016/01/08 02:27:07 msaitoh Exp $	*/
+/*	$NetBSD: specialreg.h,v 1.85 2016/01/08 03:26:35 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1991 The Regents of the University of California.
@@ -335,6 +335,7 @@
 #define CPUID_SEF_RDSEED	__BIT(18)
 #define CPUID_SEF_ADX		__BIT(19)
 #define CPUID_SEF_SMAP		__BIT(20)
+#define CPUID_SEF_CLFLUSHOPT	__BIT(23)
 #define CPUID_SEF_PT		__BIT(25)
 #define CPUID_SEF_AVX512PF	__BIT(26)
 #define CPUID_SEF_AVX512ER	__BIT(27)
@@ -347,8 +348,8 @@
 	"\11" "BMI2"	"\12" "ERMS"	"\13" "INVPCID"	"\14" "RTM"	\
 	"\15" "QM"	"\16" "FPUCSDS"	"\17" "MPX"	"\20" "PQE"	\
 	"\21" "AVX512F"			"\23" "RDSEED"	"\24" "ADX"	\
-	"\25" "SMAP"			\
-			"\32" "PT"	"\33" "AVX512PF""\34" "AVX512ER"\
+	"\25" "SMAP"	"\26" "CLFLUSHOPT"\
+			"\32" "PT"	"\33" "AVX512PF""\34" "AVX512ER" \
 	"\35" "AVX512CD""\36" "SHA"
 
 /* %ecx */



CVS commit: src/sys

2016-01-07 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Fri Jan  8 03:55:39 UTC 2016

Modified Files:
src/sys/net: if_gif.c
src/sys/netinet: ip_input.c
src/sys/netinet6: ip6_input.c

Log Message:
eliminate ip_input.c and ip6_input.c dependency on gif(4)


To generate a diff of this commit:
cvs rdiff -u -r1.103 -r1.104 src/sys/net/if_gif.c
cvs rdiff -u -r1.325 -r1.326 src/sys/netinet/ip_input.c
cvs rdiff -u -r1.153 -r1.154 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/net/if_gif.c
diff -u src/sys/net/if_gif.c:1.103 src/sys/net/if_gif.c:1.104
--- src/sys/net/if_gif.c:1.103	Mon Jan  4 07:50:08 2016
+++ src/sys/net/if_gif.c	Fri Jan  8 03:55:39 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_gif.c,v 1.103 2016/01/04 07:50:08 knakahara Exp $	*/
+/*	$NetBSD: if_gif.c,v 1.104 2016/01/08 03:55:39 knakahara Exp $	*/
 /*	$KAME: if_gif.c,v 1.76 2001/08/20 02:01:02 kjc Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.103 2016/01/04 07:50:08 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.104 2016/01/08 03:55:39 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -53,6 +53,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -93,6 +94,8 @@ static void	gifintr(void *);
  */
 LIST_HEAD(, gif_softc) gif_softc_list;	/* XXX should be static */
 
+static void	gif_sysctl_setup(struct sysctllog **);
+
 static int	gif_clone_create(struct if_clone *, int);
 static int	gif_clone_destroy(struct ifnet *);
 static int	gif_check_nesting(struct ifnet *, struct mbuf *);
@@ -116,6 +119,30 @@ static struct if_clone gif_cloner =
 #endif
 static int max_gif_nesting = MAX_GIF_NEST;
 
+static void
+gif_sysctl_setup(struct sysctllog **clog)
+{
+
+#ifdef INET
+	sysctl_createv(clog, 0, NULL, NULL,
+		   CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
+		   CTLTYPE_INT, "gifttl",
+		   SYSCTL_DESCR("Default TTL for a gif tunnel datagram"),
+		   NULL, 0, _gif_ttl, 0,
+		   CTL_NET, PF_INET, IPPROTO_IP,
+		   IPCTL_GIF_TTL, CTL_EOL);
+#endif
+#ifdef INET6
+	sysctl_createv(clog, 0, NULL, NULL,
+		   CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
+		   CTLTYPE_INT, "gifhlim",
+		   SYSCTL_DESCR("Default hop limit for a gif tunnel datagram"),
+		   NULL, 0, _gif_hlim, 0,
+		   CTL_NET, PF_INET6, IPPROTO_IPV6,
+		   IPV6CTL_GIF_HLIM, CTL_EOL);
+#endif
+}
+
 /* ARGSUSED */
 void
 gifattach(int count)
@@ -123,6 +150,8 @@ gifattach(int count)
 
 	LIST_INIT(_softc_list);
 	if_clone_attach(_cloner);
+
+	gif_sysctl_setup(NULL);
 }
 
 static int

Index: src/sys/netinet/ip_input.c
diff -u src/sys/netinet/ip_input.c:1.325 src/sys/netinet/ip_input.c:1.326
--- src/sys/netinet/ip_input.c:1.325	Tue Oct 13 09:46:42 2015
+++ src/sys/netinet/ip_input.c	Fri Jan  8 03:55:39 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_input.c,v 1.325 2015/10/13 09:46:42 roy Exp $	*/
+/*	$NetBSD: ip_input.c,v 1.326 2016/01/08 03:55:39 knakahara Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip_input.c,v 1.325 2015/10/13 09:46:42 roy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_input.c,v 1.326 2016/01/08 03:55:39 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1584,15 +1584,6 @@ sysctl_net_inet_ip_setup(struct sysctllo
 		   sysctl_net_inet_ip_pmtudto, 0, (void *)_mtudisc_timeout, 0,
 		   CTL_NET, PF_INET, IPPROTO_IP,
 		   IPCTL_MTUDISCTIMEOUT, CTL_EOL);
-#if NGIF > 0
-	sysctl_createv(clog, 0, NULL, NULL,
-		   CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
-		   CTLTYPE_INT, "gifttl",
-		   SYSCTL_DESCR("Default TTL for a gif tunnel datagram"),
-		   NULL, 0, _gif_ttl, 0,
-		   CTL_NET, PF_INET, IPPROTO_IP,
-		   IPCTL_GIF_TTL, CTL_EOL);
-#endif /* NGIF */
 #ifndef IPNOPRIVPORTS
 	sysctl_createv(clog, 0, NULL, NULL,
 		   CTLFLAG_PERMANENT|CTLFLAG_READWRITE,

Index: src/sys/netinet6/ip6_input.c
diff -u src/sys/netinet6/ip6_input.c:1.153 src/sys/netinet6/ip6_input.c:1.154
--- src/sys/netinet6/ip6_input.c:1.153	Sat Dec 12 23:34:25 2015
+++ src/sys/netinet6/ip6_input.c	Fri Jan  8 03:55:39 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip6_input.c,v 1.153 2015/12/12 23:34:25 christos Exp $	*/
+/*	$NetBSD: ip6_input.c,v 1.154 2016/01/08 03:55:39 knakahara 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.153 2015/12/12 23:34:25 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip6_input.c,v 1.154 2016/01/08 03:55:39 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_gateway.h"
@@ -127,11 +127,6 @@ __KERNEL_RCSID(0, "$NetBSD: ip6_input.c,
 #include 
 
 #include "faith.h"
-#include "gif.h"
-
-#if NGIF > 0
-#include 
-#endif
 
 #include 
 
@@ -1778,15 +1773,6 

CVS commit: src/tests

2016-01-07 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Thu Jan  7 15:58:23 UTC 2016

Modified Files:
src/tests/dev/usb: t_hid.c
src/tests/lib/libusbhid: hid_test_data.c t_usbhid.c

Log Message:
Add tests for HID Parser Pop-on-empty-stack bug.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/dev/usb/t_hid.c
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libusbhid/hid_test_data.c
cvs rdiff -u -r1.9 -r1.10 src/tests/lib/libusbhid/t_usbhid.c

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

Modified files:

Index: src/tests/dev/usb/t_hid.c
diff -u src/tests/dev/usb/t_hid.c:1.1 src/tests/dev/usb/t_hid.c:1.2
--- src/tests/dev/usb/t_hid.c:1.1	Tue Jan  5 17:22:38 2016
+++ src/tests/dev/usb/t_hid.c	Thu Jan  7 15:58:23 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_hid.c,v 1.1 2016/01/05 17:22:38 jakllsch Exp $	*/
+/*	$NetBSD: t_hid.c,v 1.2 2016/01/07 15:58:23 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 2016 Jonathan A. Kollasch
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_hid.c,v 1.1 2016/01/05 17:22:38 jakllsch Exp $");
+__RCSID("$NetBSD: t_hid.c,v 1.2 2016/01/07 15:58:23 jakllsch Exp $");
 
 #include 
 #include 
@@ -200,10 +200,34 @@ ATF_TC_BODY(khid, tc)
 	), 0xff);
 }
 
+ATF_TC(khid_parse_just_pop);
+
+ATF_TC_HEAD(khid_parse_just_pop, tc)
+{
+
+atf_tc_set_md_var(tc, "descr", "check kernel hid.c for "
+	"Pop on empty stack bug");
+}
+
+ATF_TC_BODY(khid_parse_just_pop, tc)
+{
+	struct hid_data *hdp;
+	struct hid_item hi;
+
+	atf_tc_expect_fail("Pop crashes on empty stack.");
+
+	hdp = hid_start_parse(just_pop_report_descriptor,
+	sizeof just_pop_report_descriptor, hid_none);
+	while (hid_get_item(hdp, ) > 0) {
+	}
+	hid_end_parse(hdp);
+}
+
 ATF_TP_ADD_TCS(tp)
 {
 
 ATF_TP_ADD_TC(tp, khid);
+ATF_TP_ADD_TC(tp, khid_parse_just_pop);
 
 	return atf_no_error();
 }

Index: src/tests/lib/libusbhid/hid_test_data.c
diff -u src/tests/lib/libusbhid/hid_test_data.c:1.1 src/tests/lib/libusbhid/hid_test_data.c:1.2
--- src/tests/lib/libusbhid/hid_test_data.c:1.1	Mon Jan  4 22:07:16 2016
+++ src/tests/lib/libusbhid/hid_test_data.c	Thu Jan  7 15:58:23 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: hid_test_data.c,v 1.1 2016/01/04 22:07:16 jakllsch Exp $	*/
+/*	$NetBSD: hid_test_data.c,v 1.2 2016/01/07 15:58:23 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 2016 Jonathan A. Kollasch
@@ -132,3 +132,6 @@ static const uint8_t unsigned_range_test
 	0xff,
 };
 
+static const uint8_t just_pop_report_descriptor[] = {
+	0xb4,
+};

Index: src/tests/lib/libusbhid/t_usbhid.c
diff -u src/tests/lib/libusbhid/t_usbhid.c:1.9 src/tests/lib/libusbhid/t_usbhid.c:1.10
--- src/tests/lib/libusbhid/t_usbhid.c:1.9	Mon Jan  4 22:07:16 2016
+++ src/tests/lib/libusbhid/t_usbhid.c	Thu Jan  7 15:58:23 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_usbhid.c,v 1.9 2016/01/04 22:07:16 jakllsch Exp $	*/
+/*	$NetBSD: t_usbhid.c,v 1.10 2016/01/07 15:58:23 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 2016 Jonathan A. Kollasch
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_usbhid.c,v 1.9 2016/01/04 22:07:16 jakllsch Exp $");
+__RCSID("$NetBSD: t_usbhid.c,v 1.10 2016/01/07 15:58:23 jakllsch Exp $");
 
 #include 
 
@@ -45,6 +45,7 @@ ATF_TC(check_hid_physical_range);
 ATF_TC(check_hid_usage);
 ATF_TC(check_hid_get_data);
 ATF_TC(check_hid_set_data);
+ATF_TC(check_parse_just_pop);
 
 #define MYd_ATF_CHECK_EQ(d, v) \
 	ATF_CHECK_EQ_MSG(d, v, "== %d", (d))
@@ -411,6 +412,31 @@ ATF_TC_BODY(check_hid_set_data, tc)
 	hrd = NULL;
 }
 
+ATF_TC_HEAD(check_parse_just_pop, tc)
+{
+
+	atf_tc_set_md_var(tc, "descr", "check Pop on empty stack bug");
+}
+
+ATF_TC_BODY(check_parse_just_pop, tc)
+{
+	report_desc_t hrd;
+	hid_data_t hd;
+	hid_item_t hi;
+
+	atf_tc_expect_fail("segfaults");
+
+	ATF_REQUIRE((hrd = hid_use_report_desc(
+	just_pop_report_descriptor,
+	sizeof just_pop_report_descriptor)) != NULL);
+	hd = hid_start_parse(hrd, 0, NO_REPORT_ID);
+	while (hid_get_item(hd, ) > 0) {
+	}
+	hid_end_parse(hd);
+	hid_dispose_report_desc(hrd);
+	hrd = NULL;
+}
+
 ATF_TP_ADD_TCS(tp)
 {
 
@@ -419,6 +445,7 @@ ATF_TP_ADD_TCS(tp)
 	ATF_TP_ADD_TC(tp, check_hid_usage);
 	ATF_TP_ADD_TC(tp, check_hid_get_data);
 	ATF_TP_ADD_TC(tp, check_hid_set_data);
+	ATF_TP_ADD_TC(tp, check_parse_just_pop);
 
 	return atf_no_error();
 }



CVS commit: src

2016-01-07 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Thu Jan  7 16:10:49 UTC 2016

Modified Files:
src/lib/libusbhid: parse.c
src/sys/dev/usb: hid.c
src/tests/dev/usb: t_hid.c
src/tests/lib/libusbhid: t_usbhid.c

Log Message:
Don't crash when the device's HID Report Descriptor Pops from an empty stack.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/lib/libusbhid/parse.c
cvs rdiff -u -r1.39 -r1.40 src/sys/dev/usb/hid.c
cvs rdiff -u -r1.2 -r1.3 src/tests/dev/usb/t_hid.c
cvs rdiff -u -r1.10 -r1.11 src/tests/lib/libusbhid/t_usbhid.c

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

Modified files:

Index: src/lib/libusbhid/parse.c
diff -u src/lib/libusbhid/parse.c:1.8 src/lib/libusbhid/parse.c:1.9
--- src/lib/libusbhid/parse.c:1.8	Mon May 23 15:16:27 2011
+++ src/lib/libusbhid/parse.c	Thu Jan  7 16:10:49 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.8 2011/05/23 15:16:27 joerg Exp $	*/
+/*	$NetBSD: parse.c,v 1.9 2016/01/07 16:10:49 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 1999, 2001 Lennart Augustsson 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: parse.c,v 1.8 2011/05/23 15:16:27 joerg Exp $");
+__RCSID("$NetBSD: parse.c,v 1.9 2016/01/07 16:10:49 jakllsch Exp $");
 
 #include 
 #include 
@@ -375,6 +375,8 @@ hid_get_item_raw(hid_data_t s, hid_item_
 break;
 			case 11: /* Pop */
 hi = c->next;
+if (hi == NULL)
+	break;
 s->cur = *hi;
 free(hi);
 break;

Index: src/sys/dev/usb/hid.c
diff -u src/sys/dev/usb/hid.c:1.39 src/sys/dev/usb/hid.c:1.40
--- src/sys/dev/usb/hid.c:1.39	Sat Jan  2 20:57:10 2016
+++ src/sys/dev/usb/hid.c	Thu Jan  7 16:10:49 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: hid.c,v 1.39 2016/01/02 20:57:10 jakllsch Exp $	*/
+/*	$NetBSD: hid.c,v 1.40 2016/01/07 16:10:49 jakllsch Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/hid.c,v 1.11 1999/11/17 22:33:39 n_hibma Exp $ */
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hid.c,v 1.39 2016/01/02 20:57:10 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hid.c,v 1.40 2016/01/07 16:10:49 jakllsch Exp $");
 
 #include 
 #include 
@@ -298,6 +298,8 @@ hid_get_item(struct hid_data *s, struct 
 break;
 			case 11: /* Pop */
 hi = c->next;
+if (hi == NULL)
+	break;
 oldpos = c->loc.pos;
 *c = *hi;
 c->loc.pos = oldpos;

Index: src/tests/dev/usb/t_hid.c
diff -u src/tests/dev/usb/t_hid.c:1.2 src/tests/dev/usb/t_hid.c:1.3
--- src/tests/dev/usb/t_hid.c:1.2	Thu Jan  7 15:58:23 2016
+++ src/tests/dev/usb/t_hid.c	Thu Jan  7 16:10:49 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_hid.c,v 1.2 2016/01/07 15:58:23 jakllsch Exp $	*/
+/*	$NetBSD: t_hid.c,v 1.3 2016/01/07 16:10:49 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 2016 Jonathan A. Kollasch
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_hid.c,v 1.2 2016/01/07 15:58:23 jakllsch Exp $");
+__RCSID("$NetBSD: t_hid.c,v 1.3 2016/01/07 16:10:49 jakllsch Exp $");
 
 #include 
 #include 
@@ -214,8 +214,6 @@ ATF_TC_BODY(khid_parse_just_pop, tc)
 	struct hid_data *hdp;
 	struct hid_item hi;
 
-	atf_tc_expect_fail("Pop crashes on empty stack.");
-
 	hdp = hid_start_parse(just_pop_report_descriptor,
 	sizeof just_pop_report_descriptor, hid_none);
 	while (hid_get_item(hdp, ) > 0) {

Index: src/tests/lib/libusbhid/t_usbhid.c
diff -u src/tests/lib/libusbhid/t_usbhid.c:1.10 src/tests/lib/libusbhid/t_usbhid.c:1.11
--- src/tests/lib/libusbhid/t_usbhid.c:1.10	Thu Jan  7 15:58:23 2016
+++ src/tests/lib/libusbhid/t_usbhid.c	Thu Jan  7 16:10:49 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_usbhid.c,v 1.10 2016/01/07 15:58:23 jakllsch Exp $	*/
+/*	$NetBSD: t_usbhid.c,v 1.11 2016/01/07 16:10:49 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 2016 Jonathan A. Kollasch
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_usbhid.c,v 1.10 2016/01/07 15:58:23 jakllsch Exp $");
+__RCSID("$NetBSD: t_usbhid.c,v 1.11 2016/01/07 16:10:49 jakllsch Exp $");
 
 #include 
 
@@ -424,8 +424,6 @@ ATF_TC_BODY(check_parse_just_pop, tc)
 	hid_data_t hd;
 	hid_item_t hi;
 
-	atf_tc_expect_fail("segfaults");
-
 	ATF_REQUIRE((hrd = hid_use_report_desc(
 	just_pop_report_descriptor,
 	sizeof just_pop_report_descriptor)) != NULL);



CVS commit: src/sys/dev/filemon

2016-01-07 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Fri Jan  8 07:16:13 UTC 2016

Modified Files:
src/sys/dev/filemon: filemon.c

Log Message:
typo in debug print


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/filemon/filemon.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/filemon/filemon.c
diff -u src/sys/dev/filemon/filemon.c:1.24 src/sys/dev/filemon/filemon.c:1.25
--- src/sys/dev/filemon/filemon.c:1.24	Tue Jan  5 22:08:54 2016
+++ src/sys/dev/filemon/filemon.c	Fri Jan  8 07:16:13 2016
@@ -1,4 +1,4 @@
-/*  $NetBSD: filemon.c,v 1.24 2016/01/05 22:08:54 pgoyette Exp $ */
+/*  $NetBSD: filemon.c,v 1.25 2016/01/08 07:16:13 dholland Exp $ */
 /*
  * Copyright (c) 2010, Juniper Networks, Inc.
  *
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: filemon.c,v 1.24 2016/01/05 22:08:54 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: filemon.c,v 1.25 2016/01/08 07:16:13 dholland Exp $");
 
 #include 
 #include 
@@ -115,7 +115,7 @@ filemon_output(struct filemon * filemon,
 		cp = strchr(msg, '\n');
 		if (cp && cp - msg <= 16)
 			x = (cp - msg) - 2;
-		log(logLevel, "filemont_output:('%.*s%s'", x,
+		log(logLevel, "filemon_output:('%.*s%s'", x,
 		(x < 16) ? "..." : "", msg);
 	}
 #endif



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

2016-01-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan  7 20:06:44 UTC 2016

Modified Files:
src/external/bsd/mdocml/dist: eqn.c

Log Message:
CID 1257471: NULL deref.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/mdocml/dist/eqn.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/mdocml/dist/eqn.c
diff -u src/external/bsd/mdocml/dist/eqn.c:1.2 src/external/bsd/mdocml/dist/eqn.c:1.3
--- src/external/bsd/mdocml/dist/eqn.c:1.2	Thu Jan  7 14:32:43 2016
+++ src/external/bsd/mdocml/dist/eqn.c	Thu Jan  7 15:06:44 2016
@@ -1,4 +1,4 @@
-/*	$Id: eqn.c,v 1.2 2016/01/07 19:32:43 christos Exp $ */
+/*	$Id: eqn.c,v 1.3 2016/01/07 20:06:44 christos Exp $ */
 /*
  * Copyright (c) 2011, 2014 Kristaps Dzonsons 
  * Copyright (c) 2014, 2015 Ingo Schwarze 
@@ -992,7 +992,7 @@ this_tok:
 		 parent->type == EQN_MATRIX))
 			parent = parent->parent;
 		/* Close out any "singleton" lists. */
-		while (parent->type == EQN_LISTONE &&
+		while (parrent && parent->type == EQN_LISTONE &&
 		parent->args == parent->expectargs)
 			parent = parent->parent;
 		break;



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

2016-01-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan  7 20:11:57 UTC 2016

Modified Files:
src/external/bsd/mdocml/dist: read.c

Log Message:
CID 1257467: Annotate incorrect inull.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/external/bsd/mdocml/dist/read.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/mdocml/dist/read.c
diff -u src/external/bsd/mdocml/dist/read.c:1.13 src/external/bsd/mdocml/dist/read.c:1.14
--- src/external/bsd/mdocml/dist/read.c:1.13	Thu Jan  7 14:49:25 2016
+++ src/external/bsd/mdocml/dist/read.c	Thu Jan  7 15:11:57 2016
@@ -1,4 +1,4 @@
-/*	$Id: read.c,v 1.13 2016/01/07 19:49:25 christos Exp $ */
+/*	$Id: read.c,v 1.14 2016/01/07 20:11:57 christos Exp $ */
 /*
  * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons 
  * Copyright (c) 2010-2015 Ingo Schwarze 
@@ -823,6 +823,7 @@ mparse_open(struct mparse *curp, int *fd
 
 	save_errno = errno;
 	if (access(file, R_OK) == -1) {
+		/*coverity[REVERSE_INULL]*/
 		if (cp != NULL)
 			errno = save_errno;
 		free(cp);



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

2016-01-07 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Thu Jan  7 20:04:11 UTC 2016

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

Log Message:
Import dhcpcd-6.10.0 with the following changes:
  *  --noption requires an argument
  *  optimise the ARP BPF filter, thanks to Nate Karstens
  *  send gratuitous ARP each time we apply our IP address
  *  fix truncation of hostnames based on the short hostname option
  *  improve routing and address management by always loading all
 interfaces, routes and addresses even for interfaces we are
 not directly working on
  *  timezone, lookup-hostname, wpa_supplicant and YP hooks are no
 longer installed by default but are installed to an example
 directory
  *  improve error logging of packet parsing
  *  fix ignoring routing messages generated by dhcpcd just before
 forking
  *  fix handling of rapid commit messages (allow ACK after DISCOVER)
  *  add PROBE state so we can easily reject DHCP messages received
 during the ARP probe phase
  *  fix CVE-2016-1503
  *  fix CVE-2016-1504

An extra patch was added to the import from the official 6.10.0 release
to add -P, --printpidfile so the dhcpcd rc.d script can work out what
pidfile to use.

Status:

Vendor Tag: roy
Release Tags:   dhcpcd-6-10-0

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

25 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/doc

2016-01-07 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Thu Jan  7 20:16:12 UTC 2016

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
Note import of dhcpcd-6.10.0


To generate a diff of this commit:
cvs rdiff -u -r1.1284 -r1.1285 src/doc/3RDPARTY
cvs rdiff -u -r1.2124 -r1.2125 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.1284 src/doc/3RDPARTY:1.1285
--- src/doc/3RDPARTY:1.1284	Thu Jan  7 10:18:36 2016
+++ src/doc/3RDPARTY	Thu Jan  7 20:16:12 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1284 2016/01/07 10:18:36 wiz Exp $
+#	$NetBSD: 3RDPARTY,v 1.1285 2016/01/07 20:16:12 roy Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -306,8 +306,8 @@ Notes:
 Use the dhcp2netbsd script.
 
 Package:	dhcpcd
-Version:	6.9.4
-Current Vers:	6.9.4
+Version:	6.10.0
+Current Vers:	6.10.0
 Maintainer:	roy
 Archive Site:	ftp://roy.marples.name/pub/dhcpcd/
 Home Page:	http://roy.marples.name/projects/dhcpcd/

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2124 src/doc/CHANGES:1.2125
--- src/doc/CHANGES:1.2124	Tue Jan  5 11:35:39 2016
+++ src/doc/CHANGES	Thu Jan  7 20:16:12 2016
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2124 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2125 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -237,3 +237,4 @@ Changes from NetBSD 7.0 to NetBSD 8.0:
 	lmtemp(4): Add chip temperature limits for envsys(4) [jdc 20160103]
 	ismt(4): Add another Intel Chipset internal SMBus driver.
 		[msaitoh 20160105]
+	dhcpcd: Import dhcpcd 6.10.0. [roy 20160107]



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

2016-01-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan  7 19:32:44 UTC 2016

Modified Files:
src/external/bsd/mdocml/dist: eqn.c

Log Message:
CID 1288962: lim was never incremented thus self-definition loop detection
was not functional.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.4 -r1.2 src/external/bsd/mdocml/dist/eqn.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/mdocml/dist/eqn.c
diff -u src/external/bsd/mdocml/dist/eqn.c:1.1.1.4 src/external/bsd/mdocml/dist/eqn.c:1.2
--- src/external/bsd/mdocml/dist/eqn.c:1.1.1.4	Thu Dec 17 16:58:48 2015
+++ src/external/bsd/mdocml/dist/eqn.c	Thu Jan  7 14:32:43 2016
@@ -1,4 +1,4 @@
-/*	$Id: eqn.c,v 1.1.1.4 2015/12/17 21:58:48 christos Exp $ */
+/*	$Id: eqn.c,v 1.2 2016/01/07 19:32:43 christos Exp $ */
 /*
  * Copyright (c) 2011, 2014 Kristaps Dzonsons 
  * Copyright (c) 2014, 2015 Ingo Schwarze 
@@ -448,6 +448,7 @@ again:
 		memmove(start + *sz + diff, start + *sz,
 		(strlen(start) - *sz) + 1);
 		memcpy(start, def->val, def->valsz);
+		lim++;
 		goto again;
 	}
 



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

2016-01-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan  7 19:49:25 UTC 2016

Modified Files:
src/external/bsd/mdocml/dist: read.c

Log Message:
CID 1288947: Prevent fd leak.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/bsd/mdocml/dist/read.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/mdocml/dist/read.c
diff -u src/external/bsd/mdocml/dist/read.c:1.12 src/external/bsd/mdocml/dist/read.c:1.13
--- src/external/bsd/mdocml/dist/read.c:1.12	Fri Dec 18 09:30:41 2015
+++ src/external/bsd/mdocml/dist/read.c	Thu Jan  7 14:49:25 2016
@@ -1,4 +1,4 @@
-/*	$Id: read.c,v 1.12 2015/12/18 14:30:41 christos Exp $ */
+/*	$Id: read.c,v 1.13 2016/01/07 19:49:25 christos Exp $ */
 /*
  * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons 
  * Copyright (c) 2010-2015 Ingo Schwarze 
@@ -336,6 +336,7 @@ mparse_buf_r(struct mparse *curp, const 
 
 	lnn = curp->line;
 	pos = 0;
+	fd = -1;
 
 	while (i < blk.sz) {
 		if (0 == pos && '\0' == blk.buf[i])
@@ -530,8 +531,7 @@ rerun:
 			if ( ! (curp->options & MPARSE_SO) &&
 			(i >= blk.sz || blk.buf[i] == '\0')) {
 curp->sodest = mandoc_strdup(ln.buf + of);
-free(ln.buf);
-return;
+goto out;
 			}
 			/*
 			 * We remove `so' clauses from our lookaside
@@ -611,7 +611,10 @@ rerun:
 		pos = 0;
 	}
 
+out:
 	free(ln.buf);
+	if (fd != -1)
+		close(fd);
 }
 
 static int



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

2016-01-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan  7 19:46:01 UTC 2016

Modified Files:
src/external/bsd/mdocml/dist: mdoc_validate.c

Log Message:
CID 1288958: Prevent NULL deref


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/mdocml/dist/mdoc_validate.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/mdocml/dist/mdoc_validate.c
diff -u src/external/bsd/mdocml/dist/mdoc_validate.c:1.7 src/external/bsd/mdocml/dist/mdoc_validate.c:1.8
--- src/external/bsd/mdocml/dist/mdoc_validate.c:1.7	Thu Dec 17 17:31:12 2015
+++ src/external/bsd/mdocml/dist/mdoc_validate.c	Thu Jan  7 14:46:00 2016
@@ -1,4 +1,4 @@
-/*	$Id: mdoc_validate.c,v 1.7 2015/12/17 22:31:12 christos Exp $ */
+/*	$Id: mdoc_validate.c,v 1.8 2016/01/07 19:46:00 christos Exp $ */
 /*
  * Copyright (c) 2008-2012 Kristaps Dzonsons 
  * Copyright (c) 2010-2015 Ingo Schwarze 
@@ -1464,7 +1464,8 @@ post_bl(POST_ARGS)
 			assert(NULL == nnext);
 		} else {
 			nbody->child = nnext;
-			nnext->prev = NULL;
+			if (nnext)
+nnext->prev = NULL;
 		}
 
 		/*



CVS commit: src/sys/dev/raidframe

2016-01-07 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Jan  7 21:57:00 UTC 2016

Modified Files:
src/sys/dev/raidframe: rf_dagutils.c

Log Message:
Don't use for (...); by using an explicit continue as body.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/dev/raidframe/rf_dagutils.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/raidframe/rf_dagutils.c
diff -u src/sys/dev/raidframe/rf_dagutils.c:1.53 src/sys/dev/raidframe/rf_dagutils.c:1.54
--- src/sys/dev/raidframe/rf_dagutils.c:1.53	Wed May 11 18:13:12 2011
+++ src/sys/dev/raidframe/rf_dagutils.c	Thu Jan  7 21:57:00 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_dagutils.c,v 1.53 2011/05/11 18:13:12 mrg Exp $	*/
+/*	$NetBSD: rf_dagutils.c,v 1.54 2016/01/07 21:57:00 joerg Exp $	*/
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rf_dagutils.c,v 1.53 2011/05/11 18:13:12 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_dagutils.c,v 1.54 2016/01/07 21:57:00 joerg Exp $");
 
 #include 
 
@@ -1258,7 +1258,8 @@ rf_compute_workload_shift(RF_Raid_t *rai
 	d = pda->col;
 
 	/* assign column of dead disk to f */
-	for (f = 0; ((!RF_DEAD_DISK(raidPtr->Disks[f].status)) && (f < n)); f++);
+	for (f = 0; ((!RF_DEAD_DISK(raidPtr->Disks[f].status)) && (f < n)); f++)
+		continue;
 
 	RF_ASSERT(f < n);
 	RF_ASSERT(f != d);



CVS commit: src/sys/compat/netbsd32

2016-01-07 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Jan  7 21:58:28 UTC 2016

Modified Files:
src/sys/compat/netbsd32: netbsd32_compat_14.c

Log Message:
Avoid defining inline functions that are never used when certain options
are missing.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/compat/netbsd32/netbsd32_compat_14.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_compat_14.c
diff -u src/sys/compat/netbsd32/netbsd32_compat_14.c:1.25 src/sys/compat/netbsd32/netbsd32_compat_14.c:1.26
--- src/sys/compat/netbsd32/netbsd32_compat_14.c:1.25	Thu Dec  3 11:31:05 2015
+++ src/sys/compat/netbsd32/netbsd32_compat_14.c	Thu Jan  7 21:58:28 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_compat_14.c,v 1.25 2015/12/03 11:31:05 pgoyette Exp $	*/
+/*	$NetBSD: netbsd32_compat_14.c,v 1.26 2016/01/07 21:58:28 joerg Exp $	*/
 
 /*
  * Copyright (c) 1999 Eduardo E. Horvath
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_14.c,v 1.25 2015/12/03 11:31:05 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_14.c,v 1.26 2016/01/07 21:58:28 joerg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sysv.h"
@@ -53,23 +53,7 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_com
 
 #if defined(COMPAT_14)
 
-static inline void
-netbsd32_ipc_perm14_to_native(struct netbsd32_ipc_perm14 *, struct ipc_perm *);
-static inline void
-native_to_netbsd32_ipc_perm14(struct ipc_perm *, struct netbsd32_ipc_perm14 *);
-static inline void
-native_to_netbsd32_msqid_ds14(struct msqid_ds *, struct netbsd32_msqid_ds14 *);
-static inline void
-netbsd32_msqid_ds14_to_native(struct netbsd32_msqid_ds14 *, struct msqid_ds *);
-static inline void
-native_to_netbsd32_semid_ds14(struct semid_ds *, struct netbsd32_semid_ds14 *);
-static inline void
-netbsd32_semid_ds14_to_native(struct netbsd32_semid_ds14 *, struct semid_ds *);
-static inline void
-netbsd32_shmid_ds14_to_native(struct netbsd32_shmid_ds14 *, struct shmid_ds *);
-static inline void
-native_to_netbsd32_shmid_ds14(struct shmid_ds *, struct netbsd32_shmid_ds14 *);
-
+#if defined(SYSVMSG)
 static inline void
 netbsd32_ipc_perm14_to_native(struct netbsd32_ipc_perm14 *operm, struct ipc_perm *perm)
 {
@@ -140,7 +124,9 @@ native_to_netbsd32_msqid_ds14(struct msq
 	 */
 	omsqbuf->msg_cbytes = msqbuf->_msg_cbytes;
 }
+#endif
 
+#if defined(SYSVSEM)
 static inline void
 netbsd32_semid_ds14_to_native(struct netbsd32_semid_ds14 *osembuf, struct semid_ds *sembuf)
 {
@@ -204,7 +190,6 @@ native_to_netbsd32_shmid_ds14(struct shm
 /*
  * the compat_14 system calls
  */
-#if defined(SYSVMSG)
 int
 compat_14_netbsd32_msgctl(struct lwp *l, const struct compat_14_netbsd32_msgctl_args *uap, register_t *retval)
 {



CVS commit: src/etc/rc.d

2016-01-07 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Thu Jan  7 22:03:00 UTC 2016

Modified Files:
src/etc/rc.d: dhcpcd

Log Message:
Use the new -P option to work out which pidfile dhcpcd will use.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/etc/rc.d/dhcpcd

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

Modified files:

Index: src/etc/rc.d/dhcpcd
diff -u src/etc/rc.d/dhcpcd:1.4 src/etc/rc.d/dhcpcd:1.5
--- src/etc/rc.d/dhcpcd:1.4	Fri Oct 16 18:06:22 2015
+++ src/etc/rc.d/dhcpcd	Thu Jan  7 22:03:00 2016
@@ -1,5 +1,7 @@
 #!/bin/sh
 
+# $NetBSD: dhcpcd,v 1.5 2016/01/07 22:03:00 roy Exp $
+
 # PROVIDE: dhcpcd
 # REQUIRE: network mountcritlocal
 # BEFORE:  NETWORKING
@@ -13,28 +15,14 @@ extra_commands="reload"
 
 load_rc_config $name
 
-# If the last argument to dhcpcd is a valid interface and the prior argument
-# is not then dhcpcd will start on one interface only and create a pidfile
-# based on the interface name. See PR bin/43490.
+# Work out what pidfile dhcpcd will use based on flags
 if [ -n "$flags" ]; then
 	myflags=$flags
 else
 	eval myflags=\$${name}_flags
 fi
-ifname="${myflags##* }"
-myflags="${myflags%% $ifname}"
-last_flag="${myflags##* }"
-# Address the problem of having just dhcpcd_flags=wm0
-if [ "$myflags" = "$last_flag" ]; then
-	last_flag="invalidinterfacename"
-fi
-if /sbin/ifconfig "$ifname" >/dev/null 2>&1 && 
-! /sbin/ifconfig "$last_flag" >/dev/null 2>&1
-then
-	pidfile=/var/run/$name-"$ifname".pid
-else
-	pidfile=/var/run/$name.pid
-fi
-unset myflags ifname last_flag
+pidfile=$(eval $command -P $myflags 2>/dev/null)
+: ${pidfile:=/var/run/$name.pid}
+unset myflags
 
 run_rc_command "$1"



CVS commit: src

2016-01-07 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Thu Jan  7 22:07:18 UTC 2016

Modified Files:
src/distrib/sets/lists/base: mi
src/distrib/sets/lists/misc: mi
src/etc/mtree: NetBSD.dist.base
src/external/bsd/dhcpcd/sbin/dhcpcd: Makefile

Log Message:
Move 10-wpa_supplicant, 15-timezone, 29-lookup-hostname and 50-ypbind
from /libexec/dhcpcd-hooks to /usr/share/examples/dhcpcd/hooks so they
are not run by default.


To generate a diff of this commit:
cvs rdiff -u -r1.1119 -r1.1120 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.196 -r1.197 src/distrib/sets/lists/misc/mi
cvs rdiff -u -r1.150 -r1.151 src/etc/mtree/NetBSD.dist.base
cvs rdiff -u -r1.27 -r1.28 src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile

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

Modified files:

Index: src/distrib/sets/lists/base/mi
diff -u src/distrib/sets/lists/base/mi:1.1119 src/distrib/sets/lists/base/mi:1.1120
--- src/distrib/sets/lists/base/mi:1.1119	Sat Dec 12 23:42:43 2015
+++ src/distrib/sets/lists/base/mi	Thu Jan  7 22:07:18 2016
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1119 2015/12/12 23:42:43 christos Exp $
+# $NetBSD: mi,v 1.1120 2016/01/07 22:07:18 roy Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -405,13 +405,13 @@
 ./libexec/dhcpcd-hooks/01-test			base-dhcpcd-root
 ./libexec/dhcpcd-hooks/02-dump			base-dhcpcd-root
 ./libexec/dhcpcd-hooks/10-mtu			base-obsolete  obsolete
-./libexec/dhcpcd-hooks/10-resolv.conf		base-obsolete			obsolete
-./libexec/dhcpcd-hooks/10-wpa_supplicant	base-dhcpcd-root
-./libexec/dhcpcd-hooks/14-lookup-hostname	base-obsolete			obsolete
-./libexec/dhcpcd-hooks/15-hostname		base-obsolete			obsolete
-./libexec/dhcpcd-hooks/15-timezone		base-dhcpcd-root
+./libexec/dhcpcd-hooks/10-resolv.conf		base-obsolete  obsolete
+./libexec/dhcpcd-hooks/10-wpa_supplicant	base-obsolete  obsolete
+./libexec/dhcpcd-hooks/14-lookup-hostname	base-obsolete  obsolete
+./libexec/dhcpcd-hooks/15-hostname		base-obsolete  obsolete
+./libexec/dhcpcd-hooks/15-timezone		base-obsolete  obsolete
 ./libexec/dhcpcd-hooks/20-resolv.conf		base-dhcpcd-root
-./libexec/dhcpcd-hooks/29-lookup-hostname	base-dhcpcd-root
+./libexec/dhcpcd-hooks/29-lookup-hostname	base-obsolete  obsolete
 ./libexec/dhcpcd-hooks/30-hostname		base-dhcpcd-root
 ./libexec/dhcpcd-hooks/50-ntp.conf		base-dhcpcd-root
 ./libexec/dhcpcd-run-hooks			base-dhcpcd-root
@@ -2125,6 +2125,8 @@
 ./usr/share/examples/blacklist/blacklistd.conf	base-sys-examples
 ./usr/share/examples/blacklist/npf.conf		base-sys-examples
 ./usr/share/examples/dhcp			base-dhcpd-examples
+./usr/share/examples/dhcpcd			base-dhcpcd-examples
+./usr/share/examples/dhcpcd/hooks		base-dhcpcd-examples
 ./usr/share/examples/disktab			base-sys-examples
 ./usr/share/examples/emul			base-sys-examples
 ./usr/share/examples/emul/linux			base-sys-examples

Index: src/distrib/sets/lists/misc/mi
diff -u src/distrib/sets/lists/misc/mi:1.196 src/distrib/sets/lists/misc/mi:1.197
--- src/distrib/sets/lists/misc/mi:1.196	Sun Aug 23 18:28:40 2015
+++ src/distrib/sets/lists/misc/mi	Thu Jan  7 22:07:18 2016
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.196 2015/08/23 18:28:40 mrg Exp $
+# $NetBSD: mi,v 1.197 2016/01/07 22:07:18 roy Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -1360,6 +1360,10 @@
 ./usr/share/examples/atf/tests-results.css	misc-atf-examples	share,atf,!kyua
 ./usr/share/examples/atf/tests-results.css	misc-obsolete		share,kyua,obsolete
 ./usr/share/examples/dhcp/dhcpd.conf		misc-dhcpd-examples	share
+./usr/share/examples/dhcpcd/hooks/10-wpa_supplicant	misc-dhcpcd-examples	share
+./usr/share/examples/dhcpcd/hooks/15-timezone	misc-dhcpcd-examples	share
+./usr/share/examples/dhcpcd/hooks/29-lookup-hostname	misc-dhcpcd-examples	share
+./usr/share/examples/dhcpcd/hooks/50-ypbind	misc-dhcpcd-examples	share
 ./usr/share/examples/disktab/disktab		misc-sys-examples	share
 ./usr/share/examples/emul/linux/etc/LINUX_MAKEDEV	misc-sys-examples	share
 ./usr/share/examples/emul/svr4/etc/SVR4_MAKEDEV	misc-sys-examples	share

Index: src/etc/mtree/NetBSD.dist.base
diff -u src/etc/mtree/NetBSD.dist.base:1.150 src/etc/mtree/NetBSD.dist.base:1.151
--- src/etc/mtree/NetBSD.dist.base:1.150	Mon Nov 23 19:56:47 2015
+++ src/etc/mtree/NetBSD.dist.base	Thu Jan  7 22:07:18 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist.base,v 1.150 2015/11/23 19:56:47 christos Exp $
+#	$NetBSD: NetBSD.dist.base,v 1.151 2016/01/07 22:07:18 roy Exp $
 #	@(#)4.4BSD.dist	8.1 (Berkeley) 6/13/93
 
 # Do not customize this file as it may be overwritten on upgrades.
@@ -350,6 +350,8 @@
 ./usr/share/examples/atf
 ./usr/share/examples/blacklist
 ./usr/share/examples/dhcp
+./usr/share/examples/dhcpcd
+./usr/share/examples/dhcpcd/hooks
 ./usr/share/examples/disktab
 ./usr/share/examples/emul
 ./usr/share/examples/emul/linux

Index: 

CVS commit: src/sys/rump/kern/lib/libtty

2016-01-07 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Jan  7 21:09:01 UTC 2016

Modified Files:
src/sys/rump/kern/lib/libtty: tty_component.c

Log Message:
Initialize non-VFS parts of tty subsystem already at RUMP_COMPONENT_KERN.

That way components under RUMP__FACTION_DEV can call tty routines.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/rump/kern/lib/libtty/tty_component.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/rump/kern/lib/libtty/tty_component.c
diff -u src/sys/rump/kern/lib/libtty/tty_component.c:1.2 src/sys/rump/kern/lib/libtty/tty_component.c:1.3
--- src/sys/rump/kern/lib/libtty/tty_component.c:1.2	Thu Aug 20 11:59:16 2015
+++ src/sys/rump/kern/lib/libtty/tty_component.c	Thu Jan  7 21:09:01 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: tty_component.c,v 1.2 2015/08/20 11:59:16 christos Exp $	*/
+/*	$NetBSD: tty_component.c,v 1.3 2016/01/07 21:09:01 pooka Exp $	*/
 
 /*
  * Copyright (c) 2010 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tty_component.c,v 1.2 2015/08/20 11:59:16 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tty_component.c,v 1.3 2016/01/07 21:09:01 pooka Exp $");
 
 #include 
 #include 
@@ -38,6 +38,15 @@ __KERNEL_RCSID(0, "$NetBSD: tty_componen
 
 #include "ioconf.h"
 
+RUMP_COMPONENT(RUMP_COMPONENT_KERN)
+{
+
+	tty_init();
+	ttyldisc_init();
+
+	rump_ttycomponent = true;
+}
+
 RUMP_COMPONENT(RUMP_COMPONENT_KERN_VFS)
 {
 	extern const struct cdevsw ctty_cdevsw, ptc_cdevsw, pts_cdevsw;
@@ -64,10 +73,5 @@ RUMP_COMPONENT(RUMP_COMPONENT_KERN_VFS)
 	FLAWLESSCALL(rump_vfs_makeonedevnode(S_IFCHR, "/dev/ptmx", cmaj, 0));
 	FLAWLESSCALL(rump_vfs_makeonedevnode(S_IFCHR, "/dev/ptm", cmaj, 1));
 
-	tty_init();
-	ttyldisc_init();
-
 	ptyattach(1);
-
-	rump_ttycomponent = true;
 }



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

2016-01-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan  7 21:11:54 UTC 2016

Modified Files:
src/external/bsd/mdocml/dist: read.c

Log Message:
Revert part of previous; fd is closed by readfd...


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/external/bsd/mdocml/dist/read.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/mdocml/dist/read.c
diff -u src/external/bsd/mdocml/dist/read.c:1.14 src/external/bsd/mdocml/dist/read.c:1.15
--- src/external/bsd/mdocml/dist/read.c:1.14	Thu Jan  7 15:11:57 2016
+++ src/external/bsd/mdocml/dist/read.c	Thu Jan  7 16:11:54 2016
@@ -1,4 +1,4 @@
-/*	$Id: read.c,v 1.14 2016/01/07 20:11:57 christos Exp $ */
+/*	$Id: read.c,v 1.15 2016/01/07 21:11:54 christos Exp $ */
 /*
  * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons 
  * Copyright (c) 2010-2015 Ingo Schwarze 
@@ -613,8 +613,6 @@ rerun:
 
 out:
 	free(ln.buf);
-	if (fd != -1)
-		close(fd);
 }
 
 static int



CVS commit: src/sys/rump/include/opt

2016-01-07 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Jan  7 21:04:27 UTC 2016

Modified Files:
src/sys/rump/include/opt: opt_rumpkernel.h

Log Message:
use WSEMUL_NO_DUMB and WSEMUL_VT100


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/rump/include/opt/opt_rumpkernel.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/rump/include/opt/opt_rumpkernel.h
diff -u src/sys/rump/include/opt/opt_rumpkernel.h:1.3 src/sys/rump/include/opt/opt_rumpkernel.h:1.4
--- src/sys/rump/include/opt/opt_rumpkernel.h:1.3	Mon Aug 24 22:52:15 2015
+++ src/sys/rump/include/opt/opt_rumpkernel.h	Thu Jan  7 21:04:27 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: opt_rumpkernel.h,v 1.3 2015/08/24 22:52:15 pooka Exp $	*/
+/*	$NetBSD: opt_rumpkernel.h,v 1.4 2016/01/07 21:04:27 pooka Exp $	*/
 
 #ifndef __NetBSD__
 #define __NetBSD__
@@ -26,3 +26,6 @@
 
 #undef PIPE_SOCKETPAIR /* would need uipc_usrreq.c */
 #define PIPE_NODIRECT
+
+#define WSEMUL_NO_DUMB
+#define WSEMUL_VT100



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

2016-01-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan  7 22:47:49 UTC 2016

Modified Files:
src/external/bsd/mdocml/dist: eqn.c

Log Message:
fix typo


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/mdocml/dist/eqn.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/mdocml/dist/eqn.c
diff -u src/external/bsd/mdocml/dist/eqn.c:1.3 src/external/bsd/mdocml/dist/eqn.c:1.4
--- src/external/bsd/mdocml/dist/eqn.c:1.3	Thu Jan  7 15:06:44 2016
+++ src/external/bsd/mdocml/dist/eqn.c	Thu Jan  7 17:47:49 2016
@@ -1,4 +1,4 @@
-/*	$Id: eqn.c,v 1.3 2016/01/07 20:06:44 christos Exp $ */
+/*	$Id: eqn.c,v 1.4 2016/01/07 22:47:49 christos Exp $ */
 /*
  * Copyright (c) 2011, 2014 Kristaps Dzonsons 
  * Copyright (c) 2014, 2015 Ingo Schwarze 
@@ -992,7 +992,7 @@ this_tok:
 		 parent->type == EQN_MATRIX))
 			parent = parent->parent;
 		/* Close out any "singleton" lists. */
-		while (parrent && parent->type == EQN_LISTONE &&
+		while (parent && parent->type == EQN_LISTONE &&
 		parent->args == parent->expectargs)
 			parent = parent->parent;
 		break;