CVS commit: src/sys/conf

2018-01-14 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Jan 15 07:20:10 UTC 2018

Modified Files:
src/sys/conf: compat_netbsd09.config compat_netbsd10.config
compat_netbsd11.config compat_netbsd12.config
compat_netbsd13.config compat_netbsd14.config
compat_netbsd15.config compat_netbsd16.config
compat_netbsd20.config compat_netbsd30.config
compat_netbsd40.config compat_netbsd50.config
compat_netbsd60.config compat_netbsd70.config

Log Message:
note that COMPAT_X implies all COMPAT_X+N.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/conf/compat_netbsd09.config \
src/sys/conf/compat_netbsd10.config src/sys/conf/compat_netbsd11.config \
src/sys/conf/compat_netbsd12.config src/sys/conf/compat_netbsd13.config \
src/sys/conf/compat_netbsd14.config src/sys/conf/compat_netbsd15.config \
src/sys/conf/compat_netbsd16.config src/sys/conf/compat_netbsd20.config \
src/sys/conf/compat_netbsd30.config src/sys/conf/compat_netbsd40.config \
src/sys/conf/compat_netbsd50.config src/sys/conf/compat_netbsd60.config \
src/sys/conf/compat_netbsd70.config

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

Modified files:

Index: src/sys/conf/compat_netbsd09.config
diff -u src/sys/conf/compat_netbsd09.config:1.1 src/sys/conf/compat_netbsd09.config:1.2
--- src/sys/conf/compat_netbsd09.config:1.1	Thu Sep 14 07:58:44 2017
+++ src/sys/conf/compat_netbsd09.config	Mon Jan 15 07:20:10 2018
@@ -1,7 +1,9 @@
-#	$NetBSD: compat_netbsd09.config,v 1.1 2017/09/14 07:58:44 mrg Exp $
+#	$NetBSD: compat_netbsd09.config,v 1.2 2018/01/15 07:20:10 mrg Exp $
 
 # Common fragment for all NetBSD targets wanting NetBSD 0.9 and newer
 # compatibility support.
+#
+# Note that COMPAT_09 implies all newer COMPAT_XX options.
 
 include"conf/compat_netbsd.config"
 options 	COMPAT_09	# NetBSD 0.9 and beyond.
Index: src/sys/conf/compat_netbsd10.config
diff -u src/sys/conf/compat_netbsd10.config:1.1 src/sys/conf/compat_netbsd10.config:1.2
--- src/sys/conf/compat_netbsd10.config:1.1	Thu Sep 14 07:58:44 2017
+++ src/sys/conf/compat_netbsd10.config	Mon Jan 15 07:20:10 2018
@@ -1,7 +1,9 @@
-#	$NetBSD: compat_netbsd10.config,v 1.1 2017/09/14 07:58:44 mrg Exp $
+#	$NetBSD: compat_netbsd10.config,v 1.2 2018/01/15 07:20:10 mrg Exp $
 
 # Common fragment for all NetBSD targets wanting NetBSD 1.0 and newer
 # compatibility support.
+#
+# Note that COMPAT_10 implies all newer COMPAT_XX options.
 
 include"conf/compat_netbsd.config"
 options 	COMPAT_10	# NetBSD 1.0 and beyond.
Index: src/sys/conf/compat_netbsd11.config
diff -u src/sys/conf/compat_netbsd11.config:1.1 src/sys/conf/compat_netbsd11.config:1.2
--- src/sys/conf/compat_netbsd11.config:1.1	Thu Sep 14 07:58:44 2017
+++ src/sys/conf/compat_netbsd11.config	Mon Jan 15 07:20:10 2018
@@ -1,7 +1,9 @@
-#	$NetBSD: compat_netbsd11.config,v 1.1 2017/09/14 07:58:44 mrg Exp $
+#	$NetBSD: compat_netbsd11.config,v 1.2 2018/01/15 07:20:10 mrg Exp $
 
 # Common fragment for all NetBSD targets wanting NetBSD 1.1 and newer
 # compatibility support.
+#
+# Note that COMPAT_11 implies all newer COMPAT_XX options.
 
 include"conf/compat_netbsd.config"
 options 	COMPAT_11	# NetBSD 1.1 and beyond.
Index: src/sys/conf/compat_netbsd12.config
diff -u src/sys/conf/compat_netbsd12.config:1.1 src/sys/conf/compat_netbsd12.config:1.2
--- src/sys/conf/compat_netbsd12.config:1.1	Thu Sep 14 07:58:44 2017
+++ src/sys/conf/compat_netbsd12.config	Mon Jan 15 07:20:10 2018
@@ -1,7 +1,9 @@
-#	$NetBSD: compat_netbsd12.config,v 1.1 2017/09/14 07:58:44 mrg Exp $
+#	$NetBSD: compat_netbsd12.config,v 1.2 2018/01/15 07:20:10 mrg Exp $
 
 # Common fragment for all NetBSD targets wanting NetBSD 1.2 and newer
 # compatibility support.
+#
+# Note that COMPAT_12 implies all newer COMPAT_XX options.
 
 include"conf/compat_netbsd.config"
 options 	COMPAT_12	# NetBSD 1.2 and beyond.
Index: src/sys/conf/compat_netbsd13.config
diff -u src/sys/conf/compat_netbsd13.config:1.1 src/sys/conf/compat_netbsd13.config:1.2
--- src/sys/conf/compat_netbsd13.config:1.1	Thu Sep 14 07:58:44 2017
+++ src/sys/conf/compat_netbsd13.config	Mon Jan 15 07:20:10 2018
@@ -1,7 +1,9 @@
-#	$NetBSD: compat_netbsd13.config,v 1.1 2017/09/14 07:58:44 mrg Exp $
+#	$NetBSD: compat_netbsd13.config,v 1.2 2018/01/15 07:20:10 mrg Exp $
 
 # Common fragment for all NetBSD targets wanting NetBSD 1.3 and newer
 # compatibility support.
+#
+# Note that COMPAT_13 implies all newer COMPAT_XX options.
 
 include"conf/compat_netbsd.config"
 options 	COMPAT_13	# NetBSD 1.3 and beyond.
Index: src/sys/conf/compat_netbsd14.config
diff -u src/sys/conf/compat_netbsd14.config:1.1 src/sys/conf/compat_netbsd14.config:1.2
--- src/sys/conf/compat_netbsd14.config:1.1	Thu Sep 14 07:58:44 2017
+++ src/sys/conf/compat_netbsd14.config	Mon Jan 15 07:20:10 2018
@@ -1,7 +1,9 @@
-#	$NetBSD: 

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

2018-01-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Jan 15 07:19:00 UTC 2018

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

Log Message:
 Add MSR_IA32_ARCH_CAPABILITIES definition.


To generate a diff of this commit:
cvs rdiff -u -r1.109 -r1.110 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.109 src/sys/arch/x86/include/specialreg.h:1.110
--- src/sys/arch/x86/include/specialreg.h:1.109	Mon Jan 15 06:08:40 2018
+++ src/sys/arch/x86/include/specialreg.h	Mon Jan 15 07:19:00 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: specialreg.h,v 1.109 2018/01/15 06:08:40 msaitoh Exp $	*/
+/*	$NetBSD: specialreg.h,v 1.110 2018/01/15 07:19:00 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1991 The Regents of the University of California.
@@ -611,6 +611,7 @@
 #define MSR_APERF		0x0e8
 #define MSR_IA32_EXT_CONFIG	0x0ee	/* Undocumented. Core Solo/Duo only */
 #define MSR_MTRRcap		0x0fe
+#define MSR_IA32_ARCH_CAPABILITIES 0x10a
 #define MSR_BBL_CR_ADDR		0x116	/* PII+ only */
 #define MSR_BBL_CR_DECC		0x118	/* PII+ only */
 #define MSR_BBL_CR_CTL		0x119	/* PII+ only */



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

2018-01-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Jan 15 06:08:41 UTC 2018

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

Log Message:
- Add Intel cpuid 7 %edx bit 29 IA32_ARCH_CAPABILITIES supported bit.
- Add comment.


To generate a diff of this commit:
cvs rdiff -u -r1.108 -r1.109 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.108 src/sys/arch/x86/include/specialreg.h:1.109
--- src/sys/arch/x86/include/specialreg.h:1.108	Sat Jan 13 17:55:57 2018
+++ src/sys/arch/x86/include/specialreg.h	Mon Jan 15 06:08:40 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: specialreg.h,v 1.108 2018/01/13 17:55:57 jdolecek Exp $	*/
+/*	$NetBSD: specialreg.h,v 1.109 2018/01/15 06:08:40 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1991 The Regents of the University of California.
@@ -322,6 +322,7 @@
  *	%eax: The Maximum input value for supported subleaf.
  *	%ebx: Feature bits.
  *	%ecx: Feature bits.
+ *	%edx: Feature bits.
  */
 
 /* %ebx */
@@ -396,10 +397,12 @@
 #define CPUID_SEF_AVX512_4FMAPS	__BIT(3)
 #define CPUID_SEF_IBRS		__BIT(26) /* IBRS / IBPB Speculation Control */
 #define CPUID_SEF_STIBP		__BIT(27) /* STIBP Speculation Control */
+#define CPUID_SEF_ARCH_CAP	__BIT(29) /* IA32_ARCH_CAPABILITIES */
 
 #define CPUID_SEF_FLAGS2	"\20" \
 "\3" "AVX512_4VNNIW" "\4" "AVX512_4FMAPS" \
