CVS commit: src/sys/net

2018-04-24 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Wed Apr 25 03:49:57 UTC 2018

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

Log Message:
Fix a deadlock (rt_free vs. route_intr on rt_so_mtx)

It occurs only if NET_MPSAFE is enabled.


To generate a diff of this commit:
cvs rdiff -u -r1.240 -r1.241 src/sys/net/rtsock.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/rtsock.c
diff -u src/sys/net/rtsock.c:1.240 src/sys/net/rtsock.c:1.241
--- src/sys/net/rtsock.c:1.240	Thu Apr 12 04:38:13 2018
+++ src/sys/net/rtsock.c	Wed Apr 25 03:49:57 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtsock.c,v 1.240 2018/04/12 04:38:13 ozaki-r Exp $	*/
+/*	$NetBSD: rtsock.c,v 1.241 2018/04/25 03:49:57 ozaki-r Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.240 2018/04/12 04:38:13 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.241 2018/04/25 03:49:57 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -928,9 +928,19 @@ flush:
 	if (old_rtm != NULL)
 		Free(old_rtm);
 	if (rt) {
-		if (do_rt_free)
+		if (do_rt_free) {
+#ifdef NET_MPSAFE
+			/*
+			 * Release rt_so_mtx to avoid a deadlock with
+			 * route_intr.
+			 */
+			mutex_exit(rt_so_mtx);
 			rt_free(rt);
