CVS commit: src/tests/net/if_vlan

2021-07-01 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Fri Jul  2 04:38:11 UTC 2021

Modified Files:
src/tests/net/if_vlan: t_vlan.sh

Log Message:
Added tests for changing a MTU when the vlan(4) is added to bridge(4)

The tests is for PR kern/56292


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/tests/net/if_vlan/t_vlan.sh

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

Modified files:

Index: src/tests/net/if_vlan/t_vlan.sh
diff -u src/tests/net/if_vlan/t_vlan.sh:1.17 src/tests/net/if_vlan/t_vlan.sh:1.18
--- src/tests/net/if_vlan/t_vlan.sh:1.17	Sun Mar  8 09:05:33 2020
+++ src/tests/net/if_vlan/t_vlan.sh	Fri Jul  2 04:38:10 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: t_vlan.sh,v 1.17 2020/03/08 09:05:33 nisimura Exp $
+#	$NetBSD: t_vlan.sh,v 1.18 2021/07/02 04:38:10 yamaguchi Exp $
 #
 # Copyright (c) 2016 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -669,6 +669,7 @@ vlan_configs6_cleanup()
 vlan_bridge_body_common()
 {
 	local atf_ifconfig="atf_check -s exit:0 rump.ifconfig"
+	local atf_brconfig="atf_check -s exit:0 $HIJACKING /sbin/brconfig"
 
 	rump_server_add_iface $SOCK_LOCAL shmif0 $BUS
 
@@ -681,17 +682,49 @@ vlan_bridge_body_common()
 	$DEBUG && rump.ifconfig vlan0
 
 	$atf_ifconfig bridge0 create
-	# Adjust to the MTU of a vlan on a shmif
-	$atf_ifconfig bridge0 mtu 1496
 	$atf_ifconfig bridge0 up
-	# Test brconfig add
-	atf_check -s exit:0 $HIJACKING brconfig bridge0 add vlan0
+
+	#
+	# Add vlan to bridge member
+	#
+	$atf_ifconfig bridge0 mtu 1496
+	atf_check -s exit:0 -o match:'mtu 1496' rump.ifconfig vlan0
+
+	$atf_brconfig bridge0 add vlan0
+	$DEBUG && brconfig bridge0
+	$atf_brconfig bridge0 delete vlan0
+
+	#
+	# decrease MTU on adding to bridge member
+	#
+	$atf_ifconfig bridge0 mtu 1495
+	atf_check -s exit:0 -o match:'mtu 1496' rump.ifconfig vlan0
+
+	$atf_brconfig bridge0 add vlan0
+	$DEBUG && brconfig bridge0
+	atf_check -s exit:0 -o match:'mtu 1495' rump.ifconfig vlan0
+	$atf_brconfig bridge0 delete vlan0
+
+	#
+	# increase MTU on adding to bridge member
+	#
+	$atf_ifconfig bridge0 mtu 1496
+	$atf_ifconfig vlan0 mtu 1495
+	$atf_brconfig bridge0 add vlan0
+
 	$DEBUG && brconfig bridge0
-	# Test brconfig delete
-	atf_check -s exit:0 $HIJACKING brconfig bridge0 delete vlan0
+	atf_check -s exit:0 -o match:'mtu 1496' rump.ifconfig vlan0
+	$atf_brconfig bridge0 delete vlan0
 
-	atf_check -s exit:0 $HIJACKING brconfig bridge0 add vlan0
-	# Test vlan destruction with bridge
+	$atf_ifconfig bridge0 mtu 1497
+	atf_check -s not-exit:0 -o ignore -e ignore \
+	/sbin/brconfig bridge0 add vlan0
+
+	#
+	# Destroy a vlan interface that is bridge member
+	#
+	$atf_ifconfig bridge0 mtu 1496
+	$atf_brconfig bridge0 add vlan0
 	$atf_ifconfig vlan0 destroy
 
 	rump_server_destroy_ifaces



CVS commit: src/sys/net

2021-07-01 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Fri Jul  2 03:30:46 UTC 2021

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

Log Message:
Use if_ioctl() for changing MTU, not ether_ioctl to prevent panic

Fix PR kern/56292


To generate a diff of this commit:
cvs rdiff -u -r1.180 -r1.181 src/sys/net/if_bridge.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_bridge.c
diff -u src/sys/net/if_bridge.c:1.180 src/sys/net/if_bridge.c:1.181
--- src/sys/net/if_bridge.c:1.180	Wed Jun 16 00:21:19 2021
+++ src/sys/net/if_bridge.c	Fri Jul  2 03:30:46 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bridge.c,v 1.180 2021/06/16 00:21:19 riastradh Exp $	*/
+/*	$NetBSD: if_bridge.c,v 1.181 2021/07/02 03:30:46 yamaguchi Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -80,7 +80,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.180 2021/06/16 00:21:19 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.181 2021/07/02 03:30:46 yamaguchi Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -861,7 +861,7 @@ bridge_ioctl_add(struct bridge_softc *sc
 			memset(, 0, sizeof(ifr));
 			ifr.ifr_mtu = sc->sc_if.if_mtu;
 			IFNET_LOCK(ifs);
-			error = ether_ioctl(ifs, SIOCSIFMTU, );
+			error = ifs->if_ioctl(ifs, SIOCSIFMTU, );
 			IFNET_UNLOCK(ifs);
 			if (error != 0)
 goto out;



CVS commit: src/sys/arch/hppa/hppa

2021-07-01 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Jul  1 22:57:45 UTC 2021

Modified Files:
src/sys/arch/hppa/hppa: intr.c

Log Message:
fix off by one which resulted in all idle time reported as interrupt time
final fix from nick@


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

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

Modified files:

Index: src/sys/arch/hppa/hppa/intr.c
diff -u src/sys/arch/hppa/hppa/intr.c:1.3 src/sys/arch/hppa/hppa/intr.c:1.4
--- src/sys/arch/hppa/hppa/intr.c:1.3	Sat May  4 13:04:36 2019
+++ src/sys/arch/hppa/hppa/intr.c	Thu Jul  1 22:57:45 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.c,v 1.3 2019/05/04 13:04:36 skrll Exp $	*/
+/*	$NetBSD: intr.c,v 1.4 2021/07/01 22:57:45 macallan Exp $	*/
 /*	$OpenBSD: intr.c,v 1.27 2009/12/31 12:52:35 jsing Exp $	*/
 
 /*
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.3 2019/05/04 13:04:36 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.4 2021/07/01 22:57:45 macallan Exp $");
 
 #define __MUTEX_PRIVATE
 
@@ -435,7 +435,7 @@ hppa_intr_dispatch(int ncpl, int eiem, s
 		ib->ib_evcnt.ev_count++;
 		arg = ib->ib_arg;
 		if (arg == NULL) {
-			clkframe.cf_flags = (ci->ci_intr_depth ?
+			clkframe.cf_flags = (ci->ci_intr_depth > 1 ?
 			TFF_INTR : 0);
 			clkframe.cf_spl = ncpl;
 			if (frame != NULL) {



CVS commit: src/sys

2021-07-01 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Thu Jul  1 22:08:13 UTC 2021

Modified Files:
src/sys/kern: kern_pmf.c
src/sys/net: if.c

Log Message:
Back out fix for kern_pmf.c calling a null if_stop and apply a fix
suggested by Jared McNeill which sets if_stop to a stub function
which means that more than just the pmf is protected from the NULL call.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/kern/kern_pmf.c
cvs rdiff -u -r1.486 -r1.487 src/sys/net/if.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_pmf.c
diff -u src/sys/kern/kern_pmf.c:1.46 src/sys/kern/kern_pmf.c:1.47
--- src/sys/kern/kern_pmf.c:1.46	Wed Jun 30 21:52:16 2021
+++ src/sys/kern/kern_pmf.c	Thu Jul  1 22:08:13 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_pmf.c,v 1.46 2021/06/30 21:52:16 blymn Exp $ */
+/* $NetBSD: kern_pmf.c,v 1.47 2021/07/01 22:08:13 blymn Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_pmf.c,v 1.46 2021/06/30 21:52:16 blymn Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_pmf.c,v 1.47 2021/07/01 22:08:13 blymn Exp $");
 
 #include 
 #include 
@@ -892,18 +892,11 @@ pmf_class_network_suspend(device_t dev, 
 	struct ifnet *ifp = device_pmf_class_private(dev);
 	int s;
 
-	if (ifp == NULL)
-		return true;
-
-	if ((*ifp->if_stop) == NULL)
-		printf("device %s has no if_stop\n", ifp->if_xname);
-	else {
-		s = splnet();
-		IFNET_LOCK(ifp);
-		(*ifp->if_stop)(ifp, 0);
-		IFNET_UNLOCK(ifp);
-		splx(s);
-	}
+	s = splnet();
+	IFNET_LOCK(ifp);
+	(*ifp->if_stop)(ifp, 0);
+	IFNET_UNLOCK(ifp);
+	splx(s);
 
 	return true;
 }

Index: src/sys/net/if.c
diff -u src/sys/net/if.c:1.486 src/sys/net/if.c:1.487
--- src/sys/net/if.c:1.486	Tue Jun 29 21:19:58 2021
+++ src/sys/net/if.c	Thu Jul  1 22:08:13 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.c,v 1.486 2021/06/29 21:19:58 riastradh Exp $	*/
+/*	$NetBSD: if.c,v 1.487 2021/07/01 22:08:13 blymn Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.486 2021/06/29 21:19:58 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.487 2021/07/01 22:08:13 blymn Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -761,11 +761,13 @@ void
 if_register(ifnet_t *ifp)
 {
 	/*
-	 * If the driver has not supplied its own if_ioctl, then
-	 * supply the default.
+	 * If the driver has not supplied its own if_ioctl or if_stop,
+	 * then supply the default.
 	 */
 	if (ifp->if_ioctl == NULL)
 		ifp->if_ioctl = ifioctl_common;
+	if (ifp->if_stop == NULL)
+		ifp->if_stop = if_nullstop;
 
 	sysctl_sndq_setup(>if_sysctl_log, ifp->if_xname, >if_snd);
 



CVS commit: src/sys/dev/ic

2021-07-01 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu Jul  1 20:39:15 UTC 2021

Modified Files:
src/sys/dev/ic: ax88190.c dl10019.c dp8390.c

Log Message:
Make sure the media / mii members in struct ethercom are initialized
so that the media-related ioctls work.  Problem reported by Björn Johannesson
on current-users@.

XXX pullup-9


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/ic/ax88190.c
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/ic/dl10019.c
cvs rdiff -u -r1.98 -r1.99 src/sys/dev/ic/dp8390.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/ax88190.c
diff -u src/sys/dev/ic/ax88190.c:1.17 src/sys/dev/ic/ax88190.c:1.18
--- src/sys/dev/ic/ax88190.c:1.17	Wed Jun 30 20:00:18 2021
+++ src/sys/dev/ic/ax88190.c	Thu Jul  1 20:39:15 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ax88190.c,v 1.17 2021/06/30 20:00:18 thorpej Exp $	*/
+/*	$NetBSD: ax88190.c,v 1.18 2021/07/01 20:39:15 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ax88190.c,v 1.17 2021/06/30 20:00:18 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ax88190.c,v 1.18 2021/07/01 20:39:15 thorpej Exp $");
 
 #include 
 #include 
@@ -101,6 +101,8 @@ ax88190_media_init(struct dp8390_softc *
 
 	callout_setfunc(>sc_tick_ch, ax88190_tick, sc);
 
+	sc->sc_ec.ec_mii = mii;
+
 	mii->mii_ifp = ifp;
 	mii->mii_readreg = ax88190_mii_readreg;
 	mii->mii_writereg = ax88190_mii_writereg;

Index: src/sys/dev/ic/dl10019.c
diff -u src/sys/dev/ic/dl10019.c:1.16 src/sys/dev/ic/dl10019.c:1.17
--- src/sys/dev/ic/dl10019.c:1.16	Wed Jun 30 20:00:18 2021
+++ src/sys/dev/ic/dl10019.c	Thu Jul  1 20:39:15 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: dl10019.c,v 1.16 2021/06/30 20:00:18 thorpej Exp $	*/
+/*	$NetBSD: dl10019.c,v 1.17 2021/07/01 20:39:15 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dl10019.c,v 1.16 2021/06/30 20:00:18 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dl10019.c,v 1.17 2021/07/01 20:39:15 thorpej Exp $");
 
 #include 
 #include 
@@ -134,6 +134,8 @@ dl10019_media_init(struct dp8390_softc *
 
 	callout_setfunc(>sc_tick_ch, dl10019_tick, sc);
 
+	sc->sc_ec.ec_mii = mii;
+
 	mii->mii_ifp = ifp;
 	mii->mii_readreg = dl10019_mii_readreg;
 	mii->mii_writereg = dl10019_mii_writereg;

Index: src/sys/dev/ic/dp8390.c
diff -u src/sys/dev/ic/dp8390.c:1.98 src/sys/dev/ic/dp8390.c:1.99
--- src/sys/dev/ic/dp8390.c:1.98	Wed Jun 30 20:00:18 2021
+++ src/sys/dev/ic/dp8390.c	Thu Jul  1 20:39:15 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: dp8390.c,v 1.98 2021/06/30 20:00:18 thorpej Exp $	*/
+/*	$NetBSD: dp8390.c,v 1.99 2021/07/01 20:39:15 thorpej Exp $	*/
 
 /*
  * Device driver for National Semiconductor DS8390/WD83C690 based ethernet
@@ -14,7 +14,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dp8390.c,v 1.98 2021/06/30 20:00:18 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dp8390.c,v 1.99 2021/07/01 20:39:15 thorpej Exp $");
 
 #include "opt_inet.h"
 
@@ -68,7 +68,6 @@ void
 dp8390_media_init(struct dp8390_softc *sc)
 {
 
-	sc->sc_ec.ec_ifmedia = >sc_media;
 	ifmedia_init(>sc_media, 0, dp8390_mediachange, dp8390_mediastatus);
 	ifmedia_add(>sc_media, IFM_ETHER | IFM_MANUAL, 0, NULL);
 	ifmedia_set(>sc_media, IFM_ETHER | IFM_MANUAL);
@@ -135,7 +134,13 @@ dp8390_config(struct dp8390_softc *sc)
 	aprint_normal_dev(sc->sc_dev, "Ethernet address %s\n",
 	ether_sprintf(sc->sc_enaddr));
 
-	/* Initialize media goo. */
+	/*
+	 * Initialize media structures.  We'll default to pointing ec_ifmedia
+	 * at our embedded media structure.  A card front-end can initialize
+	 * ec_mii if it has an MII interface.  (Note that sc_media is an
+	 * alias of sc_mii.mii_media in dp8390_softc.)
+	 */
+	sc->sc_ec.ec_ifmedia = >sc_media;
 	(*sc->sc_media_init)(sc);
 
 	/* We can support 802.1Q VLAN-sized frames. */



CVS commit: src/distrib/utils/embedded/files

2021-07-01 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Jul  1 18:05:45 UTC 2021

Modified Files:
src/distrib/utils/embedded/files: ec2_init

Log Message:
AWS marketplace does not allow root ssh logins. Create an ec2-user account
and install the ssh key in that user's home directory instead.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/distrib/utils/embedded/files/ec2_init

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

Modified files:

Index: src/distrib/utils/embedded/files/ec2_init
diff -u src/distrib/utils/embedded/files/ec2_init:1.1 src/distrib/utils/embedded/files/ec2_init:1.2
--- src/distrib/utils/embedded/files/ec2_init:1.1	Fri Nov 30 20:53:02 2018
+++ src/distrib/utils/embedded/files/ec2_init	Thu Jul  1 18:05:45 2021
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: ec2_init,v 1.1 2018/11/30 20:53:02 jmcneill Exp $
+# $NetBSD: ec2_init,v 1.2 2021/07/01 18:05:45 jmcneill Exp $
 #
 # PROVIDE: ec2_init
 # REQUIRE: NETWORKING
@@ -13,24 +13,37 @@ rcvar=${name}
 start_cmd="ec2_init"
 stop_cmd=":"
 
+EC2_USER="ec2-user"
 METADATA_URL="http://169.254.169.254/latest/meta-data/;
 SSH_KEY_URL="public-keys/0/openssh-key"
 HOSTNAME_URL="hostname"
 
-SSH_KEY_FILE="/root/.ssh/authorized_keys"
+SSH_KEY_FILE="/home/${EC2_USER}/.ssh/authorized_keys"
+
+ec2_newuser()
+{
+	echo "Creating EC2 user account ${EC2_USER}"
+	useradd -g users -G wheel,operator -m "${EC2_USER}"
+}
 
 ec2_init()
 {
 	(
 	umask 022
+
+	# create EC2 user
+	id "${EC2_USER}" >/dev/null 2>&1 || ec2_newuser
+
 	# fetch the key pair from Amazon Web Services
 	EC2_SSH_KEY=$(ftp -o - "${METADATA_URL}${SSH_KEY_URL}")
 
 	if [ -n "$EC2_SSH_KEY" ]; then
 		# A key pair is associated with this instance, add it
-		# to root 'authorized_keys' file
+		# to EC2_USER's 'authorized_keys' file
 		mkdir -p $(dirname "$SSH_KEY_FILE")
+		chown "${EC2_USER}:users" $(dirname "$SSH_KEY_FILE")
 		touch "$SSH_KEY_FILE"
+		chown "${EC2_USER}:users" "$SSH_KEY_FILE"
 		cd $(dirname "$SSH_KEY_FILE")
 
 		grep -q "$EC2_SSH_KEY" "$SSH_KEY_FILE"



CVS commit: src/distrib/utils/embedded/conf

2021-07-01 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Jul  1 17:31:21 UTC 2021

Modified Files:
src/distrib/utils/embedded/conf: arm64mbr.conf

Log Message:
No need for ec2_init on arm64mbr


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/distrib/utils/embedded/conf/arm64mbr.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/arm64mbr.conf
diff -u src/distrib/utils/embedded/conf/arm64mbr.conf:1.1 src/distrib/utils/embedded/conf/arm64mbr.conf:1.2
--- src/distrib/utils/embedded/conf/arm64mbr.conf:1.1	Thu May 28 10:22:49 2020
+++ src/distrib/utils/embedded/conf/arm64mbr.conf	Thu Jul  1 17:31:21 2021
@@ -1,4 +1,4 @@
-# $NetBSD: arm64mbr.conf,v 1.1 2020/05/28 10:22:49 jmcneill Exp $
+# $NetBSD: arm64mbr.conf,v 1.2 2021/07/01 17:31:21 jmcneill Exp $
 # ARM64 (MBR partitioning) customization script used by mkimage
 #
 board=arm64mbr
@@ -24,16 +24,10 @@ customize() {
 mdnsd=YES
 devpubd=YES
 wscons=\$(dev_exists wsdisplay0)
-ec2_init=\$(dev_exists ena0)
 EOF
 }
 
 populate_common() {
-	# Add EC2 init script
-	cp ${DIR}/files/ec2_init ${mnt}/etc/rc.d/ec2_init
-	echo "./etc/rc.d/ec2_init type=file uname=root gname=wheel mode=0555" \
-	>> "$tmp/selected_sets"
-
 	# Rename kernel to netbsd.img
 	mv "${mnt}/boot/netbsd-${kernel_GENERIC64}.img" "${mnt}/boot/netbsd.img"
 



CVS commit: src/distrib/utils/embedded/conf

2021-07-01 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Jul  1 17:32:07 UTC 2021

Modified Files:
src/distrib/utils/embedded/conf: arm64.conf

Log Message:
port-evbarm/56274: no network on ec2 arm64 9.99.85

Add -w to dhcpcd_flags when running on EC2, since we need to wait for the
network to come up before contacting the metadata service.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/distrib/utils/embedded/conf/arm64.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/arm64.conf
diff -u src/distrib/utils/embedded/conf/arm64.conf:1.12 src/distrib/utils/embedded/conf/arm64.conf:1.13
--- src/distrib/utils/embedded/conf/arm64.conf:1.12	Fri Jul 17 15:16:34 2020
+++ src/distrib/utils/embedded/conf/arm64.conf	Thu Jul  1 17:32:07 2021
@@ -1,4 +1,4 @@
-# $NetBSD: arm64.conf,v 1.12 2020/07/17 15:16:34 jmcneill Exp $
+# $NetBSD: arm64.conf,v 1.13 2021/07/01 17:32:07 jmcneill Exp $
 # ARM64 customization script used by mkimage
 #
 board=arm64
@@ -29,6 +29,9 @@ mdnsd=YES
 devpubd=YES
 wscons=\$(dev_exists wsdisplay0)
 ec2_init=\$(dev_exists ena0)
+if checkyesno ec2_init ; then
+	dhcpcd_flags="\$dhcpcd_flags -w"
+fi
 EOF
 }
 



CVS commit: src/sys/dev/pci

2021-07-01 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Jul  1 17:22:10 UTC 2021

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

Log Message:
port-evbarm/56274: no network on ec2 arm64 9.99.85

Remove custom SIOCSIFFLAGS handling and rely on ether_ioctl to DTRT


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/pci/if_ena.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_ena.c
diff -u src/sys/dev/pci/if_ena.c:1.27 src/sys/dev/pci/if_ena.c:1.28
--- src/sys/dev/pci/if_ena.c:1.27	Sat Jan 23 11:50:30 2021
+++ src/sys/dev/pci/if_ena.c	Thu Jul  1 17:22:10 2021
@@ -36,7 +36,7 @@
 #if 0
 __FBSDID("$FreeBSD: head/sys/dev/ena/ena.c 333456 2018-05-10 09:37:54Z mw $");
 #endif
-__KERNEL_RCSID(0, "$NetBSD: if_ena.c,v 1.27 2021/01/23 11:50:30 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ena.c,v 1.28 2021/07/01 17:22:10 jmcneill Exp $");
 
 #include 
 #include 
@@ -2396,28 +2396,6 @@ ena_ioctl(struct ifnet *ifp, u_long comm
 		rw_exit(>ioctl_sx);
 		break;
 
-	case SIOCSIFFLAGS:
-		if ((ifp->if_flags & IFF_UP) != 0) {
-			if ((if_getdrvflags(ifp) & IFF_RUNNING) != 0) {
-if ((ifp->if_flags & (IFF_PROMISC |
-IFF_ALLMULTI)) != 0) {
-	device_printf(adapter->pdev,
-	"ioctl promisc/allmulti\n");
-}
-			} else {
-rw_enter(>ioctl_sx, RW_WRITER);
-rc = ena_up(adapter);
-rw_exit(>ioctl_sx);
-			}
-		} else {
-			if ((if_getdrvflags(ifp) & IFF_RUNNING) != 0) {
-rw_enter(>ioctl_sx, RW_WRITER);
-ena_down(adapter);
-rw_exit(>ioctl_sx);
-			}
-		}
-		break;
-
 	case SIOCADDMULTI:
 	case SIOCDELMULTI:
 		break;



CVS commit: src/sys/kern

2021-07-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jul  1 15:53:20 UTC 2021

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

Log Message:
gcc (with some options) eroneously claims we would use "vp" uninitialized,
so initialize it as NULL.


To generate a diff of this commit:
cvs rdiff -u -r1.219 -r1.220 src/sys/kern/vfs_vnops.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/vfs_vnops.c
diff -u src/sys/kern/vfs_vnops.c:1.219 src/sys/kern/vfs_vnops.c:1.220
--- src/sys/kern/vfs_vnops.c:1.219	Thu Jul  1 04:25:51 2021
+++ src/sys/kern/vfs_vnops.c	Thu Jul  1 15:53:20 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_vnops.c,v 1.219 2021/07/01 04:25:51 christos Exp $	*/
+/*	$NetBSD: vfs_vnops.c,v 1.220 2021/07/01 15:53:20 martin Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_vnops.c,v 1.219 2021/07/01 04:25:51 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_vnops.c,v 1.220 2021/07/01 15:53:20 martin Exp $");
 
 #include "veriexec.h"
 
@@ -164,7 +164,7 @@ vn_open(struct vnode *at_dvp, struct pat
 	struct vnode **ret_vp, bool *ret_domove, int *ret_fd)
 {
 	struct nameidata nd;
-	struct vnode *vp;
+	struct vnode *vp = NULL;
 	struct lwp *l = curlwp;
 	kauth_cred_t cred = l->l_cred;
 	struct vattr va;



CVS commit: src/sys/uvm

2021-07-01 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Thu Jul  1 15:06:01 UTC 2021

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

Log Message:
in uvm_mapent_forkzero(), if the old entry was an object mapping,
appease a debug check by setting the new entry offset to zero along with
setting the new entry object pointer to NULL.

Reported-by: syzbot+de8e4b223a3838c73...@syzkaller.appspotmail.com
Reported-by: syzbot+efaea991addfdcc5a...@syzkaller.appspotmail.com
Reported-by: syzbot+15d1e19dff9209c2e...@syzkaller.appspotmail.com


To generate a diff of this commit:
cvs rdiff -u -r1.389 -r1.390 src/sys/uvm/uvm_map.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_map.c
diff -u src/sys/uvm/uvm_map.c:1.389 src/sys/uvm/uvm_map.c:1.390
--- src/sys/uvm/uvm_map.c:1.389	Sun Jun 20 07:11:38 2021
+++ src/sys/uvm/uvm_map.c	Thu Jul  1 15:06:01 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_map.c,v 1.389 2021/06/20 07:11:38 mrg Exp $	*/
+/*	$NetBSD: uvm_map.c,v 1.390 2021/07/01 15:06:01 chs Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.389 2021/06/20 07:11:38 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.390 2021/07/01 15:06:01 chs Exp $");
 
 #include "opt_ddb.h"
 #include "opt_pax.h"
@@ -4451,6 +4451,7 @@ uvm_mapent_forkzero(struct vm_map *new_m
 			new_entry->object.uvm_obj->pgops->pgo_detach(
 			new_entry->object.uvm_obj);
 		new_entry->object.uvm_obj = NULL;
+		new_entry->offset = 0;
 		new_entry->etype &= ~UVM_ET_OBJ;
 	}
 }