-	"\33" "IBRS"	"\34" "STIBP"
+	"\33" "IBRS"	"\34" "STIBP"	\
+			"\36" "ARCH_CAP"
 
 /*
  * CPUID Processor extended state Enumeration Fn000d



CVS commit: src/crypto/external/bsd/openssh/dist

2018-01-14 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Mon Jan 15 05:04:58 UTC 2018

Modified Files:
src/crypto/external/bsd/openssh/dist: packet.c

Log Message:
Move spammy debug message to debug2.
Similarly spammy messages exist in this debug level.

Requested by gson in PR bin/52898:
ssh -v prints debug message on every keystroke


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/crypto/external/bsd/openssh/dist/packet.c

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

Modified files:

Index: src/crypto/external/bsd/openssh/dist/packet.c
diff -u src/crypto/external/bsd/openssh/dist/packet.c:1.29 src/crypto/external/bsd/openssh/dist/packet.c:1.30
--- src/crypto/external/bsd/openssh/dist/packet.c:1.29	Mon Oct  9 12:07:03 2017
+++ src/crypto/external/bsd/openssh/dist/packet.c	Mon Jan 15 05:04:58 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: packet.c,v 1.29 2017/10/09 12:07:03 christos Exp $	*/
+/*	$NetBSD: packet.c,v 1.30 2018/01/15 05:04:58 maya Exp $	*/
 /* $OpenBSD: packet.c,v 1.264 2017/09/12 06:32:07 djm Exp $ */
 /*
  * Author: Tatu Ylonen 
@@ -39,7 +39,7 @@
  */
 
 #include "includes.h"
-__RCSID("$NetBSD: packet.c,v 1.29 2017/10/09 12:07:03 christos Exp $");
+__RCSID("$NetBSD: packet.c,v 1.30 2018/01/15 05:04:58 maya Exp $");
 
 #include 	/* MIN roundup */
 #include 
@@ -1117,7 +1117,7 @@ ssh_packet_send2_wrapped(struct ssh *ssh
 	len, padlen, aadlen));
 
 	/* compute MAC over seqnr and packet(length fields, payload, padding) */