-		else
+			mutex_enter(rt_so_mtx);
+#else
+			rt_free(rt);
+#endif
+		} else
 			rt_unref(rt);
 	}
 {



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

2018-04-24 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Wed Apr 25 03:45:21 UTC 2018

Modified Files:
src/sys/external/bsd/acpica/dist/utilities: uttrack.c

Log Message:
Remove a unnecessary wrong cast (fix build of ALL)


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 \
src/sys/external/bsd/acpica/dist/utilities/uttrack.c

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

Modified files:

Index: src/sys/external/bsd/acpica/dist/utilities/uttrack.c
diff -u src/sys/external/bsd/acpica/dist/utilities/uttrack.c:1.15 src/sys/external/bsd/acpica/dist/utilities/uttrack.c:1.16
--- src/sys/external/bsd/acpica/dist/utilities/uttrack.c:1.15	Sat Apr  7 15:49:52 2018
+++ src/sys/external/bsd/acpica/dist/utilities/uttrack.c	Wed Apr 25 03:45:21 2018
@@ -449,7 +449,7 @@ AcpiUtTrackAllocation (
 Allocation->Component = Component;
 Allocation->Line = Line;
 
-AcpiUtSafeStrncpy (Allocation->Module, (char *) Module, ACPI_MAX_MODULE_NAME);
+AcpiUtSafeStrncpy (Allocation->Module, Module, ACPI_MAX_MODULE_NAME);
 
 if (!Element)
 {



CVS commit: src/share/mk

2018-04-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr 24 23:29:13 UTC 2018

Modified Files:
src/share/mk: bsd.own.mk

Log Message:
PR/53209: David Shao: lang/llvm BFD (NetBSD Binutils nb1) 2.30 assertion fail 
elflink.c:2824
switch x86 back to old binutils until it is fixed.
(also non pie binaries have broken relocs)


To generate a diff of this commit:
cvs rdiff -u -r1.1057 -r1.1058 src/share/mk/bsd.own.mk

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

Modified files:

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.1057 src/share/mk/bsd.own.mk:1.1058
--- src/share/mk/bsd.own.mk:1.1057	Sun Apr 15 16:08:13 2018
+++ src/share/mk/bsd.own.mk	Tue Apr 24 19:29:13 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1057 2018/04/15 20:08:13 christos Exp $
+#	$NetBSD: bsd.own.mk,v 1.1058 2018/04/24 23:29:13 christos Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -162,12 +162,7 @@ EXTERNAL_GDB_SUBDIR=		/does/not/exist
 #
 # What binutils is used?
 #
-.if ${MACHINE_ARCH} == "x86_64" || \
-${MACHINE_ARCH} == "i386"
-HAVE_BINUTILS?=	230
-.else
 HAVE_BINUTILS?=	227
-.endif
 
 .if ${HAVE_BINUTILS} == 230
 EXTERNAL_BINUTILS_SUBDIR=	binutils



CVS commit: src/share/man/man4

2018-04-24 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Tue Apr 24 18:35:56 UTC 2018

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

Log Message:
Denote RTS525A, bump date


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/share/man/man4/rtsx.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/rtsx.4
diff -u src/share/man/man4/rtsx.4:1.4 src/share/man/man4/rtsx.4:1.5
--- src/share/man/man4/rtsx.4:1.4	Wed Oct 29 14:33:23 2014
+++ src/share/man/man4/rtsx.4	Tue Apr 24 18:35:56 2018
@@ -1,10 +1,10 @@
-.\"	$NetBSD: rtsx.4,v 1.4 2014/10/29 14:33:23 nonaka Exp $
+.\"	$NetBSD: rtsx.4,v 1.5 2018/04/24 18:35:56 maya Exp $
 .\"	$OpenBSD: rtsx.4,v 1.6 2014/05/18 10:52:17 stsp Exp $
 .\"
 .\" Theo de Raadt, 2006. Public Domain.
 .\" Stefan Sperling, 2012. Public Domain.
 .\"
-.Dd October 29, 2014
+.Dd April 24, 2018
 .Dt RTSX 4
 .Os
 .Sh NAME
@@ -17,7 +17,7 @@
 The
 .Nm
 driver provides support for the Realtek RTS5209, RTS5227, RTS5229,
-RTL8402, RTL8411 and RTL8411B SD card readers.
+RTS525A, RTL8402, RTL8411 and RTL8411B SD card readers.
 .Pp
 The
 .Xr sdmmc 4



CVS commit: src/sys/dev

2018-04-24 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Tue Apr 24 18:34:30 UTC 2018

Modified Files:
src/sys/dev/ic: rtsx.c rtsxreg.h rtsxvar.h
src/sys/dev/pci: rtsx_pci.c

Log Message:
rtsx(4): Add support for RT525A, from openbsd.

ok rkujawa


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/ic/rtsx.c src/sys/dev/ic/rtsxreg.h \
src/sys/dev/ic/rtsxvar.h
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/pci/rtsx_pci.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/ic/rtsx.c
diff -u src/sys/dev/ic/rtsx.c:1.2 src/sys/dev/ic/rtsx.c:1.3
--- src/sys/dev/ic/rtsx.c:1.2	Wed Oct 29 14:24:09 2014
+++ src/sys/dev/ic/rtsx.c	Tue Apr 24 18:34:30 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtsx.c,v 1.2 2014/10/29 14:24:09 nonaka Exp $	*/
+/*	$NetBSD: rtsx.c,v 1.3 2018/04/24 18:34:30 maya Exp $	*/
 /*	$OpenBSD: rtsx.c,v 1.10 2014/08/19 17:55:03 phessler Exp $	*/
 
 /*
@@ -23,7 +23,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rtsx.c,v 1.2 2014/10/29 14:24:09 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtsx.c,v 1.3 2018/04/24 18:34:30 maya Exp $");
 
 #include 
 #include 
@@ -560,7 +560,9 @@ rtsx_bus_power_off(struct rtsx_softc *sc
 	disable3 = RTSX_PULL_CTL_DISABLE3;
 	if (RTSX_IS_RTS5209(sc))
 		RTSX_SET(sc, RTSX_PWR_GATE_CTRL, RTSX_LDO3318_OFF);
-	else if (RTSX_IS_RTS5227(sc) || RTSX_IS_RTS5229(sc)) {
+	else if (RTSX_IS_RTS5227(sc)
+		|| RTSX_IS_RTS5229(sc)
+		|| RTSX_IS_RTS525A(sc)) {
 		RTSX_CLR(sc, RTSX_PWR_GATE_CTRL, RTSX_LDO3318_VCC1 |
 		RTSX_LDO3318_VCC2);
 		if (RTSX_IS_RTS5229_TYPE_C(sc))
@@ -578,7 +580,10 @@ rtsx_bus_power_off(struct rtsx_softc *sc
 	RTSX_CLR(sc, RTSX_CARD_PWR_CTL, RTSX_PMOS_STRG_800mA);
 
 	/* Disable pull control. */
-	if (RTSX_IS_RTS5209(sc) || RTSX_IS_RTS5227(sc) || RTSX_IS_RTS5229(sc)) {
+	if (RTSX_IS_RTS5209(sc)
+	|| RTSX_IS_RTS5227(sc)
+	|| RTSX_IS_RTS5229(sc)
+	|| RTSX_IS_RTS525A(sc)) {
 		RTSX_WRITE(sc, RTSX_CARD_PULL_CTL1, RTSX_PULL_CTL_DISABLE12);
 		RTSX_WRITE(sc, RTSX_CARD_PULL_CTL2, RTSX_PULL_CTL_DISABLE12);
 		RTSX_WRITE(sc, RTSX_CARD_PULL_CTL3, disable3);
@@ -612,13 +617,23 @@ rtsx_bus_power_on(struct rtsx_softc *sc)
 {
 	uint8_t enable3;
 
+	if (RTSX_IS_RTS525A(sc)) {
+		int err = rtsx_write(sc, RTSX_LDO_VCC_CFG1, RTSX_LDO_VCC_TUNE_MASK,
+		RTSX_LDO_VCC_3V3);
+		if (err)
+			return err;
+	}
+
 	/* Select SD card. */
 	RTSX_WRITE(sc, RTSX_CARD_SELECT, RTSX_SD_MOD_SEL);
 	RTSX_WRITE(sc, RTSX_CARD_SHARE_MODE, RTSX_CARD_SHARE_48_SD);
 	RTSX_SET(sc, RTSX_CARD_CLK_EN, RTSX_SD_CLK_EN);
 
 	/* Enable pull control. */
-	if (RTSX_IS_RTS5209(sc) || RTSX_IS_RTS5227(sc) || RTSX_IS_RTS5229(sc)) {
+	if (RTSX_IS_RTS5209(sc)
+	|| RTSX_IS_RTS5227(sc)
+	|| RTSX_IS_RTS5229(sc)
+	|| RTSX_IS_RTS525A(sc)) {
 		RTSX_WRITE(sc, RTSX_CARD_PULL_CTL1, RTSX_PULL_CTL_ENABLE12);
 		RTSX_WRITE(sc, RTSX_CARD_PULL_CTL2, RTSX_PULL_CTL_ENABLE12);
 		if (RTSX_IS_RTS5229_TYPE_C(sc))
@@ -653,7 +668,10 @@ rtsx_bus_power_on(struct rtsx_softc *sc)
 	 * delay in between.
 	 */
 
-	if (RTSX_IS_RTS5209(sc) || RTSX_IS_RTS5227(sc) || RTSX_IS_RTS5229(sc)) {
+	if (RTSX_IS_RTS5209(sc)
+	|| RTSX_IS_RTS5227(sc)
+	|| RTSX_IS_RTS5229(sc)
+	|| RTSX_IS_RTS525A(sc)) {
 		/* Partial power. */
 		RTSX_SET(sc, RTSX_CARD_PWR_CTL, RTSX_SD_PARTIAL_PWR_ON);
 		if (RTSX_IS_RTS5209(sc))
Index: src/sys/dev/ic/rtsxreg.h
diff -u src/sys/dev/ic/rtsxreg.h:1.2 src/sys/dev/ic/rtsxreg.h:1.3
--- src/sys/dev/ic/rtsxreg.h:1.2	Wed Oct 29 14:24:09 2014
+++ src/sys/dev/ic/rtsxreg.h	Tue Apr 24 18:34:30 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtsxreg.h,v 1.2 2014/10/29 14:24:09 nonaka Exp $	*/
+/*	$NetBSD: rtsxreg.h,v 1.3 2018/04/24 18:34:30 maya Exp $	*/
 /*	$OpenBSD: rtsxreg.h,v 1.3 2013/11/26 20:33:16 deraadt Exp $	*/
 
 /*
@@ -544,6 +544,14 @@
 
 #define	RTSX_DUMMY_REG		0xFE90
 
+#define	RTSX_LDO_VCC_CFG1	0xFF73
+#define	RTSX_LDO_VCC_REF_TUNE_MASK	0x30
+#define	RTSX_LDO_VCC_REF_1V2		0x20
+#define	RTSX_LDO_VCC_TUNE_MASK		0x07
+#define	RTSX_LDO_VCC_1V8		0x04
+#define	RTSX_LDO_VCC_3V3		0x07
+#define	RTSX_LDO_VCC_LMT_EN		0x08
+
 #define	RTSX_SG_INT		0x04
 #define	RTSX_SG_END		0x02
 #define	RTSX_SG_VALID		0x01
Index: src/sys/dev/ic/rtsxvar.h
diff -u src/sys/dev/ic/rtsxvar.h:1.2 src/sys/dev/ic/rtsxvar.h:1.3
--- src/sys/dev/ic/rtsxvar.h:1.2	Wed Oct 29 14:24:09 2014
+++ src/sys/dev/ic/rtsxvar.h	Tue Apr 24 18:34:30 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtsxvar.h,v 1.2 2014/10/29 14:24:09 nonaka Exp $	*/
+/*	$NetBSD: rtsxvar.h,v 1.3 2018/04/24 18:34:30 maya Exp $	*/
 /*	$OpenBSD: rtsxvar.h,v 1.3 2014/08/19 17:55:03 phessler Exp $	*/
 
 /*
@@ -57,10 +57,11 @@ struct rtsx_softc {
 #define	RTSX_F_5227		__BIT(3)
 #define	RTSX_F_5229		__BIT(4)
 #define	RTSX_F_5229_TYPE_C	__BIT(5)
-#define	RTSX_F_8402		__BIT(6)
-#define	RTSX_F_8411		__BIT(7)
-#define	RTSX_F_8411B		__BIT(8)
-#define	RTSX_F_8411B_QFN48	__BIT(9)
+#define	RTSX_F_525A		__BIT(6)
+#define	RTSX_F_8402		__BIT(7)
+#define	RTSX_F_8411		__BIT(8)
+#defi

CVS commit: src/sys/kern

2018-04-24 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Tue Apr 24 18:34:46 UTC 2018

Modified Files:
src/sys/kern: kern_sig.c

Log Message:
Remove unused code branch in the signal code

Remove the ppsig argument from proc_stop_done() and from sigswitch().

This functionality was used in now gone filesystem tracing feature (/proc).
It prevented emitting signal child signals to a debugging program, namely
with the SIGCHLD signal.

The modern solution to perform tracing without signals in a debugger is
to spawn a debugging server and outsource the tracing functionality to it.
This is done in software like gdb-server, lldb-server etc.

No functional change intended.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.339 -r1.340 src/sys/kern/kern_sig.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_sig.c
diff -u src/sys/kern/kern_sig.c:1.339 src/sys/kern/kern_sig.c:1.340
--- src/sys/kern/kern_sig.c:1.339	Thu Dec  7 19:49:43 2017
+++ src/sys/kern/kern_sig.c	Tue Apr 24 18:34:46 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_sig.c,v 1.339 2017/12/07 19:49:43 christos Exp $	*/
+/*	$NetBSD: kern_sig.c,v 1.340 2018/04/24 18:34:46 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.339 2017/12/07 19:49:43 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.340 2018/04/24 18:34:46 kamil Exp $");
 
 #include "opt_ptrace.h"
 #include "opt_dtrace.h"
@@ -123,7 +123,7 @@ static int	sigchecktrace(void);
 static int	sigpost(struct lwp *, sig_t, int, int);
 static int	sigput(sigpend_t *, struct proc *, ksiginfo_t *);
 static int	sigunwait(struct proc *, const ksiginfo_t *);
-static void	sigswitch(bool, int, int);
+static void	sigswitch(int, int);
 
 static void	sigacts_poolpage_free(struct pool *, void *);
 static void	*sigacts_poolpage_alloc(struct pool *, int);
@@ -1506,7 +1506,7 @@ proc_stop_lwps(struct proc *p)
  * Drop p_lock briefly if PS_NOTIFYSTOP is set and ppsig is true.
  */
 static void
-proc_stop_done(struct proc *p, bool ppsig, int ppmask)
+proc_stop_done(struct proc *p, int ppmask)
 {
 
 	KASSERT(mutex_owned(proc_lock));
@@ -1519,10 +1519,8 @@ proc_stop_done(struct proc *p, bool ppsi
 	p->p_waited = 0;
 	p->p_pptr->p_nstopchild++;
 	if ((p->p_sflag & PS_NOTIFYSTOP) != 0) {
-		if (ppsig) {
-			/* child_psignal drops p_lock briefly. */
-			child_psignal(p, ppmask);
-		}
+		/* child_psignal drops p_lock briefly. */
+		child_psignal(p, ppmask);
 		cv_broadcast(&p->p_pptr->p_waitcv);
 	}
 }
@@ -1531,7 +1529,7 @@ proc_stop_done(struct proc *p, bool ppsi
  * Stop the current process and switch away when being stopped or traced.
  */
 static void
-sigswitch(bool ppsig, int ppmask, int signo)
+sigswitch(int ppmask, int signo)
 {
 	struct lwp *l = curlwp;
 	struct proc *p = l->l_proc;
@@ -1568,7 +1566,7 @@ sigswitch(bool ppsig, int ppmask, int si
 			 * Note that proc_stop_done() can drop
 			 * p->p_lock briefly.
 			 */
-			proc_stop_done(p, ppsig, ppmask);
+			proc_stop_done(p, ppmask);
 		}
 
 		mutex_exit(proc_lock);
@@ -1667,7 +1665,7 @@ issignal(struct lwp *l)
 		 * we awaken, check for a signal from the debugger.
 		 */
 		if (p->p_stat == SSTOP || (p->p_sflag & PS_STOPPING) != 0) {
-			sigswitch(true, PS_NOCLDSTOP, 0);
+			sigswitch(PS_NOCLDSTOP, 0);
 			signo = sigchecktrace();
 		} else
 			signo = 0;
@@ -1737,7 +1735,7 @@ issignal(struct lwp *l)
 			/* Emulation-specific handling of signal trace */
 			if (p->p_emul->e_tracesig == NULL ||
 			(*p->p_emul->e_tracesig)(p, signo) == 0)
-sigswitch(1, 0, signo);
+sigswitch(0, signo);
 
 			/* Check for a signal from the debugger. */
 			if ((signo = sigchecktrace()) == 0)
@@ -1791,7 +1789,7 @@ issignal(struct lwp *l)
 p->p_xsig = signo;
 p->p_sflag &= ~PS_CONTINUED;
 signo = 0;
-sigswitch(true, PS_NOCLDSTOP, p->p_xsig);
+sigswitch(PS_NOCLDSTOP, p->p_xsig);
 			} else if (prop & SA_IGNORE) {
 /*
  * Except for SIGCONT, shouldn't get here.
@@ -2134,7 +2132,7 @@ proc_stop(struct proc *p, int signo)
 	 */
 
 	if (p->p_nrlwps == 0) {
-		proc_stop_done(p, true, PS_NOCLDSTOP);
+		proc_stop_done(p, PS_NOCLDSTOP);
 	} else {
 		/*
 		 * Have the remaining LWPs come to a halt, and trigger
@@ -2206,7 +2204,7 @@ proc_stop_callout(void *cookie)
 	 */
 	restart = true;
 }
-proc_stop_done(p, true, PS_NOCLDSTOP);
+proc_stop_done(p, PS_NOCLDSTOP);
 			} else
 more = true;
 
@@ -2283,7 +2281,7 @@ proc_stoptrace(int trapno)
 	p->p_xsig = SIGTRAP;
 	p->p_sigctx.ps_info._signo = p->p_xsig;
 	p->p_sigctx.ps_info._code = trapno;
-	sigswitch(true, 0, p->p_xsig);
+	sigswitch(0, p->p_xsig);
 	mutex_exit(p->p_lock);
 }
 



CVS commit: src/usr.sbin/rtadvd

2018-04-24 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Tue Apr 24 18:31:48 UTC 2018

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

Log Message:
Back out part of the prior commit where we added space for IPV6_HOPLIMIT
to the sending control message buffer.
That code never worked on ERLITE, so I elected to set socket options
instead but forgot to revert this part.


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/usr.sbin/rtadvd/rtadvd.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/rtadvd/rtadvd.c
diff -u src/usr.sbin/rtadvd/rtadvd.c:1.65 src/usr.sbin/rtadvd/rtadvd.c:1.66
--- src/usr.sbin/rtadvd/rtadvd.c:1.65	Fri Apr 20 15:57:23 2018
+++ src/usr.sbin/rtadvd/rtadvd.c	Tue Apr 24 18:31:48 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtadvd.c,v 1.65 2018/04/20 15:57:23 roy Exp $	*/
+/*	$NetBSD: rtadvd.c,v 1.66 2018/04/24 18:31:48 roy Exp $	*/
 /*	$KAME: rtadvd.c,v 1.92 2005/10/17 14:40:02 suz Exp $	*/
 
 /*
@@ -1514,8 +1514,7 @@ sock_open(void)
 		exit(EXIT_FAILURE);
 	}
 
-	sndcmsgbuflen = CMSG_SPACE(sizeof(struct in6_pktinfo)) +
-CMSG_SPACE(sizeof(int));
+	sndcmsgbuflen = CMSG_SPACE(sizeof(struct in6_pktinfo));
 	sndcmsgbuf = malloc(sndcmsgbuflen);
 	if (sndcmsgbuf == NULL) {
 		logit(LOG_ERR, "%s: malloc: %m", __func__);



CVS commit: src/sys/dev/pci

2018-04-24 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Tue Apr 24 18:10:33 UTC 2018

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

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.1321 -r1.1322 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1320 -r1.1321 src/sys/dev/pci/pcidevs_data.h

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

Modified files:

Index: src/sys/dev/pci/pcidevs.h
diff -u src/sys/dev/pci/pcidevs.h:1.1321 src/sys/dev/pci/pcidevs.h:1.1322
--- src/sys/dev/pci/pcidevs.h:1.1321	Tue Apr 17 08:47:43 2018
+++ src/sys/dev/pci/pcidevs.h	Tue Apr 24 18:10:32 2018
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs.h,v 1.1321 2018/04/17 08:47:43 nonaka Exp $	*/
+/*	$NetBSD: pcidevs.h,v 1.1322 2018/04/24 18:10:32 maya Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.1330 2018/04/17 08:47:19 nonaka Exp
+ *	NetBSD: pcidevs,v 1.1331 2018/04/24 18:08:56 maya Exp
  */
 
 /*
@@ -6515,6 +6515,7 @@
 #define	PCI_PRODUCT_REALTEK_RTS5227	0x5227		/* RTS5227 PCI-E Card Reader */
 #define	PCI_PRODUCT_REALTEK_RTS5229	0x5229		/* RTS5229 PCI-E Card Reader */
 #define	PCI_PRODUCT_REALTEK_RTS5249	0x5249		/* RTS5249 PCI-E Card Reader */
+#define	PCI_PRODUCT_REALTEK_RTS525A	0x525A		/* RTS525A PCI-E Card Reader */
 #define	PCI_PRODUCT_REALTEK_RTL8402	0x5286		/* RTL8402 PCI-E Card Reader */
 #define	PCI_PRODUCT_REALTEK_RTL8411B	0x5287		/* RTL8411B PCI-E Card Reader */
 #define	PCI_PRODUCT_REALTEK_RTL8411	0x5289		/* RTL8411 PCI-E Card Reader */

Index: src/sys/dev/pci/pcidevs_data.h
diff -u src/sys/dev/pci/pcidevs_data.h:1.1320 src/sys/dev/pci/pcidevs_data.h:1.1321
--- src/sys/dev/pci/pcidevs_data.h:1.1320	Tue Apr 17 08:47:43 2018
+++ src/sys/dev/pci/pcidevs_data.h	Tue Apr 24 18:10:32 2018
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs_data.h,v 1.1320 2018/04/17 08:47:43 nonaka Exp $	*/
+/*	$NetBSD: pcidevs_data.h,v 1.1321 2018/04/24 18:10:32 maya Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.1330 2018/04/17 08:47:19 nonaka Exp
+ *	NetBSD: pcidevs,v 1.1331 2018/04/24 18:08:56 maya Exp
  */
 
 /*
@@ -11404,436 +11404,438 @@ static const uint16_t pci_products[] = {
 	29702, 16780, 11239, 15387, 0,
 	PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RTS5249, 
 	29710, 16780, 11239, 15387, 0,
-	PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RTL8402, 
+	PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RTS525A, 
 	29718, 16780, 11239, 15387, 0,
-	PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RTL8411B, 
+	PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RTL8402, 
 	29726, 16780, 11239, 15387, 0,
+	PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RTL8411B, 
+	29734, 16780, 11239, 15387, 0,
 	PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RTL8411, 
-	29735, 16780, 11239, 15387, 0,
+	29743, 16780, 11239, 15387, 0,
 	PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RT8029, 
-	29743, 5603, 0,
+	29751, 5603, 0,
 	PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RT8139D, 
-	29748, 5705, 5603, 0,
+	29756, 5705, 5603, 0,
 	PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RT8100, 
-	29754, 5705, 5603, 0,
+	29762, 5705, 5603, 0,
 	PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RT8129, 
-	29759, 5705, 5603, 0,
+	29767, 5705, 5603, 0,
 	PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RT8101E, 
-	29764, 5705, 5603, 0,
+	29772, 5705, 5603, 0,
 	PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RT8138, 
-	29782, 5705, 5603, 0,
+	29790, 5705, 5603, 0,
 	PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RT8139, 
 	7475, 5705, 5603, 0,
 	PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RT8169SC, 
-	29787, 5618, 5603, 0,
+	29795, 5618, 5603, 0,
 	PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RT8168, 
-	29801, 5618, 5603, 0,
+	29809, 5618, 5603, 0,
 	PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RT8169, 
-	29811, 5618, 5603, 0,
+	29819, 5618, 5603, 0,
 	PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RTL8188CE, 
-	29821, 4759, 4534, 29831, 16780, 17315, 0,
+	29829, 4759, 4534, 29839, 16780, 17315, 0,
 	PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RTL8192CE, 
-	29839, 4759, 4534, 29831, 16780, 17315, 0,
+	29847, 4759, 4534, 29839, 16780, 17315, 0,
 	PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RTL8188EE, 
-	29849, 4759, 4534, 29831, 16780, 17315, 0,
+	29857, 4759, 4534, 29839, 16780, 17315, 0,
 	PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RT8180, 
-	29859, 7562, 0,
+	29867, 7562, 0,
 	PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RT8185, 
-	29864, 29869, 0,
+	29872, 29877, 0,
 	PCI_VENDOR_REDHAT, PCI_PRODUCT_REDHAT_PPB, 
-	29881, 8258, 0,
+	29889, 8258, 0,
 	PCI_VENDOR_REDHAT, PCI_PRODUCT_REDHAT_QXL, 
-	29886, 234, 0,
+	29894, 234, 0,
 	PCI_VENDOR_RENESAS, PCI_PRODUCT_RENESAS_SH7780, 
-	29890, 615, 6341, 0,
+	29898, 615, 6341, 0,
 

CVS commit: src/sys/dev/pci

2018-04-24 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Tue Apr 24 18:08:56 UTC 2018

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

Log Message:
add realtek RT525A PCI-E card reader

found in my Dell XPS 15 9550.


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

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

Modified files:

Index: src/sys/dev/pci/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1330 src/sys/dev/pci/pcidevs:1.1331
--- src/sys/dev/pci/pcidevs:1.1330	Tue Apr 17 08:47:19 2018
+++ src/sys/dev/pci/pcidevs	Tue Apr 24 18:08:56 2018
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1330 2018/04/17 08:47:19 nonaka Exp $
+$NetBSD: pcidevs,v 1.1331 2018/04/24 18:08:56 maya Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -6508,6 +6508,7 @@ product REALTEK RTS5209		0x5209	RTS5209 
 product REALTEK RTS5227		0x5227	RTS5227 PCI-E Card Reader
 product REALTEK RTS5229		0x5229	RTS5229 PCI-E Card Reader
 product REALTEK RTS5249		0x5249	RTS5249 PCI-E Card Reader
+product REALTEK RTS525A		0x525A	RTS525A PCI-E Card Reader
 product REALTEK RTL8402		0x5286	RTL8402 PCI-E Card Reader
 product REALTEK RTL8411B	0x5287	RTL8411B PCI-E Card Reader
 product REALTEK RTL8411		0x5289	RTL8411 PCI-E Card Reader



CVS commit: src/sys/uvm

2018-04-24 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Tue Apr 24 16:35:53 UTC 2018

Modified Files:
src/sys/uvm: uvm_page.c

Log Message:
In uvm_page_recolor(), kmem_free() old size rather than new size.

>From Yaniv Abraham-Rabinovitch in PR kern/53208.


To generate a diff of this commit:
cvs rdiff -u -r1.195 -r1.196 src/sys/uvm/uvm_page.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/uvm/uvm_page.c
diff -u src/sys/uvm/uvm_page.c:1.195 src/sys/uvm/uvm_page.c:1.196
--- src/sys/uvm/uvm_page.c:1.195	Sat Dec  2 08:15:43 2017
+++ src/sys/uvm/uvm_page.c	Tue Apr 24 16:35:53 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_page.c,v 1.195 2017/12/02 08:15:43 mrg Exp $	*/
+/*	$NetBSD: uvm_page.c,v 1.196 2018/04/24 16:35:53 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.195 2017/12/02 08:15:43 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.196 2018/04/24 16:35:53 jakllsch Exp $");
 
 #include "opt_ddb.h"
 #include "opt_uvm.h"
@@ -769,7 +769,7 @@ uvm_page_recolor(int newncolors)
 	mutex_spin_exit(&uvm_fpageqlock);
 
 	if (oldbucketmemsize) {
-		kmem_free(oldbucketarray, recolored_pages_memsize);
+		kmem_free(oldbucketarray, oldbucketmemsize);
 	}
 
 	/*



CVS commit: src/sys/netinet6

2018-04-24 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Apr 24 08:22:17 UTC 2018

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

Log Message:
Remove nullcheck, m is not allowed to be null.


To generate a diff of this commit:
cvs rdiff -u -r1.139 -r1.140 src/sys/netinet6/nd6_rtr.c

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

Modified files:

Index: src/sys/netinet6/nd6_rtr.c
diff -u src/sys/netinet6/nd6_rtr.c:1.139 src/sys/netinet6/nd6_rtr.c:1.140
--- src/sys/netinet6/nd6_rtr.c:1.139	Tue Apr 24 08:07:05 2018
+++ src/sys/netinet6/nd6_rtr.c	Tue Apr 24 08:22:16 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: nd6_rtr.c,v 1.139 2018/04/24 08:07:05 maxv Exp $	*/
+/*	$NetBSD: nd6_rtr.c,v 1.140 2018/04/24 08:22:16 maxv Exp $	*/
 /*	$KAME: nd6_rtr.c,v 1.95 2001/02/07 08:09:47 itojun Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nd6_rtr.c,v 1.139 2018/04/24 08:07:05 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nd6_rtr.c,v 1.140 2018/04/24 08:22:16 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -1118,12 +1118,10 @@ prelist_update(struct nd_prefixctl *newp
 	int ss;
 	char ip6buf[INET6_ADDRSTRLEN];
 
+	KASSERT(m != NULL);
 	ND6_ASSERT_WLOCK();
 
-	auth = 0;
-	if (m) {
-		auth = (m->m_flags & M_AUTHIPHDR) ? 1 : 0;
-	}
+	auth = (m->m_flags & M_AUTHIPHDR) ? 1 : 0;
 
 	if ((pr = nd6_prefix_lookup(newprc)) != NULL) {
 		/*



CVS commit: src/sys/sys

2018-04-24 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Apr 24 08:10:32 UTC 2018

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

Log Message:
Change/Improve the comments, so that the definitions fit one line.


To generate a diff of this commit:
cvs rdiff -u -r1.188 -r1.189 src/sys/sys/mbuf.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/mbuf.h
diff -u src/sys/sys/mbuf.h:1.188 src/sys/sys/mbuf.h:1.189
--- src/sys/sys/mbuf.h:1.188	Tue Apr 24 08:07:06 2018
+++ src/sys/sys/mbuf.h	Tue Apr 24 08:10:32 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: mbuf.h,v 1.188 2018/04/24 08:07:06 maxv Exp $	*/
+/*	$NetBSD: mbuf.h,v 1.189 2018/04/24 08:10:32 maxv Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997, 1999, 2001, 2007 The NetBSD Foundation, Inc.
@@ -351,16 +351,12 @@ MBUF_DEFINE(mbuf, MHLEN, MLEN);
 #define	M_PROTO1	0x0008	/* protocol-specific */
 
 /* mbuf pkthdr flags, also in m_flags */
-#define	M_AUTHIPHDR	0x0010	/* data origin authentication for
-	 * IP header */
-#define	M_DECRYPTED	0x0020	/* confidentiality */
+#define	M_AUTHIPHDR	0x0010	/* authenticated (IPsec) */
+#define	M_DECRYPTED	0x0020	/* decrypted (IPsec) */
 #define	M_LOOP		0x0040	/* for Mbuf statistics */
-#define	M_BCAST		0x0100	/* send/received as link-level
-	 * broadcast */
-#define	M_MCAST		0x0200	/* send/received as link-level
-	 * multicast */
-#define	M_CANFASTFWD	0x0400	/* used by filters to indicate
-	 * packet can be fast-forwarded */
+#define	M_BCAST		0x0100	/* send/received as L2 broadcast */
+#define	M_MCAST		0x0200	/* send/received as L2 multicast */
+#define	M_CANFASTFWD	0x0400	/* packet can be fast-forwarded */
 #define	M_ANYCAST6	0x0800	/* received as IPv6 anycast */
 
 #define	M_LINK0		0x1000	/* link layer specific flag */



CVS commit: src/sys

2018-04-24 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Apr 24 08:07:06 UTC 2018

Modified Files:
src/sys/netinet6: nd6_rtr.c
src/sys/netipsec: xform_ah.c xform_ipip.c
src/sys/sys: mbuf.h

Log Message:
Remove the M_AUTHIPDGM flag. It is equivalent to M_AUTHIPHDR, both
are set in IPsec-AH, and they are always handled together.


To generate a diff of this commit:
cvs rdiff -u -r1.138 -r1.139 src/sys/netinet6/nd6_rtr.c
cvs rdiff -u -r1.93 -r1.94 src/sys/netipsec/xform_ah.c
cvs rdiff -u -r1.67 -r1.68 src/sys/netipsec/xform_ipip.c
cvs rdiff -u -r1.187 -r1.188 src/sys/sys/mbuf.h

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

Modified files:

Index: src/sys/netinet6/nd6_rtr.c
diff -u src/sys/netinet6/nd6_rtr.c:1.138 src/sys/netinet6/nd6_rtr.c:1.139
--- src/sys/netinet6/nd6_rtr.c:1.138	Fri Jan 26 06:49:02 2018
+++ src/sys/netinet6/nd6_rtr.c	Tue Apr 24 08:07:05 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: nd6_rtr.c,v 1.138 2018/01/26 06:49:02 ozaki-r Exp $	*/
+/*	$NetBSD: nd6_rtr.c,v 1.139 2018/04/24 08:07:05 maxv Exp $	*/
 /*	$KAME: nd6_rtr.c,v 1.95 2001/02/07 08:09:47 itojun Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nd6_rtr.c,v 1.138 2018/01/26 06:49:02 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nd6_rtr.c,v 1.139 2018/04/24 08:07:05 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -1122,14 +1122,7 @@ prelist_update(struct nd_prefixctl *newp
 
 	auth = 0;
 	if (m) {
-		/*
-		 * Authenticity for NA consists authentication for
-		 * both IP header and IP datagrams, doesn't it ?
-		 */
-#if defined(M_AUTHIPHDR) && defined(M_AUTHIPDGM)
-		auth = (m->m_flags & M_AUTHIPHDR
-		 && m->m_flags & M_AUTHIPDGM) ? 1 : 0;
-#endif
+		auth = (m->m_flags & M_AUTHIPHDR) ? 1 : 0;
 	}
 
 	if ((pr = nd6_prefix_lookup(newprc)) != NULL) {

Index: src/sys/netipsec/xform_ah.c
diff -u src/sys/netipsec/xform_ah.c:1.93 src/sys/netipsec/xform_ah.c:1.94
--- src/sys/netipsec/xform_ah.c:1.93	Mon Apr 23 07:22:54 2018
+++ src/sys/netipsec/xform_ah.c	Tue Apr 24 08:07:06 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: xform_ah.c,v 1.93 2018/04/23 07:22:54 maxv Exp $	*/
+/*	$NetBSD: xform_ah.c,v 1.94 2018/04/24 08:07:06 maxv Exp $	*/
 /*	$FreeBSD: xform_ah.c,v 1.1.4.1 2003/01/24 05:11:36 sam Exp $	*/
 /*	$OpenBSD: ip_ah.c,v 1.63 2001/06/26 06:18:58 angelos Exp $ */
 /*
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xform_ah.c,v 1.93 2018/04/23 07:22:54 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xform_ah.c,v 1.94 2018/04/24 08:07:06 maxv Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -829,7 +829,7 @@ ah_input_cb(struct cryptop *crp)
 	/*
 	 * Header is now authenticated.
 	 */
-	m->m_flags |= M_AUTHIPHDR|M_AUTHIPDGM;
+	m->m_flags |= M_AUTHIPHDR;
 
 	/*
 	 * Update replay sequence number, if appropriate.

Index: src/sys/netipsec/xform_ipip.c
diff -u src/sys/netipsec/xform_ipip.c:1.67 src/sys/netipsec/xform_ipip.c:1.68
--- src/sys/netipsec/xform_ipip.c:1.67	Sun Apr 22 10:25:40 2018
+++ src/sys/netipsec/xform_ipip.c	Tue Apr 24 08:07:06 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: xform_ipip.c,v 1.67 2018/04/22 10:25:40 maxv Exp $	*/
+/*	$NetBSD: xform_ipip.c,v 1.68 2018/04/24 08:07:06 maxv Exp $	*/
 /*	$FreeBSD: xform_ipip.c,v 1.3.2.1 2003/01/24 05:11:36 sam Exp $	*/
 /*	$OpenBSD: ip_ipip.c,v 1.25 2002/06/10 18:04:55 itojun Exp $ */
 
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xform_ipip.c,v 1.67 2018/04/22 10:25:40 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xform_ipip.c,v 1.68 2018/04/24 08:07:06 maxv Exp $");
 
 /*
  * IP-inside-IP processing
@@ -85,7 +85,7 @@ __KERNEL_RCSID(0, "$NetBSD: xform_ipip.c
 #include 
 
 /* XXX IPCOMP */
-#define	M_IPSEC	(M_AUTHIPHDR|M_AUTHIPDGM|M_DECRYPTED)
+#define	M_IPSEC	(M_AUTHIPHDR|M_DECRYPTED)
 
 int ipip_spoofcheck = 1;
 percpu_t *ipipstat_percpu;

Index: src/sys/sys/mbuf.h
diff -u src/sys/sys/mbuf.h:1.187 src/sys/sys/mbuf.h:1.188
--- src/sys/sys/mbuf.h:1.187	Sun Apr 15 17:26:39 2018
+++ src/sys/sys/mbuf.h	Tue Apr 24 08:07:06 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: mbuf.h,v 1.187 2018/04/15 17:26:39 maxv Exp $	*/
+/*	$NetBSD: mbuf.h,v 1.188 2018/04/24 08:07:06 maxv Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997, 1999, 2001, 2007 The NetBSD Foundation, Inc.
@@ -355,7 +355,6 @@ MBUF_DEFINE(mbuf, MHLEN, MLEN);
 	 * IP header */
 #define	M_DECRYPTED	0x0020	/* confidentiality */
 #define	M_LOOP		0x0040	/* for Mbuf statistics */
-#define	M_AUTHIPDGM	0x0080	/* data origin authentication */
 #define	M_BCAST		0x0100	/* send/received as link-level
 	 * broadcast */
 #define	M_MCAST		0x0200	/* send/received as link-level
@@ -387,7 +386,7 @@ MBUF_DEFINE(mbuf, MHLEN, MLEN);
 #define	M_NOTIFICATION	M_PROTO1
 
 #define M_FLAGS_BITS \
-"\20\1EXT\2PKTHDR\3EOR\4PROTO1\5AUTHIPHDR\6DECRYPTED\7LOOP\10AUTHIPDGM" \
+"\20\1EXT\2PKTHDR\3EOR\4PROTO1\5AUTHIPHDR\6DECRYPTED\7LOOP\10NONE" \
 "\11BCAST\12MCAST\13CANFASTFWD\14ANYCAST6\15LINK0

CVS commit: src

2018-04-24 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Apr 24 07:22:33 UTC 2018

Modified Files:
src/sbin/ping6: ping6.c
src/sys/netinet: icmp6.h

Log Message:
Add code 3 of paramprob, part of RFC7112: "IPv6 First Fragment has
incomplete IPv6 Header Chain". Handle this code in ping6.


To generate a diff of this commit:
cvs rdiff -u -r1.102 -r1.103 src/sbin/ping6/ping6.c
cvs rdiff -u -r1.50 -r1.51 src/sys/netinet/icmp6.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/ping6/ping6.c
diff -u src/sbin/ping6/ping6.c:1.102 src/sbin/ping6/ping6.c:1.103
--- src/sbin/ping6/ping6.c:1.102	Tue Apr 24 07:12:04 2018
+++ src/sbin/ping6/ping6.c	Tue Apr 24 07:22:32 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ping6.c,v 1.102 2018/04/24 07:12:04 maxv Exp $	*/
+/*	$NetBSD: ping6.c,v 1.103 2018/04/24 07:22:32 maxv Exp $	*/
 /*	$KAME: ping6.c,v 1.164 2002/11/16 14:05:37 itojun Exp $	*/
 
 /*
@@ -77,7 +77,7 @@ static char sccsid[] = "@(#)ping.c	8.1 (
 #else
 #include 
 #ifndef lint
-__RCSID("$NetBSD: ping6.c,v 1.102 2018/04/24 07:12:04 maxv Exp $");
+__RCSID("$NetBSD: ping6.c,v 1.103 2018/04/24 07:22:32 maxv Exp $");
 #endif
 #endif
 
@@ -2108,6 +2108,9 @@ pr_icmph(struct icmp6_hdr *icp, u_char *
 		case ICMP6_PARAMPROB_OPTION:
 			printf("Unrecognized Option ");
 			break;
+		case ICMP6_PARAMPROB_FRAGMENT:
+			printf("First Fragment Has Incomplete Chain ");
+			break;
 		default:
 			printf("Bad code(%d) ", icp->icmp6_code);
 			break;

Index: src/sys/netinet/icmp6.h
diff -u src/sys/netinet/icmp6.h:1.50 src/sys/netinet/icmp6.h:1.51
--- src/sys/netinet/icmp6.h:1.50	Tue Mar  6 10:57:00 2018
+++ src/sys/netinet/icmp6.h	Tue Apr 24 07:22:33 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: icmp6.h,v 1.50 2018/03/06 10:57:00 roy Exp $	*/
+/*	$NetBSD: icmp6.h,v 1.51 2018/04/24 07:22:33 maxv Exp $	*/
 /*	$KAME: icmp6.h,v 1.84 2003/04/23 10:26:51 itojun Exp $	*/
 
 
@@ -156,6 +156,7 @@ struct icmp6_hdr {
 #define ICMP6_PARAMPROB_HEADER 	 	0	/* erroneous header field */
 #define ICMP6_PARAMPROB_NEXTHEADER	1	/* unrecognized next header */
 #define ICMP6_PARAMPROB_OPTION		2	/* unrecognized option */
+#define ICMP6_PARAMPROB_FRAGMENT	3	/* incomplete chain in frag */
 
 #define ICMP6_INFOMSG_MASK		0x80	/* all informational messages */
 



CVS commit: src/sbin/ping6

2018-04-24 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Apr 24 07:12:04 UTC 2018

Modified Files:
src/sbin/ping6: ping6.c

Log Message:
Remove annoying (void) casts.


To generate a diff of this commit:
cvs rdiff -u -r1.101 -r1.102 src/sbin/ping6/ping6.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/ping6/ping6.c
diff -u src/sbin/ping6/ping6.c:1.101 src/sbin/ping6/ping6.c:1.102
--- src/sbin/ping6/ping6.c:1.101	Mon Apr 23 18:48:30 2018
+++ src/sbin/ping6/ping6.c	Tue Apr 24 07:12:04 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ping6.c,v 1.101 2018/04/23 18:48:30 maxv Exp $	*/
+/*	$NetBSD: ping6.c,v 1.102 2018/04/24 07:12:04 maxv Exp $	*/
 /*	$KAME: ping6.c,v 1.164 2002/11/16 14:05:37 itojun Exp $	*/
 
 /*
@@ -77,7 +77,7 @@ static char sccsid[] = "@(#)ping.c	8.1 (
 #else
 #include 
 #ifndef lint
-__RCSID("$NetBSD: ping6.c,v 1.101 2018/04/23 18:48:30 maxv Exp $");
+__RCSID("$NetBSD: ping6.c,v 1.102 2018/04/24 07:12:04 maxv Exp $");
 #endif
 #endif
 
@@ -587,7 +587,7 @@ main(int argc, char *argv[])
 	if (!res->ai_addr)
 		errx(1, "getaddrinfo failed");
 
-	(void)memcpy(&dst, res->ai_addr, res->ai_addrlen);
+	memcpy(&dst, res->ai_addr, res->ai_addrlen);
 
 	if ((s = prog_socket(res->ai_family, res->ai_socktype,
 	res->ai_protocol)) < 0)
@@ -1169,7 +1169,7 @@ pinger(void)
 	if (i < 0 || i != cc)  {
 		if (i < 0)
 			warn("sendmsg");
-		(void)printf("ping6: wrote %s %d chars, ret=%d\n",
+		printf("ping6: wrote %s %d chars, ret=%d\n",
 		hostname, cc, i);
 	}
 	if (!(options & F_QUIET) && options & F_FLOOD)
@@ -1370,9 +1370,9 @@ pr_pack(u_char *buf, int cc, struct msgh
 		if (options & F_FLOOD)
 			(void)write(STDOUT_FILENO, &BSPACE, 1);
 		else {
-			(void)printf("%d bytes from %s, icmp_seq=%u", cc,
+			printf("%d bytes from %s, icmp_seq=%u", cc,
 			pr_addr(from, fromlen), seq);
-			(void)printf(" hlim=%d", hoplim);
+			printf(" hlim=%d", hoplim);
 			if ((options & F_VERBOSE) != 0) {
 struct sockaddr_in6 dstsa;
 
@@ -1383,20 +1383,20 @@ pr_pack(u_char *buf, int cc, struct msgh
 #endif
 dstsa.sin6_scope_id = pktinfo->ipi6_ifindex;
 dstsa.sin6_addr = pktinfo->ipi6_addr;
-(void)printf(" dst=%s",
+printf(" dst=%s",
 pr_addr((struct sockaddr *)&dstsa,
 sizeof(dstsa)));
 			}
 			if (timing)
-(void)printf(" time=%.3f ms", triptime);
+printf(" time=%.3f ms", triptime);
 			if (dupflag)
-(void)printf("(DUP!)");
+printf("(DUP!)");
 			/* check the data */
 			cp = buf + off + ICMP6ECHOLEN + ICMP6ECHOTMLEN;
 			dp = outpack + ICMP6ECHOLEN + ICMP6ECHOTMLEN;
 			for (i = 8; cp < end; ++i, ++cp, ++dp) {
 if (*cp != *dp) {
-	(void)printf("\nwrong data byte #%d should be 0x%x but was 0x%x", i, *dp, *cp);
+	printf("\nwrong data byte #%d should be 0x%x but was 0x%x", i, *dp, *cp);
 	break;
 }
 			}
@@ -1417,7 +1417,7 @@ pr_pack(u_char *buf, int cc, struct msgh
 		if (options & F_QUIET)
 			return;
 
-		(void)printf("%d bytes from %s: ", cc, pr_addr(from, fromlen));
+		printf("%d bytes from %s: ", cc, pr_addr(from, fromlen));
 
 		switch (ntohs(ni->ni_code)) {
 		case ICMP6_NI_SUCCESS:
@@ -1484,15 +1484,15 @@ pr_pack(u_char *buf, int cc, struct msgh
 int32_t ttl;
 int comma = 0;
 
-(void)printf(" (");	/*)*/
+printf(" (");	/*)*/
 
 switch (ni->ni_code) {
 case ICMP6_NI_REFUSED:
-	(void)printf("refused");
+	printf("refused");
 	comma++;
 	break;
 case ICMP6_NI_UNKNOWN:
-	(void)printf("unknown qtype");
+	printf("unknown qtype");
 	comma++;
 	break;
 }
@@ -1507,14 +1507,14 @@ pr_pack(u_char *buf, int cc, struct msgh
 if (comma)
 	printf(",");
 if (!(ni->ni_flags & NI_FQDN_FLAG_VALIDTTL)) {
-	(void)printf("TTL=%d:meaningless",
+	printf("TTL=%d:meaningless",
 	(int)ttl);
 } else {
 	if (ttl < 0) {
-		(void)printf("TTL=%d:invalid",
+		printf("TTL=%d:invalid",
 		   ttl);
 	} else
-		(void)printf("TTL=%d", ttl);
+		printf("TTL=%d", ttl);
 }
 comma++;
 
@@ -1537,7 +1537,7 @@ pr_pack(u_char *buf, int cc, struct msgh
 cc - off - ICMP6_NIRLEN - 1 && oldfqdn) {
 	if (comma)
 		printf(",");
-	(void)printf("invalid namelen:%d/%lu",
+	printf("invalid namelen:%d/%lu",
 	buf[off + ICMP6_NIRLEN],
 	(u_long)cc - off - ICMP6_NIRLEN - 1);
 	comma++;
@@ -1552,7 +1552,7 @@ pr_pack(u_char *buf, int cc, struct msgh
 		/* We've got something other than an ECHOREPLY */
 		if (!(options & F_VERBOSE))
 			return;
-		(void)printf("%d bytes from %s: ", cc, pr_addr(from, fromlen));
+		printf("%d bytes from %s: ", cc, pr_addr(from, fromlen));
 		pr_icmph(icp, end);
 	}
 
@@ -1804,14 +1804,14 @@ pr_nodeaddr(struct icmp6_nodeinfo *ni, /
 	if (options & F_VERBOSE) {
 		switch (ni->ni_code) {
 		case ICMP6_NI_REFUSED:
-			(void)printf("refused");
+			printf("refused");
 			break;
 		case ICMP6_NI_UNKNOWN:
-			(v