-debug("mac %p, %d %d", mac, mac? mac->enabled : -1, mac ? mac->etm : -1);
+debug2("mac %p, %d %d", mac, mac? mac->enabled : -1, mac ? mac->etm : -1);
 	if (mac && mac->enabled && !mac->etm) {
 		if ((r = mac_compute(mac, state->p_send.seqnr,
 		sshbuf_ptr(state->outgoing_packet), len,



CVS commit: src/sys/dev/pci

2018-01-14 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Mon Jan 15 04:25:48 UTC 2018

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

Log Message:
improve comments


To generate a diff of this commit:
cvs rdiff -u -r1.553 -r1.554 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.553 src/sys/dev/pci/if_wm.c:1.554
--- src/sys/dev/pci/if_wm.c:1.553	Mon Jan 15 04:09:58 2018
+++ src/sys/dev/pci/if_wm.c	Mon Jan 15 04:25:48 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.553 2018/01/15 04:09:58 knakahara Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.554 2018/01/15 04:25:48 knakahara Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -83,7 +83,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.553 2018/01/15 04:09:58 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.554 2018/01/15 04:25:48 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -4210,6 +4210,10 @@ wm_reset_phy(struct wm_softc *sc)
 	wm_phy_post_reset(sc);
 }
 
+/*
+ * Only used by WM_T_PCH_SPT which does not use multiqueue,
+ * so it is enough to check sc->sc_queue[0] only.
+ */
 static void
 wm_flush_desc_rings(struct wm_softc *sc)
 {



CVS commit: src/sys/dev/pci

2018-01-14 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Mon Jan 15 04:09:58 UTC 2018

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

Log Message:
Fix legacy Tx descriptors printing when WM_DEBUG is enabled.


To generate a diff of this commit:
cvs rdiff -u -r1.552 -r1.553 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.552 src/sys/dev/pci/if_wm.c:1.553
--- src/sys/dev/pci/if_wm.c:1.552	Thu Jan  4 09:43:27 2018
+++ src/sys/dev/pci/if_wm.c	Mon Jan 15 04:09:58 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.552 2018/01/04 09:43:27 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.553 2018/01/15 04:09:58 knakahara Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -83,7 +83,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.552 2018/01/04 09:43:27 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.553 2018/01/15 04:09:58 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -2981,11 +2981,22 @@ wm_watchdog_txq(struct ifnet *ifp, struc
 			i, txs->txs_firstdesc, txs->txs_lastdesc);
 		for (j = txs->txs_firstdesc; ;
 			j = WM_NEXTTX(txq, j)) {
-			printf("\tdesc %d: 0x%" PRIx64 "\n", j,
-			txq->txq_nq_descs[j].nqtx_data.nqtxd_addr);
-			printf("\t %#08x%08x\n",
-			txq->txq_nq_descs[j].nqtx_data.nqtxd_fields,
-			txq->txq_nq_descs[j].nqtx_data.nqtxd_cmdlen);
+			if ((sc->sc_flags & WM_F_NEWQUEUE) != 0) {
+printf("\tdesc %d: 0x%" PRIx64 "\n", j,
+	txq->txq_nq_descs[j].nqtx_data.nqtxd_addr);
+printf("\t %#08x%08x\n",
+	txq->txq_nq_descs[j].nqtx_data.nqtxd_fields,
+	txq->txq_nq_descs[j].nqtx_data.nqtxd_cmdlen);
+			} else {
+printf("\tdesc %d: 0x%" PRIx64 "\n", j,
+	(uint64_t)txq->txq_descs[j].wtx_addr.wa_high << 32 |
+	txq->txq_descs[j].wtx_addr.wa_low);
+printf("\t %#04x%02x%02x%08x\n",
+	txq->txq_descs[j].wtx_fields.wtxu_vlan,
+	txq->txq_descs[j].wtx_fields.wtxu_options,
+	txq->txq_descs[j].wtx_fields.wtxu_status,
+	txq->txq_descs[j].wtx_cmdlen);
+			}
 			if (j == txs->txs_lastdesc)
 break;
 			}



CVS commit: src/sys/net

2018-01-14 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Mon Jan 15 02:39:53 UTC 2018

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

Log Message:
Fix PR kern/52920. Pointed out by David Binderman, thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/net/if_ipsec.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_ipsec.c
diff -u src/sys/net/if_ipsec.c:1.1 src/sys/net/if_ipsec.c:1.2
--- src/sys/net/if_ipsec.c:1.1	Wed Jan 10 10:56:30 2018
+++ src/sys/net/if_ipsec.c	Mon Jan 15 02:39:53 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ipsec.c,v 1.1 2018/01/10 10:56:30 knakahara Exp $  */
+/*	$NetBSD: if_ipsec.c,v 1.2 2018/01/15 02:39:53 knakahara Exp $  */
 
 /*
  * Copyright (c) 2017 Internet Initiative Japan Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_ipsec.c,v 1.1 2018/01/10 10:56:30 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ipsec.c,v 1.2 2018/01/15 02:39:53 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1214,7 +1214,7 @@ if_ipsec_share_sp(struct ipsec_variant *
 	struct psref psref;
 
 	KASSERT(encap_lock_held());
-	KASSERT(var->iv_pdst != NULL && var->iv_pdst != NULL);
+	KASSERT(var->iv_psrc != NULL && var->iv_pdst != NULL);
 
 	mutex_enter(_softcs.lock);
 	LIST_FOREACH(sc2, _softcs.list, ipsec_list) {



CVS commit: src/usr.sbin/autofs

2018-01-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jan 15 00:46:16 UTC 2018

Modified Files:
src/usr.sbin/autofs: automount.c

Log Message:
sprinkle unconst


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/autofs/automount.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/autofs/automount.c
diff -u src/usr.sbin/autofs/automount.c:1.1 src/usr.sbin/autofs/automount.c:1.2
--- src/usr.sbin/autofs/automount.c:1.1	Mon Jan  8 22:31:15 2018
+++ src/usr.sbin/autofs/automount.c	Sun Jan 14 19:46:16 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: automount.c,v 1.1 2018/01/09 03:31:15 christos Exp $	*/
+/*	$NetBSD: automount.c,v 1.2 2018/01/15 00:46:16 christos Exp $	*/
 
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  * SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: automount.c,v 1.1 2018/01/09 03:31:15 christos Exp $");
+__RCSID("$NetBSD: automount.c,v 1.2 2018/01/15 00:46:16 christos Exp $");
 
 #include 
 #include 
@@ -100,9 +100,9 @@ mount_autofs(const char *from, const cha
 	from, fspath, prefix, options);
 
 	memset(, 0, sizeof(args));
-	args.from = from;
-	args.master_options = options;
-	args.master_prefix = prefix;
+	args.from = __UNCONST(from);
+	args.master_options = __UNCONST(options);
+	args.master_prefix = __UNCONST(prefix);
 
 	error = mount("autofs", fspath, 0, , sizeof(args));
 	if (error != 0)



CVS commit: [netbsd-8] src/doc

2018-01-14 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Jan 15 00:21:49 UTC 2018

Modified Files:
src/doc [netbsd-8]: CHANGES-8.0

Log Message:
489


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.103 -r1.1.2.104 src/doc/CHANGES-8.0

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

Modified files:

Index: src/doc/CHANGES-8.0
diff -u src/doc/CHANGES-8.0:1.1.2.103 src/doc/CHANGES-8.0:1.1.2.104
--- src/doc/CHANGES-8.0:1.1.2.103	Sat Jan 13 22:33:12 2018
+++ src/doc/CHANGES-8.0	Mon Jan 15 00:21:49 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.0,v 1.1.2.103 2018/01/13 22:33:12 snj Exp $
+# $NetBSD: CHANGES-8.0,v 1.1.2.104 2018/01/15 00:21:49 snj Exp $
 
 A complete list of changes from the initial NetBSD 8.0 branch on 2017-06-04
 until the 8.0 release:
@@ -9089,3 +9089,16 @@ sys/arch/sparc/sparc/timerreg.h			1.10
 	fix time goes backwards problems on sparc.
 	[mrg, ticket #504]
 
+share/man/man4/audio.41.81-1.82
+sys/dev/audio.c	1.376 via patch, 1.407-1.413, 1.415-1.440, 1.441 via patch, 1.443-1.450
+sys/dev/audiovar.h1.59 via patch, 1.65-1.68
+
+	audio(4):
+	- Many bug fixes and code cleanups
+	- Add latency sysctl to adjust hw blocksize and hence latency
+	  of the mixer.
+  example: sysctl -w hw.hdafg0.latency="value in milliseconds"
+	- Add sysctl to disable the in kernel mixer.
+	  example: sysctl -w hw.hdafg0.usemixer=0
+	[nat, ticket #489]
+



CVS commit: [netbsd-8] src

2018-01-14 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Jan 15 00:08:55 UTC 2018

Modified Files:
src/share/man/man4 [netbsd-8]: audio.4
src/sys/dev [netbsd-8]: audio.c audiovar.h

Log Message:
Pull up following revision(s) (requested by nat in ticket #489):
share/man/man4/audio.4: 1.81-1.82
sys/dev/audio.c: 1.376 via patch, 1.407-1.413, 1.415-1.440, 1.441 via 
patch, 1.443-1.450
sys/dev/audiovar.h: 1.59 via patch, 1.65-1.68
Improve audio_set_vchan_defaults().
- Correct confused input/output parameters.
- Remove sc->{sc_channels, sc_precision, sc_frequency}.  They are
  the same as sc->sc_vchan_params.{channels, precision, sample_rate}.
The input parameter of audio_set_vchan_defaults() is now only
sc->sc_vchan_params.
Fix PR kern/52437
Move play/rec mix ring buffers into a virtual channel sc_mixring.  NFCI.
Call audio_mix for a third time - thus ensuring there is a block of data
in the mix ring before the audio interrupt occurs.
This addresses the instability seen in the audio atf tests.
Improve logic in audio_initbufs().  No functional changes intended.
Ensure proper use of sc_opens (play back) and sc_recopens (recording).
Fix logic for /dev/sound so audiosetinfo is only called once.
These changes are to ensure that init_output/input is only called once for
the respective function play back or recording.  For multiple recording or
plack back streams init_input/output is only called once fot the first
play/rec stream.
This addresses PR kern/52580, PR kern/52581 and PR kern/52582 analyzed and
reported by isaki@.
Fix return value.  fo_mmap is expected to return errno on error.
Fix return value.  fo_poll is expected to return revents on error.
Fix return value.  fo_kqfilter is expected to return errno on error.
This is the rest of 1.226 (10 years ago).
Add latency sysctl to adjust hw blocksize and hence latency of the mixer.
usage: sysctl -w hw.hdafg0.lantency="value in milliseconds"
It is possible to set the latency of the mixer unless a static blocksize
is configured by the underlying hardware driver (pad, vcaudio on RPI).
Documentation updates to audio.4 will occur in a follow up commit.
OK christos@.
Ensure that the low/high water marks are at least PREFILL_BLOCKS.
Independent blocksizes for virtual channels where a static blocksize is
not stipulated by the underlying hw driver.
This improves latency in games esp. when the stream format differs from
the harware format.
OK christos@.
No externs in .c files!  Include ioconf.h for struct cfdriver xyz_cd.
round_blocksize is only used for the hardware ring buffer.  All other
buffers (mix ring, streams) are set to be a power of 2.
This allows for consistent latency where a static blocksize is enforced by
the underlying audio device driver.
Ok christos@.
Move calculation of sc_latency into a function.
The latency of the audio device is updated on attach in the audio auto
config and shown on screen.
Ok christos@.
Only allow blocksizes greater or equal to the calculated one.
This should help applications as the blocksize obtained (AUDIO_SET/GETINFO)
will work without stutter.
Ok christos@.
Revert commit rev 1.419 to audio.c.  This should address PR kern/52685.
This also means that drivers that have a static block size will have more
latency at lower sample rates/precision/channels.  Also audio drivers that
do more than supply rounded blocksizes in their round_blocksize functions
will have to be changed.
Use mix ring block size in audio write, startp, and audio drain.
Allow for block sizes less than hw block size.  This allows for the lowest
possible latency for all precision, sample rate and frequencies.
This is a rework of rev 1.419.
Calc latency when altering precision, frequency and channels sysctls.
No need to ratify block size twice as this is done in audio_initbufs.
This is a rework of rev 1.421.
Revert to previous.  It is necessary to use the calculated blocksize if
none supplied.
Tested by martin@.
Blocksizes sould be rounded to a power of 2 as OSS applications need this.
Tested by martin@.
AU_RING_SIZE -> s.bufsize in audio_initbufs.
A sysctl is now available to disable the in kernel mixer.
sysctl -w hw.hdafg0.usemixer=0
There currently is a problem draining the last block with the mixer
disabled.  I will fix this in a follow up commit.
AFAIK there will be a problem wiht vs(4) on x68k with the mixer disabled
as the filters for mulaw, alaw and unsigned linear have been removed post
audio mixing changes.
Documentation for this sysctl variable will be made to audio.4 in a follow
up commit.
Ok christos@.
Use mixring blocksizes in the right places when mixer is enabled.
This means that x68k's vs audio works once again with sysctl usemixer=1.
Tested with xm6i.
Don't return EIO falsely when dealing with the hardware vc.
Draining of the hardware vc on close is now possible.
Plug memory leak as the mixer state does not grow or shrink when audio
mixing is disabled.  This avoids triggering a panic also.

CVS commit: src/external/apache2/mDNSResponder

2018-01-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 14 22:51:12 UTC 2018

Modified Files:
src/external/apache2/mDNSResponder: prepare-import.sh

Log Message:
remove Documents before import.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/apache2/mDNSResponder/prepare-import.sh

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

Modified files:

Index: src/external/apache2/mDNSResponder/prepare-import.sh
diff -u src/external/apache2/mDNSResponder/prepare-import.sh:1.3 src/external/apache2/mDNSResponder/prepare-import.sh:1.4
--- src/external/apache2/mDNSResponder/prepare-import.sh:1.3	Sun Jan 14 14:37:35 2018
+++ src/external/apache2/mDNSResponder/prepare-import.sh	Sun Jan 14 17:51:12 2018
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: prepare-import.sh,v 1.3 2018/01/14 19:37:35 christos Exp $
+# $NetBSD: prepare-import.sh,v 1.4 2018/01/14 22:51:12 christos Exp $
 #
 # Extract the new tarball and run this script with the first argument
 # the mDNSResponder-X.Y directory that was created. cd to that directory
@@ -11,7 +11,7 @@
 set -e
 cd "$1"
 rm -rf mDNSMacOS9 mDNSMacOSX mDNSVxWorks mDNSWindows
-rm -f Makefile mDNSResponder.sln README.txt PrivateDNS.txt
+rm -f Makefile mDNSResponder.sln README.txt PrivateDNS.txt Documents
 
 (cd Clients
 rm -rf BonjourExample DNS-SD.VisualStudio DNS-SD.xcodeproj



CVS commit: src/distrib/sets/lists

2018-01-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 14 22:46:10 UTC 2018

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

Log Message:
add mount_autofs


To generate a diff of this commit:
cvs rdiff -u -r1.1167 -r1.1168 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.234 -r1.235 src/distrib/sets/lists/debug/mi

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

Modified files:

Index: src/distrib/sets/lists/base/mi
diff -u src/distrib/sets/lists/base/mi:1.1167 src/distrib/sets/lists/base/mi:1.1168
--- src/distrib/sets/lists/base/mi:1.1167	Mon Jan  8 22:31:13 2018
+++ src/distrib/sets/lists/base/mi	Sun Jan 14 17:46:09 2018
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1167 2018/01/09 03:31:13 christos Exp $
+# $NetBSD: mi,v 1.1168 2018/01/14 22:46:09 christos Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -520,6 +520,7 @@
 ./sbin/modunloadbase-sysutil-root
 ./sbin/mount	base-sysutil-root
 ./sbin/mount_adosbase-adosfs-root
+./sbin/mount_autofsbase-sysutil-root
 ./sbin/mount_cd9660base-sysutil-root
 ./sbin/mount_chfsbase-sysutil-root
 ./sbin/mount_efsbase-efs-root

Index: src/distrib/sets/lists/debug/mi
diff -u src/distrib/sets/lists/debug/mi:1.234 src/distrib/sets/lists/debug/mi:1.235
--- src/distrib/sets/lists/debug/mi:1.234	Wed Jan 10 06:02:41 2018
+++ src/distrib/sets/lists/debug/mi	Sun Jan 14 17:46:09 2018
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.234 2018/01/10 11:02:41 knakahara Exp $
+# $NetBSD: mi,v 1.235 2018/01/14 22:46:09 christos Exp $
 ./etc/mtree/set.debug   comp-sys-root
 ./usr/lib	comp-sys-usr		compatdir
 ./usr/lib/i18n/libBIG5_g.a			comp-c-debuglib		debuglib,compatfile
@@ -352,6 +352,7 @@
 ./usr/libdata/debug/sbin/modunload.debug	comp-sysutil-debug	debug
 ./usr/libdata/debug/sbin/mount.debug		comp-sysutil-debug	debug
 ./usr/libdata/debug/sbin/mount_ados.debug	comp-adosfs-debug	debug
+./usr/libdata/debug/sbin/mount_autofs.debug	comp-sysutil-debug	debug
 ./usr/libdata/debug/sbin/mount_cd9660.debug	comp-sysutil-debug	debug
 ./usr/libdata/debug/sbin/mount_chfs.debug	comp-sysutil-debug	debug
 ./usr/libdata/debug/sbin/mount_efs.debug	comp-efs-debug		debug



CVS commit: src/sbin

2018-01-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 14 22:44:04 UTC 2018

Modified Files:
src/sbin: Makefile
Added Files:
src/sbin/mount_autofs: Makefile mount_autofs.c mount_autofs.h

Log Message:
Add mount_autofs


To generate a diff of this commit:
cvs rdiff -u -r1.131 -r1.132 src/sbin/Makefile
cvs rdiff -u -r0 -r1.1 src/sbin/mount_autofs/Makefile \
src/sbin/mount_autofs/mount_autofs.c src/sbin/mount_autofs/mount_autofs.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/Makefile
diff -u src/sbin/Makefile:1.131 src/sbin/Makefile:1.132
--- src/sbin/Makefile:1.131	Sat Nov 25 18:29:43 2017
+++ src/sbin/Makefile	Sun Jan 14 17:44:04 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.131 2017/11/25 23:29:43 jmcneill Exp $
+#	$NetBSD: Makefile,v 1.132 2018/01/14 22:44:04 christos Exp $
 #	@(#)Makefile	8.5 (Berkeley) 3/31/94
 
 # Not ported: XNSrouted enpload scsiformat startslip
@@ -25,6 +25,7 @@ SUBDIR+= newfs_sysvbfs
 SUBDIR+= newfs_udf
 SUBDIR+= newfs_v7fs fsck_v7fs
 SUBDIR+= mount_ados
+SUBDIR+= mount_autofs
 SUBDIR+= mount_cd9660
 SUBDIR+= mount_chfs
 SUBDIR+= mount_efs

Added files:

Index: src/sbin/mount_autofs/Makefile
diff -u /dev/null src/sbin/mount_autofs/Makefile:1.1
--- /dev/null	Sun Jan 14 17:44:05 2018
+++ src/sbin/mount_autofs/Makefile	Sun Jan 14 17:44:04 2018
@@ -0,0 +1,14 @@
+#	$NetBSD: Makefile,v 1.1 2018/01/14 22:44:04 christos Exp $
+#	@(#)Makefile	8.2 (Berkeley) 3/27/94
+
+NOMAN=
+.include 
+
+PROG=	mount_autofs
+SRCS=	mount_autofs.c
+#MAN=	mount_autofs.8
+
+DPADD+=${LIBUTIL}
+LDADD+=-lutil
+
+.include 
Index: src/sbin/mount_autofs/mount_autofs.c
diff -u /dev/null src/sbin/mount_autofs/mount_autofs.c:1.1
--- /dev/null	Sun Jan 14 17:44:05 2018
+++ src/sbin/mount_autofs/mount_autofs.c	Sun Jan 14 17:44:04 2018
@@ -0,0 +1,146 @@
+/*	$NetBSD: mount_autofs.c,v 1.1 2018/01/14 22:44:04 christos Exp $	*/
+
+/*-
+ * Copyright (c) 2018 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include 
+#ifndef lint
+__RCSID("$NetBSD: mount_autofs.c,v 1.1 2018/01/14 22:44:04 christos Exp $");
+#endif /* not lint */
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+
+#include "mount_autofs.h"
+
+static const struct mntopt mopts[] = {
+	MOPT_STDOPTS,
+	MOPT_GETARGS,
+	MOPT_NULL,
+};
+
+int	mount_autofs(int argc, char **argv);
+__dead static void	usage(void);
+
+#ifndef MOUNT_NOMAIN
+int
+main(int argc, char **argv)
+{
+	return mount_autofs(argc, argv);
+}
+#endif
+
+void
+mount_autofs_parseargs(int argc, char *argv[], void *v, int *mntflags,
+	char *canon_dev, char *canon_dir)
+{
+	int ch;
+	mntoptparse_t mp;
+	struct autofs_args *am = v;
+
+	*mntflags = 0;
+	while ((ch = getopt(argc, argv, "f:o:O:p:")) != -1)
+		switch (ch) {
+		case 'f':
+			strlcpy(am->from, optarg, MAXPATHLEN);
+			break;
+		case 'o':
+			mp = getmntopts(optarg, mopts, mntflags, 0);
+			if (mp == NULL)
+err(EXIT_FAILURE, "getmntopts");
+			freemntopts(mp);
+			break;
+		case 'O':
+			strlcpy(am->master_options, optarg, MAXPATHLEN);
+			break;
+		case 'p':
+			strlcpy(am->master_prefix, optarg, MAXPATHLEN);
+			break;
+			
+		case '?':
+		default:
+			usage();
+		}
+	argc -= optind;
+	argv += optind;
+
+	if (argc != 2)
+		usage();
+
+	strlcpy(canon_dev, argv[0], MAXPATHLEN);
+	if (realpath(argv[1], canon_dir) == NULL)/* Check mounton path */
+		err(EXIT_FAILURE, "realpath %s", canon_dir);
+	if (strncmp(argv[1], canon_dir, MAXPATHLEN)) 

CVS commit: src/sys/fs/autofs

2018-01-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 14 22:43:18 UTC 2018

Modified Files:
src/sys/fs/autofs: autofs_mount.h autofs_vfsops.c

Log Message:
support getargs, fix flush, fix mutex_destroy


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/fs/autofs/autofs_mount.h
cvs rdiff -u -r1.3 -r1.4 src/sys/fs/autofs/autofs_vfsops.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/fs/autofs/autofs_mount.h
diff -u src/sys/fs/autofs/autofs_mount.h:1.1 src/sys/fs/autofs/autofs_mount.h:1.2
--- src/sys/fs/autofs/autofs_mount.h:1.1	Mon Jan  8 22:31:14 2018
+++ src/sys/fs/autofs/autofs_mount.h	Sun Jan 14 17:43:18 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: autofs_mount.h,v 1.1 2018/01/09 03:31:14 christos Exp $	*/
+/*	$NetBSD: autofs_mount.h,v 1.2 2018/01/14 22:43:18 christos Exp $	*/
 
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -39,9 +39,9 @@
  * This structure should only be used by automount(8).
  */
 struct autofs_args {
-	const char	*from;
-	const char	*master_options;
-	const char	*master_prefix;
+	char	*from;
+	char	*master_options;
+	char	*master_prefix;
 };
 
 #endif /* !_SYS_FS_AUTOFS_AUTOFS_MOUNT_H_ */

Index: src/sys/fs/autofs/autofs_vfsops.c
diff -u src/sys/fs/autofs/autofs_vfsops.c:1.3 src/sys/fs/autofs/autofs_vfsops.c:1.4
--- src/sys/fs/autofs/autofs_vfsops.c:1.3	Sat Jan 13 17:06:21 2018
+++ src/sys/fs/autofs/autofs_vfsops.c	Sun Jan 14 17:43:18 2018
@@ -33,7 +33,7 @@
  *
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autofs_vfsops.c,v 1.3 2018/01/13 22:06:21 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autofs_vfsops.c,v 1.4 2018/01/14 22:43:18 christos Exp $");
 
 
 #include "autofs.h"
@@ -95,26 +95,39 @@ static int
 autofs_mount(struct mount *mp, const char *path, void *data, size_t *data_len)
 {
 	struct autofs_args *args = data;
-	struct autofs_mount *amp;
+	struct autofs_mount *amp = VFSTOAUTOFS(mp);
 	struct statvfs *sbp = >mnt_stat;
 	int error;
 
+	if (mp->mnt_flag & MNT_UPDATE) {
+		if (amp == NULL)
+			return EIO;
+		autofs_flush(amp);
+		return 0;
+	}
+
 	if (!args)
 		return EINVAL;
 
-	/*
-	 * MNT_GETARGS is unsupported.  Autofs is mounted via automount(8) by
-	 * parsing /etc/auto_master instead of regular mount(8) variants with
-	 * -o getargs support, thus not really needed either.
-	 */
-	if (mp->mnt_flag & MNT_GETARGS)
-		return EOPNOTSUPP;
-
-	if (mp->mnt_flag & MNT_UPDATE) {
-		autofs_flush(VFSTOAUTOFS(mp));
-		return 0;
+	if (mp->mnt_flag & MNT_GETARGS) {
+		if (amp == NULL)
+			return EIO;
+		error = copyoutstr(amp->am_from, args->from,
+		sizeof(amp->am_from), NULL);
+		if (error)
+			return error;
+		error = copyoutstr(amp->am_options, args->master_options,
+		sizeof(amp->am_options), NULL);
+		if (error)
+			return error;
+		error = copyoutstr(amp->am_prefix, args->master_prefix,
+		sizeof(amp->am_prefix), NULL);
+		return error;
 	}
 
+	if (amp != NULL)
+		return EBUSY;
+
 	/*
 	 * Allocate the autofs mount.
 	 */
@@ -146,11 +159,9 @@ autofs_mount(struct mount *mp, const cha
 
 	mutex_enter(>am_lock);
 	error = autofs_node_new(NULL, amp, ".", -1, >am_root);
-	if (error) {
-		mutex_exit(>am_lock);
-		goto fail;
-	}
 	mutex_exit(>am_lock);
+	if (error)
+		goto fail1;
 	KASSERT(amp->am_root->an_ino == AUTOFS_ROOTINO);
 
 	autofs_statvfs(mp, sbp);
@@ -159,13 +170,16 @@ autofs_mount(struct mount *mp, const cha
 	error = set_statvfs_info(path, UIO_USERSPACE, args->from, UIO_USERSPACE,
 	mp->mnt_op->vfs_name, mp, curlwp);
 	if (error)
-		goto fail;
+		goto fail1;
 	strlcpy(amp->am_from, sbp->f_mntfromname, sizeof(amp->am_from));
 	strlcpy(amp->am_on, sbp->f_mntonname, sizeof(amp->am_on));
 
 	return 0;
 
+fail1:
+	mutex_destroy(>am_lock);
 fail:
+	mp->mnt_data = NULL;
 	kmem_free(amp, sizeof(*amp));
 	return error;
 }



CVS commit: src/external/apache2/mDNSResponder/usr.bin/dns-sd

2018-01-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 14 20:16:04 UTC 2018

Modified Files:
src/external/apache2/mDNSResponder/usr.bin/dns-sd: Makefile

Log Message:
Add -I


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/external/apache2/mDNSResponder/usr.bin/dns-sd/Makefile

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

Modified files:

Index: src/external/apache2/mDNSResponder/usr.bin/dns-sd/Makefile
diff -u src/external/apache2/mDNSResponder/usr.bin/dns-sd/Makefile:1.1 src/external/apache2/mDNSResponder/usr.bin/dns-sd/Makefile:1.2
--- src/external/apache2/mDNSResponder/usr.bin/dns-sd/Makefile:1.1	Tue Sep 29 19:56:34 2009
+++ src/external/apache2/mDNSResponder/usr.bin/dns-sd/Makefile	Sun Jan 14 15:16:04 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.1 2009/09/29 23:56:34 tsarna Exp $
+#	$NetBSD: Makefile,v 1.2 2018/01/14 20:16:04 christos Exp $
 
 PROG=	dns-sd
 
@@ -7,6 +7,7 @@ PROG=	dns-sd
 .PATH:	${DIST}/Clients ${DIST}/mDNSShared
 
 SRCS=	dns-sd.c ClientCommon.c
+CPPFLAGS+=-I${DIST}/mDNSShared
 LDADD+= -ldns_sd
 DPADD+= ${LIBDNS_SD}
 



CVS commit: src/doc

2018-01-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 14 20:07:03 UTC 2018

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
new mdnsresponder


To generate a diff of this commit:
cvs rdiff -u -r1.1492 -r1.1493 src/doc/3RDPARTY
cvs rdiff -u -r1.2344 -r1.2345 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.1492 src/doc/3RDPARTY:1.1493
--- src/doc/3RDPARTY:1.1492	Mon Jan  1 06:52:45 2018
+++ src/doc/3RDPARTY	Sun Jan 14 15:07:02 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1492 2018/01/01 11:52:45 roy Exp $
+#	$NetBSD: 3RDPARTY,v 1.1493 2018/01/14 20:07:02 christos Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -847,8 +847,8 @@ Notes:
 Uses libc's ohash
 
 Package:	mDNSResponder
-Version:	320.16
-Current Vers:	878
+Version:	878.1.1
+Current Vers:	878.1.1
 Maintainer:	Apple
 Archive Site:	https://www.opensource.apple.com/tarballs/mDNSResponder/
 Home Page:	https://developer.apple.com/bonjour/

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2344 src/doc/CHANGES:1.2345
--- src/doc/CHANGES:1.2344	Sat Jan  6 11:52:57 2018
+++ src/doc/CHANGES	Sun Jan 14 15:07:02 2018
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2344 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2345 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -97,3 +97,4 @@ Changes from NetBSD 8.0 to NetBSD 9.0:
 	sbrk: Remove the "data section size change" syscall [kamil 20171219]
 	ovadvise: Remove the old vadvise syscall header [kamil 20171219]
 	dhcpcd(8): Import dhcpcd-7.0.0 [roy 20180101]
+	mdnsd(8), dns-sd(1), libdns_sd: import mDNSResponder 878.1



CVS commit: src/tests/lib/libc/arch/sparc

2018-01-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jan 14 19:59:52 UTC 2018

Modified Files:
src/tests/lib/libc/arch/sparc: exec_prot_support.c return_one.S

Log Message:
Sync sparc with sparc64


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libc/arch/sparc/exec_prot_support.c \
src/tests/lib/libc/arch/sparc/return_one.S

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

Modified files:

Index: src/tests/lib/libc/arch/sparc/exec_prot_support.c
diff -u src/tests/lib/libc/arch/sparc/exec_prot_support.c:1.1 src/tests/lib/libc/arch/sparc/exec_prot_support.c:1.2
--- src/tests/lib/libc/arch/sparc/exec_prot_support.c:1.1	Mon Jul 18 23:16:10 2011
+++ src/tests/lib/libc/arch/sparc/exec_prot_support.c	Sun Jan 14 19:59:51 2018
@@ -1,4 +1,4 @@
-/*  $NetBSD: exec_prot_support.c,v 1.1 2011/07/18 23:16:10 jym Exp $ */
+/*  $NetBSD: exec_prot_support.c,v 1.2 2018/01/14 19:59:51 martin Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -30,12 +30,13 @@
  */
 
 #include 
-__RCSID("$NetBSD: exec_prot_support.c,v 1.1 2011/07/18 23:16:10 jym Exp $");
+__RCSID("$NetBSD: exec_prot_support.c,v 1.2 2018/01/14 19:59:51 martin Exp $");
 
 #include "../../common/exec_prot.h"
 
 int
 exec_prot_support(void)
 {
-	return NOTIMPL;
+
+	return PERPAGE_XP;
 }
Index: src/tests/lib/libc/arch/sparc/return_one.S
diff -u src/tests/lib/libc/arch/sparc/return_one.S:1.1 src/tests/lib/libc/arch/sparc/return_one.S:1.2
--- src/tests/lib/libc/arch/sparc/return_one.S:1.1	Mon Jul 18 23:16:10 2011
+++ src/tests/lib/libc/arch/sparc/return_one.S	Sun Jan 14 19:59:51 2018
@@ -1,8 +1,11 @@
-/*	$NetBSD: return_one.S,v 1.1 2011/07/18 23:16:10 jym Exp $ */
+/*	$NetBSD: return_one.S,v 1.2 2018/01/14 19:59:51 martin Exp $ */
 
 #include 
 
-.globl	return_one, return_one_end;
+.global	return_one_end
 
-return_one: return_one_end:
-	nop
+ENTRY(return_one)
+return_one:
+	retl
+	 mov 1, %o0
+return_one_end:



CVS import: src/external/apache2/mDNSResponder/dist

2018-01-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 14 19:40:52 UTC 2018

Update of /cvsroot/src/external/apache2/mDNSResponder/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv27581

Log Message:
import latest version

Status:

Vendor Tag: APACHE
Release Tags:   mdnsresponder-878-1-1

N src/external/apache2/mDNSResponder/dist/.gitignore
U src/external/apache2/mDNSResponder/dist/LICENSE
U src/external/apache2/mDNSResponder/dist/Clients/ClientCommon.c
U src/external/apache2/mDNSResponder/dist/Clients/ClientCommon.h
C src/external/apache2/mDNSResponder/dist/Clients/dns-sd.c
N src/external/apache2/mDNSResponder/dist/Clients/dnssdutil.c
U src/external/apache2/mDNSResponder/dist/Clients/dnsctl.c
N src/external/apache2/mDNSResponder/dist/Documents/Attach mDNSResponder to 
Xcode.rtfd/unknown.png
N src/external/apache2/mDNSResponder/dist/Documents/Attach mDNSResponder to 
Xcode.rtfd/TXT.rtf
N src/external/apache2/mDNSResponder/dist/Documents/Attach mDNSResponder to 
Xcode.rtfd/52D711AF-4055-4867-A494-7E31552BB9E1.png
N src/external/apache2/mDNSResponder/dist/Documents/Attach mDNSResponder to 
Xcode.rtfd/Screen Shot 2015-09-16 at 3.36.23 PM.png
N src/external/apache2/mDNSResponder/dist/Documents/Attach mDNSResponder to 
Xcode.rtfd/Screen Shot 2015-09-16 at 3.46.14 PM.png
N src/external/apache2/mDNSResponder/dist/Documents/Start mDNSResponder in 
Xcode.rtfd/TXT.rtf
N src/external/apache2/mDNSResponder/dist/Documents/Start mDNSResponder in 
Xcode.rtfd/A944EB40-AEFD-4CA1-BF10-E8F52835CA8C.png
N src/external/apache2/mDNSResponder/dist/Documents/Start mDNSResponder in 
Xcode.rtfd/Screen Shot 2015-09-16 at 4.22.37 PM.png
C src/external/apache2/mDNSResponder/dist/mDNSCore/mDNSEmbeddedAPI.h
U src/external/apache2/mDNSResponder/dist/mDNSCore/anonymous.c
U src/external/apache2/mDNSResponder/dist/mDNSCore/anonymous.h
U src/external/apache2/mDNSResponder/dist/mDNSCore/CryptoAlg.c
U src/external/apache2/mDNSResponder/dist/mDNSCore/CryptoAlg.h
C src/external/apache2/mDNSResponder/dist/mDNSCore/DNSCommon.c
U src/external/apache2/mDNSResponder/dist/mDNSCore/DNSCommon.h
C src/external/apache2/mDNSResponder/dist/mDNSCore/DNSDigest.c
U src/external/apache2/mDNSResponder/dist/mDNSCore/dnsproxy.c
U src/external/apache2/mDNSResponder/dist/mDNSCore/dnsproxy.h
U src/external/apache2/mDNSResponder/dist/mDNSCore/dnssec.c
U src/external/apache2/mDNSResponder/dist/mDNSCore/dnssec.h
C src/external/apache2/mDNSResponder/dist/mDNSCore/mDNS.c
U src/external/apache2/mDNSResponder/dist/mDNSCore/mDNSDebug.h
U src/external/apache2/mDNSResponder/dist/mDNSCore/nsec.c
U src/external/apache2/mDNSResponder/dist/mDNSCore/nsec.h
U src/external/apache2/mDNSResponder/dist/mDNSCore/nsec3.c
U src/external/apache2/mDNSResponder/dist/mDNSCore/nsec3.h
C src/external/apache2/mDNSResponder/dist/mDNSCore/uDNS.c
U src/external/apache2/mDNSResponder/dist/mDNSCore/uDNS.h
C src/external/apache2/mDNSResponder/dist/mDNSPosix/mDNSPosix.c
U src/external/apache2/mDNSResponder/dist/mDNSPosix/mDNSPosix.h
C src/external/apache2/mDNSResponder/dist/mDNSPosix/mDNSUNP.c
U src/external/apache2/mDNSResponder/dist/mDNSPosix/mDNSUNP.h
C src/external/apache2/mDNSResponder/dist/mDNSPosix/PosixDaemon.c
N src/external/apache2/mDNSResponder/dist/mDNSShared/dns_sd_internal.h
U src/external/apache2/mDNSResponder/dist/mDNSShared/CommonServices.h
C src/external/apache2/mDNSResponder/dist/mDNSShared/dns-sd.1
C src/external/apache2/mDNSResponder/dist/mDNSShared/dns_sd.h
C src/external/apache2/mDNSResponder/dist/mDNSShared/dnssd_clientlib.c
N src/external/apache2/mDNSResponder/dist/mDNSShared/dns_sd_private.h
U src/external/apache2/mDNSResponder/dist/mDNSShared/dnsextd_parser.y
C src/external/apache2/mDNSResponder/dist/mDNSShared/dnssd_clientstub.c
U src/external/apache2/mDNSResponder/dist/mDNSShared/dnssd_ipc.c
C src/external/apache2/mDNSResponder/dist/mDNSShared/dnssd_ipc.h
U src/external/apache2/mDNSResponder/dist/mDNSShared/GenLinkedList.c
U src/external/apache2/mDNSResponder/dist/mDNSShared/GenLinkedList.h
U src/external/apache2/mDNSResponder/dist/mDNSShared/mDNSResponder.8
U src/external/apache2/mDNSResponder/dist/mDNSShared/mDNSDebug.c
C src/external/apache2/mDNSResponder/dist/mDNSShared/PlatformCommon.c
U src/external/apache2/mDNSResponder/dist/mDNSShared/PlatformCommon.h
C src/external/apache2/mDNSResponder/dist/mDNSShared/uds_daemon.c
U src/external/apache2/mDNSResponder/dist/mDNSShared/uds_daemon.h
N src/external/apache2/mDNSResponder/dist/unittests/LocalOnlyTimeoutTests.c
N src/external/apache2/mDNSResponder/dist/unittests/CNameRecordTests.c
N src/external/apache2/mDNSResponder/dist/unittests/CNameRecordTests.h
N src/external/apache2/mDNSResponder/dist/unittests/daemon_ut.c
N src/external/apache2/mDNSResponder/dist/unittests/DNSMessageTest.c
N src/external/apache2/mDNSResponder/dist/unittests/DNSMessageTest.h
N src/external/apache2/mDNSResponder/dist/unittests/DomainNameTest.c
N src/external/apache2/mDNSResponder/dist/unittests/DomainNameTest.h
N 

CVS commit: src/external/apache2/mDNSResponder

2018-01-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 14 19:37:36 UTC 2018

Modified Files:
src/external/apache2/mDNSResponder: prepare-import.sh
src/external/apache2/mDNSResponder/dist/Clients: dns-sd.c
src/external/apache2/mDNSResponder/dist/mDNSCore: DNSCommon.c
DNSDigest.c mDNS.c mDNSEmbeddedAPI.h uDNS.c
src/external/apache2/mDNSResponder/dist/mDNSPosix: PosixDaemon.c
mDNSPosix.c mDNSUNP.c
src/external/apache2/mDNSResponder/dist/mDNSShared: PlatformCommon.c
dns-sd.1 dns_sd.h dnssd_clientlib.c dnssd_clientstub.c dnssd_ipc.h
uds_daemon.c
src/external/apache2/mDNSResponder/usr.sbin/mdnsd: Makefile

Log Message:
merge conflicts


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/apache2/mDNSResponder/prepare-import.sh
cvs rdiff -u -r1.4 -r1.5 \
src/external/apache2/mDNSResponder/dist/Clients/dns-sd.c
cvs rdiff -u -r1.6 -r1.7 \
src/external/apache2/mDNSResponder/dist/mDNSCore/DNSCommon.c \
src/external/apache2/mDNSResponder/dist/mDNSCore/mDNS.c
cvs rdiff -u -r1.4 -r1.5 \
src/external/apache2/mDNSResponder/dist/mDNSCore/DNSDigest.c \
src/external/apache2/mDNSResponder/dist/mDNSCore/mDNSEmbeddedAPI.h
cvs rdiff -u -r1.1.1.4 -r1.2 \
src/external/apache2/mDNSResponder/dist/mDNSCore/uDNS.c
cvs rdiff -u -r1.8 -r1.9 \
src/external/apache2/mDNSResponder/dist/mDNSPosix/PosixDaemon.c
cvs rdiff -u -r1.10 -r1.11 \
src/external/apache2/mDNSResponder/dist/mDNSPosix/mDNSPosix.c
cvs rdiff -u -r1.7 -r1.8 \
src/external/apache2/mDNSResponder/dist/mDNSPosix/mDNSUNP.c
cvs rdiff -u -r1.2 -r1.3 \
src/external/apache2/mDNSResponder/dist/mDNSShared/PlatformCommon.c
cvs rdiff -u -r1.3 -r1.4 \
src/external/apache2/mDNSResponder/dist/mDNSShared/dns-sd.1 \
src/external/apache2/mDNSResponder/dist/mDNSShared/dnssd_clientlib.c
cvs rdiff -u -r1.4 -r1.5 \
src/external/apache2/mDNSResponder/dist/mDNSShared/dns_sd.h \
src/external/apache2/mDNSResponder/dist/mDNSShared/dnssd_ipc.h
cvs rdiff -u -r1.8 -r1.9 \
src/external/apache2/mDNSResponder/dist/mDNSShared/dnssd_clientstub.c \
src/external/apache2/mDNSResponder/dist/mDNSShared/uds_daemon.c
cvs rdiff -u -r1.8 -r1.9 \
src/external/apache2/mDNSResponder/usr.sbin/mdnsd/Makefile

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

diffs are larger than 1MB and have been omitted


CVS import: src/external/apache2/mDNSResponder/dist

2018-01-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 14 18:43:03 UTC 2018

Update of /cvsroot/src/external/apache2/mDNSResponder/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv25042

Log Message:
import latest mDNSResponder

Status:

Vendor Tag: APACHE
Release Tags:   mdnsresponder-576-30-4

U src/external/apache2/mDNSResponder/dist/LICENSE
U src/external/apache2/mDNSResponder/dist/Clients/ClientCommon.c
C src/external/apache2/mDNSResponder/dist/Clients/dns-sd.c
U src/external/apache2/mDNSResponder/dist/Clients/ClientCommon.h
N src/external/apache2/mDNSResponder/dist/Clients/dnsctl.c
C src/external/apache2/mDNSResponder/dist/mDNSPosix/mDNSUNP.c
U src/external/apache2/mDNSResponder/dist/mDNSPosix/mDNSUNP.h
C src/external/apache2/mDNSResponder/dist/mDNSPosix/PosixDaemon.c
C src/external/apache2/mDNSResponder/dist/mDNSPosix/mDNSPosix.c
U src/external/apache2/mDNSResponder/dist/mDNSPosix/mDNSPosix.h
N src/external/apache2/mDNSResponder/dist/mDNSCore/dnsproxy.c
N src/external/apache2/mDNSResponder/dist/mDNSCore/dnssec.c
C src/external/apache2/mDNSResponder/dist/mDNSCore/mDNSEmbeddedAPI.h
N src/external/apache2/mDNSResponder/dist/mDNSCore/dnssec.h
N src/external/apache2/mDNSResponder/dist/mDNSCore/anonymous.h
C src/external/apache2/mDNSResponder/dist/mDNSCore/mDNS.c
N src/external/apache2/mDNSResponder/dist/mDNSCore/nsec.c
U src/external/apache2/mDNSResponder/dist/mDNSCore/DNSCommon.h
N src/external/apache2/mDNSResponder/dist/mDNSCore/dnsproxy.h
N src/external/apache2/mDNSResponder/dist/mDNSCore/anonymous.c
U src/external/apache2/mDNSResponder/dist/mDNSCore/uDNS.h
U src/external/apache2/mDNSResponder/dist/mDNSCore/mDNSDebug.h
N src/external/apache2/mDNSResponder/dist/mDNSCore/nsec.h
N src/external/apache2/mDNSResponder/dist/mDNSCore/nsec3.c
N src/external/apache2/mDNSResponder/dist/mDNSCore/nsec3.h
C src/external/apache2/mDNSResponder/dist/mDNSCore/DNSDigest.c
U src/external/apache2/mDNSResponder/dist/mDNSCore/uDNS.c
N src/external/apache2/mDNSResponder/dist/mDNSCore/CryptoAlg.c
C src/external/apache2/mDNSResponder/dist/mDNSCore/DNSCommon.c
N src/external/apache2/mDNSResponder/dist/mDNSCore/CryptoAlg.h
C src/external/apache2/mDNSResponder/dist/mDNSShared/dnssd_clientstub.c
C src/external/apache2/mDNSResponder/dist/mDNSShared/uds_daemon.c
C src/external/apache2/mDNSResponder/dist/mDNSShared/dns_sd.h
C src/external/apache2/mDNSResponder/dist/mDNSShared/dnssd_clientlib.c
U src/external/apache2/mDNSResponder/dist/mDNSShared/CommonServices.h
N src/external/apache2/mDNSResponder/dist/mDNSShared/dnsextd_parser.y
U src/external/apache2/mDNSResponder/dist/mDNSShared/uds_daemon.h
U src/external/apache2/mDNSResponder/dist/mDNSShared/GenLinkedList.h
U src/external/apache2/mDNSResponder/dist/mDNSShared/GenLinkedList.c
U src/external/apache2/mDNSResponder/dist/mDNSShared/mDNSDebug.c
C src/external/apache2/mDNSResponder/dist/mDNSShared/dns-sd.1
C src/external/apache2/mDNSResponder/dist/mDNSShared/PlatformCommon.c
U src/external/apache2/mDNSResponder/dist/mDNSShared/dnssd_ipc.c
C src/external/apache2/mDNSResponder/dist/mDNSShared/dnssd_ipc.h
U src/external/apache2/mDNSResponder/dist/mDNSShared/PlatformCommon.h
U src/external/apache2/mDNSResponder/dist/mDNSShared/mDNSResponder.8

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

cvs checkout -jAPACHE:yesterday -jAPACHE 
src/external/apache2/mDNSResponder/dist



CVS commit: src/sys/dev/ic

2018-01-14 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Jan 14 18:23:03 UTC 2018

Modified Files:
src/sys/dev/ic: rt2860.c

Log Message:
Fix awful use of m_defrag, this code just can't work. And don't forget to
return the updated pointer, because otherwise use-after-free.

I couldn't test this change because I don't have the hardware.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/ic/rt2860.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/rt2860.c
diff -u src/sys/dev/ic/rt2860.c:1.29 src/sys/dev/ic/rt2860.c:1.30
--- src/sys/dev/ic/rt2860.c:1.29	Mon Oct 23 09:31:17 2017
+++ src/sys/dev/ic/rt2860.c	Sun Jan 14 18:23:03 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: rt2860.c,v 1.29 2017/10/23 09:31:17 msaitoh Exp $	*/
+/*	$NetBSD: rt2860.c,v 1.30 2018/01/14 18:23:03 maxv Exp $	*/
 /*	$OpenBSD: rt2860.c,v 1.90 2016/04/13 10:49:26 mpi Exp $	*/
 /*	$FreeBSD: head/sys/dev/ral/rt2860.c 306591 2016-10-02 20:35:55Z avos $ */
 
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rt2860.c,v 1.29 2017/10/23 09:31:17 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rt2860.c,v 1.30 2018/01/14 18:23:03 maxv Exp $");
 
 #include 
 #include 
@@ -113,7 +113,7 @@ static void	rt2860_tx_intr(struct rt2860
 static void	rt2860_rx_intr(struct rt2860_softc *);
 static void	rt2860_tbtt_intr(struct rt2860_softc *);
 static void	rt2860_gp_intr(struct rt2860_softc *);
-static int	rt2860_tx(struct rt2860_softc *, struct mbuf *,
+static int	rt2860_tx(struct rt2860_softc *, struct mbuf **,
 		struct ieee80211_node *);
 static void	rt2860_start(struct ifnet *);
 static void	rt2860_watchdog(struct ifnet *);
@@ -1639,7 +1639,7 @@ out:
 }
 
 static int
-rt2860_tx(struct rt2860_softc *sc, struct mbuf *m, struct ieee80211_node *ni)
+rt2860_tx(struct rt2860_softc *sc, struct mbuf **m0, struct ieee80211_node *ni)
 {
 	struct ieee80211com *ic = >sc_ic;
 	struct rt2860_node *rn = (void *)ni;
@@ -1648,6 +1648,7 @@ rt2860_tx(struct rt2860_softc *sc, struc
 	struct rt2860_txd *txd;
 	struct rt2860_txwi *txwi;
 	struct ieee80211_frame *wh;
+	struct mbuf *m = *m0;
 	bus_dma_segment_t *seg;
 	u_int hdrlen;
 	uint16_t qos, dur;
@@ -1663,6 +1664,7 @@ rt2860_tx(struct rt2860_softc *sc, struc
 		struct ieee80211_key *k = ieee80211_crypto_encap(ic, ni, m);
 		if (k == NULL) {
 			m_freem(m);
+			*m0 = NULL;
 			return ENOBUFS;
 		}
 
@@ -1779,8 +1781,14 @@ rt2860_tx(struct rt2860_softc *sc, struc
 
 	KASSERT (ring->queued <= RT2860_TX_RING_ONEMORE); /* <1> */
 	if (bus_dmamap_load_mbuf(sc->sc_dmat, data->map, m, BUS_DMA_NOWAIT)) {
-		if (m_defrag(m, M_DONTWAIT))
+		struct mbuf *m_new = m_defrag(m, M_DONTWAIT);
+		if (m_new != NULL) {
+			/* m got freed */
+			m = m_new;
+			*m0 = m_new;
+		} else {
 			return (ENOBUFS);
+		}
 		if (bus_dmamap_load_mbuf(sc->sc_dmat,
 		data->map, m, BUS_DMA_NOWAIT))
 			return (EFBIG);
@@ -1923,7 +1931,7 @@ rt2860_start(struct ifnet *ifp)
 sendit:
 		bpf_mtap3(ic->ic_rawbpf, m);
 
-		if (rt2860_tx(sc, m, ni) != 0) {
+		if (rt2860_tx(sc, , ni) != 0) {
 			DPRINTF(("%s: can't tx\n", __func__));
 			m_freem(m);
 			ieee80211_free_node(ni);



CVS commit: src/sys/dev/pci

2018-01-14 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Jan 14 17:43:55 UTC 2018

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

Log Message:
Dedup. m_defrag is already a common function, no need to reimplement it
there. Meanwhile this should fix two bugs (that I couldn't investigate
more than that since I don't have this hardware): the mbuf passed to
vge_m_defrag was leaked, and the tags were not copied in the returned
mbuf.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/dev/pci/if_vge.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_vge.c
diff -u src/sys/dev/pci/if_vge.c:1.61 src/sys/dev/pci/if_vge.c:1.62
--- src/sys/dev/pci/if_vge.c:1.61	Tue Sep 26 07:42:06 2017
+++ src/sys/dev/pci/if_vge.c	Sun Jan 14 17:43:55 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: if_vge.c,v 1.61 2017/09/26 07:42:06 knakahara Exp $ */
+/* $NetBSD: if_vge.c,v 1.62 2018/01/14 17:43:55 maxv Exp $ */
 
 /*-
  * Copyright (c) 2004
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_vge.c,v 1.61 2017/09/26 07:42:06 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vge.c,v 1.62 2018/01/14 17:43:55 maxv Exp $");
 
 /*
  * VIA Networking Technologies VT612x PCI gigabit ethernet NIC driver.
@@ -358,64 +358,6 @@ vge_set_rxaddr(struct vge_rxdesc *rxd, b
 }
 
 /*
- * Defragment mbuf chain contents to be as linear as possible.
- * Returns new mbuf chain on success, NULL on failure. Old mbuf
- * chain is always freed.
- * XXX temporary until there would be generic function doing this.
- */
-#define m_defrag	vge_m_defrag
-struct mbuf * vge_m_defrag(struct mbuf *, int);
-
-struct mbuf *
-vge_m_defrag(struct mbuf *mold, int flags)
-{
-	struct mbuf *m0, *mn, *n;
-	size_t sz = mold->m_pkthdr.len;
-
-#ifdef DIAGNOSTIC
-	if ((mold->m_flags & M_PKTHDR) == 0)
-		panic("m_defrag: not a mbuf chain header");
-#endif
-
-	MGETHDR(m0, flags, MT_DATA);
-	if (m0 == NULL)
-		return NULL;
-	m0->m_pkthdr.len = mold->m_pkthdr.len;
-	mn = m0;
-
-	do {
-		if (sz > MHLEN) {
-			MCLGET(mn, M_DONTWAIT);
-			if ((mn->m_flags & M_EXT) == 0) {
-m_freem(m0);
-return NULL;
-			}
-		}
-
-		mn->m_len = MIN(sz, MCLBYTES);
-
-		m_copydata(mold, mold->m_pkthdr.len - sz, mn->m_len,
-		 mtod(mn, void *));
-
-		sz -= mn->m_len;
-
-		if (sz > 0) {
-			/* need more mbufs */
-			MGET(n, M_NOWAIT, MT_DATA);
-			if (n == NULL) {
-m_freem(m0);
-return NULL;
-			}
-
-			mn->m_next = n;
-			mn = n;
-		}
-	} while (sz > 0);
-
-	return m0;
-}
-
-/*
  * Read a word of data stored in the EEPROM at address 'addr.'
  */
 static uint16_t



CVS commit: src/sys/sys

2018-01-14 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Jan 14 17:16:58 UTC 2018

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

Log Message:
KDASSERT -> KASSERT. This code is fast and useful.


To generate a diff of this commit:
cvs rdiff -u -r1.173 -r1.174 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.173 src/sys/sys/mbuf.h:1.174
--- src/sys/sys/mbuf.h:1.173	Mon Jan  1 12:09:56 2018
+++ src/sys/sys/mbuf.h	Sun Jan 14 17:16:58 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: mbuf.h,v 1.173 2018/01/01 12:09:56 maxv Exp $	*/
+/*	$NetBSD: mbuf.h,v 1.174 2018/01/14 17:16:58 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1999, 2001, 2007 The NetBSD Foundation, Inc.
@@ -492,7 +492,7 @@ do {	\
 
 #define	MCLINITREFERENCE(m)		\
 do {	\
-	KDASSERT(((m)->m_flags & M_EXT) == 0);\
+	KASSERT(((m)->m_flags & M_EXT) == 0);\
 	(m)->m_ext_ref = (m);		\
 	(m)->m_ext.ext_refcnt = 1;	\
 	MCLREFDEBUGO((m), __FILE__, __LINE__);\



CVS commit: src/sys/kern

2018-01-14 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Jan 14 16:59:37 UTC 2018

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

Log Message:
style


To generate a diff of this commit:
cvs rdiff -u -r1.176 -r1.177 src/sys/kern/uipc_mbuf.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/uipc_mbuf.c
diff -u src/sys/kern/uipc_mbuf.c:1.176 src/sys/kern/uipc_mbuf.c:1.177
--- src/sys/kern/uipc_mbuf.c:1.176	Mon Jan  1 12:22:59 2018
+++ src/sys/kern/uipc_mbuf.c	Sun Jan 14 16:59:37 2018
@@ -1,6 +1,6 @@
-/*	$NetBSD: uipc_mbuf.c,v 1.176 2018/01/01 12:22:59 maxv Exp $	*/
+/*	$NetBSD: uipc_mbuf.c,v 1.177 2018/01/14 16:59:37 maxv Exp $	*/
 
-/*-
+/*
  * Copyright (c) 1999, 2001 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.176 2018/01/01 12:22:59 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.177 2018/01/14 16:59:37 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_mbuftrace.h"
@@ -1648,22 +1648,22 @@ m_getptr(struct mbuf *m, int loc, int *o
 	while (loc >= 0) {
 		/* Normal end of search */
 		if (m->m_len > loc) {
-			*off = loc;
-			return (m);
+			*off = loc;
+			return (m);
 		} else {
-			loc -= m->m_len;
+			loc -= m->m_len;
 
-			if (m->m_next == NULL) {
+			if (m->m_next == NULL) {
 if (loc == 0) {
- 	/* Point at the end of valid data */
-					*off = m->m_len;
-					return (m);
+	/* Point at the end of valid data */
+	*off = m->m_len;
+	return (m);
 } else
-		  			return (NULL);
-			} else
-	  			m = m->m_next;
+	return (NULL);
+			} else
+m = m->m_next;
 		}
-	}
+	}
 
 	return (NULL);
 }



CVS commit: src/sys/net

2018-01-14 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Jan 14 16:50:37 UTC 2018

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

Log Message:
If cnt == 0, don't kmem_alloc(0). Found by Mootja.

Looking at the code, I also find it suspicious that we read
ifv->ifv_mib->ifvm_p directly without making sure ifv_mib != NULL.


To generate a diff of this commit:
cvs rdiff -u -r1.121 -r1.122 src/sys/net/if_vlan.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_vlan.c
diff -u src/sys/net/if_vlan.c:1.121 src/sys/net/if_vlan.c:1.122
--- src/sys/net/if_vlan.c:1.121	Tue Dec 19 03:32:35 2017
+++ src/sys/net/if_vlan.c	Sun Jan 14 16:50:37 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vlan.c,v 1.121 2017/12/19 03:32:35 ozaki-r Exp $	*/
+/*	$NetBSD: if_vlan.c,v 1.122 2018/01/14 16:50:37 maxv Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.121 2017/12/19 03:32:35 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.122 2018/01/14 16:50:37 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -804,6 +804,7 @@ vlan_ifdetach(struct ifnet *p)
 	int i, cnt = 0;
 
 	bound = curlwp_bind();
+
 	mutex_enter(_list.lock);
 	LIST_FOREACH(ifv, _list.list, ifv_list) {
 		mib = vlan_getref_linkmib(ifv, );
@@ -817,13 +818,18 @@ vlan_ifdetach(struct ifnet *p)
 	}
 	mutex_exit(_list.lock);
 
+	if (cnt == 0) {
+		curlwp_bindx(bound);
+		return;
+	}
+
 	/*
 	 * The value of "cnt" does not increase while ifv_list.lock
 	 * and ifv->ifv_lock are released here, because the parent
 	 * interface is detaching.
 	 */
 	nmibs = kmem_alloc(sizeof(*nmibs) * cnt, KM_SLEEP);
-	for (i=0; i < cnt; i++) {
+	for (i = 0; i < cnt; i++) {
 		nmibs[i] = kmem_alloc(sizeof(*nmibs[i]), KM_SLEEP);
 	}
 
@@ -851,9 +857,10 @@ vlan_ifdetach(struct ifnet *p)
 	}
 
 	mutex_exit(_list.lock);
+
 	curlwp_bindx(bound);
 
-	for (i=0; i < cnt; i++) {
+	for (i = 0; i < cnt; i++) {
 		if (nmibs[i])
 			kmem_free(nmibs[i], sizeof(*nmibs[i]));
 	}



CVS commit: src/sys/sys

2018-01-14 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Jan 14 16:43:03 UTC 2018

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

Log Message:
typos


To generate a diff of this commit:
cvs rdiff -u -r1.176 -r1.177 src/sys/sys/lwp.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/lwp.h
diff -u src/sys/sys/lwp.h:1.176 src/sys/sys/lwp.h:1.177
--- src/sys/sys/lwp.h:1.176	Fri Dec 22 10:24:49 2017
+++ src/sys/sys/lwp.h	Sun Jan 14 16:43:03 2018
@@ -1,6 +1,6 @@
-/*	$NetBSD: lwp.h,v 1.176 2017/12/22 10:24:49 ozaki-r Exp $	*/
+/*	$NetBSD: lwp.h,v 1.177 2018/01/14 16:43:03 maxv Exp $	*/
 
-/*-
+/*
  * Copyright (c) 2001, 2006, 2007, 2008, 2009, 2010
  *The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -69,7 +69,7 @@ static inline struct cpu_info *lwp_getcp
  * (:	unlocked, stable
  * !:	unlocked, may only be reliably accessed by the LWP itself
  *
- * Fields are clustered together by usage (to increase the likelyhood
+ * Fields are clustered together by usage (to increase the likelihood
  * of cache hits) and by size (to reduce dead space in the structure).
  */
 
@@ -525,7 +525,7 @@ KPREEMPT_ENABLE(lwp_t *l)
 #define	DOPREEMPT_COUNTED	0x02
 
 /*
- * Prevent curlwp from migrating between CPUs beteen curlwp_bind and
+ * Prevent curlwp from migrating between CPUs between curlwp_bind and
  * curlwp_bindx. One use case is psref(9) that has a contract that
  * forbids migrations.
  */



CVS commit: src/sys/netipsec

2018-01-14 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Jan 14 16:36:04 UTC 2018

Modified Files:
src/sys/netipsec: xform_ipip.c

Log Message:
Fix use-after-free. There is a path where the mbuf gets pulled up without
a proper mtod afterwards:

218 ipo = mtod(m, struct ip *);
281 m = m_pullup(m, hlen);
232 ipo->ip_src.s_addr

Found by Mootja.

Meanwhile it seems to me that 'ipo' should be set to NULL if the inner
packet is IPv6, but I'll revisit that later.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/netipsec/xform_ipip.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/netipsec/xform_ipip.c
diff -u src/sys/netipsec/xform_ipip.c:1.55 src/sys/netipsec/xform_ipip.c:1.56
--- src/sys/netipsec/xform_ipip.c:1.55	Wed Nov 15 10:42:41 2017
+++ src/sys/netipsec/xform_ipip.c	Sun Jan 14 16:36:04 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: xform_ipip.c,v 1.55 2017/11/15 10:42:41 knakahara Exp $	*/
+/*	$NetBSD: xform_ipip.c,v 1.56 2018/01/14 16:36:04 maxv Exp $	*/
 /*	$FreeBSD: src/sys/netipsec/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.55 2017/11/15 10:42:41 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xform_ipip.c,v 1.56 2018/01/14 16:36:04 maxv Exp $");
 
 /*
  * IP-inside-IP processing
@@ -301,7 +301,8 @@ _ipip_input(struct mbuf *m, int iphlen, 
 #endif /* INET */
 #ifdef INET6
 	case 6:
-ip6 = (struct ip6_hdr *) ipo;
+		ipo = mtod(m, struct ip *);
+		ip6 = (struct ip6_hdr *)ipo;
 		itos = (ntohl(ip6->ip6_flow) >> 20) & 0xff;
 		ip_ecn_egress(ip6_ipsec_ecn, , );
 		ip6->ip6_flow &= ~htonl(0xff << 20);



CVS commit: src/sys/netinet

2018-01-14 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Jan 14 16:18:11 UTC 2018

Modified Files:
src/sys/netinet: ip_encap.c

Log Message:
Fix memory leak, found by Mootja.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/sys/netinet/ip_encap.c

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

Modified files:

Index: src/sys/netinet/ip_encap.c
diff -u src/sys/netinet/ip_encap.c:1.66 src/sys/netinet/ip_encap.c:1.67
--- src/sys/netinet/ip_encap.c:1.66	Wed Nov 15 10:42:41 2017
+++ src/sys/netinet/ip_encap.c	Sun Jan 14 16:18:11 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_encap.c,v 1.66 2017/11/15 10:42:41 knakahara Exp $	*/
+/*	$NetBSD: ip_encap.c,v 1.67 2018/01/14 16:18:11 maxv Exp $	*/
 /*	$KAME: ip_encap.c,v 1.73 2001/10/02 08:30:58 itojun Exp $	*/
 
 /*
@@ -68,7 +68,7 @@
 #define USE_RADIX
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip_encap.c,v 1.66 2017/11/15 10:42:41 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_encap.c,v 1.67 2018/01/14 16:18:11 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_mrouting.h"
@@ -822,7 +822,7 @@ encap_attach_func(int af, int proto,
 
 	error = encap_add(ep);
 	if (error)
-		goto fail;
+		goto gc;
 
 	error = 0;
 #ifndef ENCAP_MPSAFE
@@ -830,6 +830,8 @@ encap_attach_func(int af, int proto,
 #endif
 	return ep;
 
+gc:
+	kmem_free(ep, sizeof(*ep));
 fail:
 #ifndef ENCAP_MPSAFE
 	splx(s);



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

2018-01-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jan 14 11:55:33 UTC 2018

Modified Files:
src/sys/arch/sparc/include: reg.h

Log Message:
Force explicit alignment for fpstate in the kernel, to match what our
asm code assumes.
We use a stack variable at least once (in fpu_init).


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/sparc/include/reg.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/sparc/include/reg.h
diff -u src/sys/arch/sparc/include/reg.h:1.9 src/sys/arch/sparc/include/reg.h:1.10
--- src/sys/arch/sparc/include/reg.h:1.9	Fri Dec 30 17:54:43 2016
+++ src/sys/arch/sparc/include/reg.h	Sun Jan 14 11:55:33 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: reg.h,v 1.9 2016/12/30 17:54:43 christos Exp $ */
+/*	$NetBSD: reg.h,v 1.10 2018/01/14 11:55:33 martin Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -106,7 +106,11 @@ struct fp_qentry {
 struct fpreg {
 	u_int	fr_regs[32];		/* our view is 32 32-bit registers */
 	int	fr_fsr;			/* %fsr */
-};
+}
+#ifdef _KERNEL
+ __aligned(8)/* asm code uses std instructions */
+#endif
+;
 struct fpstate {
 	struct fpreg fs_reg;
 #define fs_regs fs_reg.fr_regs