CVS commit: src/sys/dev/usb

2023-12-18 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Dec 19 07:05:36 UTC 2023

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

Log Message:
Add support for AX88179A. From sc.dying on current-users.


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/sys/dev/usb/if_axen.c

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

Modified files:

Index: src/sys/dev/usb/if_axen.c
diff -u src/sys/dev/usb/if_axen.c:1.94 src/sys/dev/usb/if_axen.c:1.95
--- src/sys/dev/usb/if_axen.c:1.94	Sat Aug 20 14:08:59 2022
+++ src/sys/dev/usb/if_axen.c	Tue Dec 19 07:05:36 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_axen.c,v 1.94 2022/08/20 14:08:59 riastradh Exp $	*/
+/*	$NetBSD: if_axen.c,v 1.95 2023/12/19 07:05:36 skrll Exp $	*/
 /*	$OpenBSD: if_axen.c,v 1.3 2013/10/21 10:10:22 yuo Exp $	*/
 
 /*
@@ -23,7 +23,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.94 2022/08/20 14:08:59 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.95 2023/12/19 07:05:36 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -52,6 +52,12 @@ struct axen_type {
 	uint16_t		axen_flags;
 #define AX178A	0x0001		/* AX88178a */
 #define AX179	0x0002		/* AX88179 */
+#define AX179A	0x0004		/* AX88179A */
+};
+
+struct axen_softc {
+	struct usbnet		axen_un;
+	uint16_t		axen_flags;
 };
 
 /*
@@ -70,7 +76,7 @@ static const struct axen_type axen_devs[
 static int	axen_match(device_t, cfdata_t, void *);
 static void	axen_attach(device_t, device_t, void *);
 
-CFATTACH_DECL_NEW(axen, sizeof(struct usbnet),
+CFATTACH_DECL_NEW(axen, sizeof(struct axen_softc),
 	axen_match, axen_attach, usbnet_detach, usbnet_activate);
 
 static int	axen_cmd(struct usbnet *, int, int, int, void *);
@@ -572,14 +578,14 @@ static void
 axen_attach(device_t parent, device_t self, void *aux)
 {
 	USBNET_MII_DECL_DEFAULT(unm);
-	struct usbnet * const un = device_private(self);
+	struct axen_softc * const sc = device_private(self);
+	struct usbnet * const un = >axen_un;
 	struct usb_attach_arg *uaa = aux;
 	struct usbd_device *dev = uaa->uaa_device;
 	usbd_status err;
 	usb_interface_descriptor_t *id;
 	usb_endpoint_descriptor_t *ed;
 	char *devinfop;
-	uint16_t axen_flags;
 	int i;
 
 	aprint_naive("\n");
@@ -590,7 +596,7 @@ axen_attach(device_t parent, device_t se
 
 	un->un_dev = self;
 	un->un_udev = dev;
-	un->un_sc = un;
+	un->un_sc = sc;
 	un->un_ops = _ops;
 	un->un_rx_xfer_flags = USBD_SHORT_XFER_OK;
 	un->un_tx_xfer_flags = USBD_FORCE_SHORT_XFER;
@@ -604,7 +610,12 @@ axen_attach(device_t parent, device_t se
 		return;
 	}
 
-	axen_flags = axen_lookup(uaa->uaa_vendor, uaa->uaa_product)->axen_flags;
+	sc->axen_flags =
+	axen_lookup(uaa->uaa_vendor, uaa->uaa_product)->axen_flags;
+	if (UGETW(usbd_get_device_descriptor(dev)->bcdDevice) == 0x0200) {
+		sc->axen_flags &= ~(AX178A | AX179);
+		sc->axen_flags |= AX179A;
+	}
 
 	err = usbd_device2interface_handle(dev, AXEN_IFACE_IDX, >un_iface);
 	if (err) {
@@ -663,11 +674,25 @@ axen_attach(device_t parent, device_t se
 
 	axen_ax88179_init(un);
 
+#if 0
+#define   AXEN_FW_MODE0x08
+#define AXEN_FW_MODE_178A179		0x
+#define AXEN_FW_MODE_179A			0x0001
+	if (sc->axen_flags & AX179A) {
+		uint8_t bval = 0;
+		/*	len		dir	  cmd */
+		int cmd = (1 << 12) | (1 << 8) | (AXEN_FW_MODE & 0x00FF);
+		axen_cmd(un, cmd, 1, AXEN_FW_MODE_178A179, );
+	}
+#endif
+
 	/* An ASIX chip was detected. Inform the world.  */
-	if (axen_flags & AX178A)
+	if (sc->axen_flags & AX178A)
 		aprint_normal_dev(self, "AX88178a\n");
-	else if (axen_flags & AX179)
+	else if (sc->axen_flags & AX179)
 		aprint_normal_dev(self, "AX88179\n");
+	else if (sc->axen_flags & AX179A)
+		aprint_normal_dev(self, "AX88179A\n");
 	else
 		aprint_normal_dev(self, "(unknown)\n");
 
@@ -735,6 +760,7 @@ axen_csum_flags_rx(struct ifnet *ifp, ui
 static void
 axen_uno_rx_loop(struct usbnet *un, struct usbnet_chain *c, uint32_t total_len)
 {
+	struct axen_softc * const sc = usbnet_softc(un);
 	struct ifnet *ifp = usbnet_ifp(un);
 	uint8_t *buf = c->unc_buf;
 	uint32_t rx_hdr, pkt_hdr;
@@ -752,7 +778,7 @@ axen_uno_rx_loop(struct usbnet *un, stru
 	/*
 	 * buffer map
 	 * [packet #0]...[packet #n][pkt hdr#0]..[pkt hdr#n][recv_hdr]
-	 * each packet has 0x as psuedo header..
+	 * each packet has 0x as pseudo header..
 	 */
 	hdr_p = (uint32_t *)(buf + total_len - sizeof(uint32_t));
 	rx_hdr = le32toh(*hdr_p);
@@ -789,7 +815,7 @@ axen_uno_rx_loop(struct usbnet *un, stru
 	if (pkt_count)
 		rnd_add_uint32(usbnet_rndsrc(un), pkt_count);
 
-	do {
+	while (pkt_count > 0) {
 		if ((buf[0] != 0xee) || (buf[1] != 0xee)) {
 			aprint_error_dev(un->un_dev,
 			"invalid buffer(pkt#%d), continue\n", pkt_count);
@@ -803,6 +829,9 @@ axen_uno_rx_loop(struct usbnet *un, stru
 		("%s: rxeof: packet#%d, pkt_hdr 0x%08x, pkt_len %zu\n",
 		   device_xname(un->un_dev), pkt_count, pkt_hdr, pkt_len));
 
+		if (pkt_len < sizeof(struct ether_header) + ETHER_ALIGN)

CVS commit: src/sys/dev/usb

2023-12-18 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Dec 19 07:05:36 UTC 2023

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

Log Message:
Add support for AX88179A. From sc.dying on current-users.


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/sys/dev/usb/if_axen.c

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



CVS commit: src/sys/arch/netwinder/conf

2023-12-18 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Tue Dec 19 02:35:17 UTC 2023

Modified Files:
src/sys/arch/netwinder/conf: GENERIC

Log Message:
netwinder: GENERIC - trim down some more

Disable more stuff to make GENERIC just about fit.


To generate a diff of this commit:
cvs rdiff -u -r1.146 -r1.147 src/sys/arch/netwinder/conf/GENERIC

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/netwinder/conf/GENERIC
diff -u src/sys/arch/netwinder/conf/GENERIC:1.146 src/sys/arch/netwinder/conf/GENERIC:1.147
--- src/sys/arch/netwinder/conf/GENERIC:1.146	Tue Dec 19 01:52:44 2023
+++ src/sys/arch/netwinder/conf/GENERIC	Tue Dec 19 02:35:17 2023
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.146 2023/12/19 01:52:44 uwe Exp $
+# $NetBSD: GENERIC,v 1.147 2023/12/19 02:35:17 uwe Exp $
 #
 # GENERIC machine description file
 #
@@ -54,7 +54,7 @@ file-system	FFS		# UFS
 file-system	MFS		# memory file system
 file-system	NFS		# Network file system
 #file-system 	ADOSFS		# AmigaDOS-compatible file system
-file-system 	EXT2FS		# second extended file system (linux)
+#file-system 	EXT2FS		# second extended file system (linux)
 #file-system	CD9660		# ISO 9660 + Rock Ridge file system
 file-system	MSDOSFS		# MS-DOS file system
 file-system	FDESC		# /dev/fd
@@ -75,7 +75,7 @@ file-system	TMPFS		# Efficient memory fi
 #options 	UFS_DIRHASH	# UFS Large Directory Hashing
 #options 	UFS_EXTATTR	# Extended attribute support for UFS1
 options 	WAPBL		# File system journaling support
-options 	NFSSERVER	# Network File System server
+#options 	NFSSERVER	# Network File System server
 
 # Networking options
 
@@ -147,7 +147,7 @@ options 	SYSCTL_INCLUDE_DESCR	# Include 
 options 	DDB		# in-kernel debugger
 options 	DDB_HISTORY_SIZE=100	# Enable history editing in DDB
 #makeoptions	DEBUG="-g"	# compile full symbol table
-makeoptions	COPY_SYMTAB=1
+#makeoptions	COPY_SYMTAB=1	# see also ksyms below
 
 config		netbsd	root on ? type ?
 
@@ -260,8 +260,8 @@ spkr*	at audio?		# PC speaker (synthesiz
 
 # Pseudo-Devices
 
-pseudo-device 	crypto		# /dev/crypto device
-pseudo-device	swcrypto	# software crypto implementation
+#pseudo-device 	crypto		# /dev/crypto device
+#pseudo-device	swcrypto	# software crypto implementation
 
 # disk/mass storage pseudo-devices
 #pseudo-device	md			# memory disk device (ramdisk)
@@ -273,7 +273,7 @@ pseudo-device	fss			# file system snapsh
 # network pseudo-devices
 pseudo-device	bpfilter		# Berkeley packet filter
 pseudo-device	carp			# Common Address Redundancy Protocol
-pseudo-device	pppoe			# PPP over Ethernet (RFC 2516)
+#pseudo-device	pppoe			# PPP over Ethernet (RFC 2516)
 pseudo-device	bridge			# simple inter-network bridging
 #pseudo-device	vether			# Virtual Ethernet for bridge
 pseudo-device	loop			# network loopback
@@ -295,7 +295,7 @@ pseudo-device 	swwdog			# software watch
 pseudo-device	wsmux			# mouse & keyboard multiplexor
 #pseudo-device	wsfont
 
-include "dev/veriexec.config"
+#include "dev/veriexec.config"
 
 # Pull in optional local configuration - always at end
 cinclude	"arch/netwinder/conf/GENERIC.local"



CVS commit: src/sys/arch/netwinder/conf

2023-12-18 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Tue Dec 19 02:35:17 UTC 2023

Modified Files:
src/sys/arch/netwinder/conf: GENERIC

Log Message:
netwinder: GENERIC - trim down some more

Disable more stuff to make GENERIC just about fit.


To generate a diff of this commit:
cvs rdiff -u -r1.146 -r1.147 src/sys/arch/netwinder/conf/GENERIC

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



CVS commit: src/external/bsd/iscsi/dist/src/lib

2023-12-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Dec 19 02:16:07 UTC 2023

Modified Files:
src/external/bsd/iscsi/dist/src/lib: protocol.c

Log Message:
libiscsi: Fix types of Time2Wait and Time2Retain in logout decap.

According to https://www.rfc-editor.org/rfc/rfc7143#section-11.15,
these are both 2-byte quantities.  Loading 4-byte quantities and
passing them through ISCSI_NTOHS might have worked by accident on
x86, but it's not gonna fly on big-endian.  (Fortunately sparc64 is
not just big-endian but also strict-alignment so it caught this
problem!)

XXX Is there an upstream for this code?  doc/3RDPARTY doesn't cite
any easily-followed references.

PR port-sparc64/57784

XXX pullup-10
XXX pullup-9
XXX pullup-8


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/iscsi/dist/src/lib/protocol.c

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

Modified files:

Index: src/external/bsd/iscsi/dist/src/lib/protocol.c
diff -u src/external/bsd/iscsi/dist/src/lib/protocol.c:1.4 src/external/bsd/iscsi/dist/src/lib/protocol.c:1.5
--- src/external/bsd/iscsi/dist/src/lib/protocol.c:1.4	Sat Sep 29 07:18:21 2012
+++ src/external/bsd/iscsi/dist/src/lib/protocol.c	Tue Dec 19 02:16:07 2023
@@ -920,8 +920,8 @@ iscsi_logout_rsp_decap(uint8_t *header, 
 	rsp->StatSN = ISCSI_NTOHL(*((uint32_t *) (void *) (header + 24)));	/* StatSN */
 	rsp->ExpCmdSN = ISCSI_NTOHL(*((uint32_t *) (void *) (header + 28)));	/* ExpCmdSN */
 	rsp->MaxCmdSN = ISCSI_NTOHL(*((uint32_t *) (void *) (header + 32)));	/* MaxCmdSN  */
-	rsp->Time2Wait = ISCSI_NTOHS(*((uint32_t *) (void *) (header + 40)));	/* Time2Wait */
-	rsp->Time2Retain = ISCSI_NTOHS(*((uint32_t *) (void *) (header + 42)));	/* Time2Retain */
+	rsp->Time2Wait = ISCSI_NTOHS(*((uint16_t *) (void *) (header + 40)));	/* Time2Wait */
+	rsp->Time2Retain = ISCSI_NTOHS(*((uint16_t *) (void *) (header + 42)));	/* Time2Retain */
 
 	errmsg = NULL;
 	(void) memset(zeros, 0x0, sizeof(zeros));



CVS commit: src/external/bsd/iscsi/dist/src/lib

2023-12-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Dec 19 02:16:07 UTC 2023

Modified Files:
src/external/bsd/iscsi/dist/src/lib: protocol.c

Log Message:
libiscsi: Fix types of Time2Wait and Time2Retain in logout decap.

According to https://www.rfc-editor.org/rfc/rfc7143#section-11.15,
these are both 2-byte quantities.  Loading 4-byte quantities and
passing them through ISCSI_NTOHS might have worked by accident on
x86, but it's not gonna fly on big-endian.  (Fortunately sparc64 is
not just big-endian but also strict-alignment so it caught this
problem!)

XXX Is there an upstream for this code?  doc/3RDPARTY doesn't cite
any easily-followed references.

PR port-sparc64/57784

XXX pullup-10
XXX pullup-9
XXX pullup-8


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/iscsi/dist/src/lib/protocol.c

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



CVS commit: src/sys/arch/netwinder/conf

2023-12-18 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Tue Dec 19 01:52:44 UTC 2023

Modified Files:
src/sys/arch/netwinder/conf: GENERIC

Log Message:
netwinder: GENERIC - trim down some

It is still too big to get loaded by the firmware successfully, but
these VERBOSE options and -g symtab are the obvious hogs.


To generate a diff of this commit:
cvs rdiff -u -r1.145 -r1.146 src/sys/arch/netwinder/conf/GENERIC

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/netwinder/conf/GENERIC
diff -u src/sys/arch/netwinder/conf/GENERIC:1.145 src/sys/arch/netwinder/conf/GENERIC:1.146
--- src/sys/arch/netwinder/conf/GENERIC:1.145	Sun Feb 12 14:50:40 2023
+++ src/sys/arch/netwinder/conf/GENERIC	Tue Dec 19 01:52:44 2023
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.145 2023/02/12 14:50:40 abs Exp $
+# $NetBSD: GENERIC,v 1.146 2023/12/19 01:52:44 uwe Exp $
 #
 # GENERIC machine description file
 #
@@ -130,8 +130,8 @@ options 	SYSVSHM		# System V-like memory
 options 	KTRACE		# system call tracing, a la ktrace(1)
 options 	IRQSTATS	# manage IRQ statistics
 #options 	SCSIVERBOSE	# Verbose SCSI errors
-options 	PCIVERBOSE	# Verbose PCI descriptions
-options 	MIIVERBOSE	# Verbose MII autoconfuration messages
+#options 	PCIVERBOSE	# Verbose PCI descriptions
+#options 	MIIVERBOSE	# Verbose MII autoconfuration messages
 #options 	PCI_CONFIG_DUMP	# verbosely dump PCI config space
 #options 	DDB_KEYCODE=0x40
 options 	USERCONF	# userconf(4) support
@@ -146,7 +146,7 @@ options 	SYSCTL_INCLUDE_DESCR	# Include 
 #options 	UVMHIST		# kernhist for uvm/pmap subsystems
 options 	DDB		# in-kernel debugger
 options 	DDB_HISTORY_SIZE=100	# Enable history editing in DDB
-makeoptions	DEBUG="-g"	# compile full symbol table
+#makeoptions	DEBUG="-g"	# compile full symbol table
 makeoptions	COPY_SYMTAB=1
 
 config		netbsd	root on ? type ?



CVS commit: src/sys/arch/netwinder/conf

2023-12-18 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Tue Dec 19 01:52:44 UTC 2023

Modified Files:
src/sys/arch/netwinder/conf: GENERIC

Log Message:
netwinder: GENERIC - trim down some

It is still too big to get loaded by the firmware successfully, but
these VERBOSE options and -g symtab are the obvious hogs.


To generate a diff of this commit:
cvs rdiff -u -r1.145 -r1.146 src/sys/arch/netwinder/conf/GENERIC

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



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

2023-12-18 Thread Kalvis Duckmanton
Module Name:src
Committed By:   kalvisd
Date:   Tue Dec 19 00:29:48 UTC 2023

Modified Files:
src/sys/arch/vax/include: cpu.h

Log Message:
vax: PR port-vax/55415

Remove VAX-specific workaround to force pre-emption, as it is now
no longer needed.

tested by oster@


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.108 src/sys/arch/vax/include/cpu.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/vax/include/cpu.h
diff -u src/sys/arch/vax/include/cpu.h:1.107 src/sys/arch/vax/include/cpu.h:1.108
--- src/sys/arch/vax/include/cpu.h:1.107	Sun Sep 10 00:15:52 2023
+++ src/sys/arch/vax/include/cpu.h	Tue Dec 19 00:29:48 2023
@@ -1,4 +1,4 @@
-/*  $NetBSD: cpu.h,v 1.107 2023/09/10 00:15:52 oster Exp $  */
+/*  $NetBSD: cpu.h,v 1.108 2023/12/19 00:29:48 kalvisd Exp $  */
 
 /*
  * Copyright (c) 1994 Ludd, University of Lule}, Sweden
@@ -156,15 +156,10 @@ extern int cpu_printfataltraps;
 #define	curcpu()		(curlwp->l_cpu + 0)
 #define	curlwp			((struct lwp *)mfpr(PR_SSP))
 #define	cpu_number()		(curcpu()->ci_cpuid)
-/* XXX RESCHED_REMOTE isn't the right flag name to be used here,
-but we need to set ci_want_resched to '1' to make things work 
-on vax.  See PR#55415 */
 #define	cpu_need_resched(ci, l, flags)		\
 	do {			\
 		struct pcb *pcb = lwp_getpcb(curlwp);		\
 		__USE(flags);	\
-		/* XXX RESCHED_REMOTE isn't the right flag */   \
-		(ci)->ci_want_resched = RESCHED_REMOTE;		\
 		pcb->P0LR = (pcb->P0LR & ~AST_MASK) | AST_ON;	\
 		mtpr(AST_OK,PR_ASTLVL);\
 	} while (/*CONSTCOND*/ 0)



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

2023-12-18 Thread Kalvis Duckmanton
Module Name:src
Committed By:   kalvisd
Date:   Tue Dec 19 00:29:48 UTC 2023

Modified Files:
src/sys/arch/vax/include: cpu.h

Log Message:
vax: PR port-vax/55415

Remove VAX-specific workaround to force pre-emption, as it is now
no longer needed.

tested by oster@


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.108 src/sys/arch/vax/include/cpu.h

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



CVS commit: src/sys/arch/netwinder/conf

2023-12-18 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Mon Dec 18 23:12:43 UTC 2023

Modified Files:
src/sys/arch/netwinder/conf: kern.ldscript

Log Message:
netwinder: fix base, minimize kern.ldscript diff with evbarm

New binutils align to 0x1, not 0x8000 (which makes sense), so
adjust the base to be 0x1 so that we are loaded at a page boundary
and (I guess) don't smash the firmware in the first page.  While here,
sync with ldscript.evbarm.

Makes my netwinder boot again.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/netwinder/conf/kern.ldscript

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/netwinder/conf/kern.ldscript
diff -u src/sys/arch/netwinder/conf/kern.ldscript:1.10 src/sys/arch/netwinder/conf/kern.ldscript:1.11
--- src/sys/arch/netwinder/conf/kern.ldscript:1.10	Sun Aug 23 08:57:25 2015
+++ src/sys/arch/netwinder/conf/kern.ldscript	Mon Dec 18 23:12:43 2023
@@ -1,29 +1,45 @@
-/*	$NetBSD: kern.ldscript,v 1.10 2015/08/23 08:57:25 uebayasi Exp $	*/
+/*	$NetBSD: kern.ldscript,v 1.11 2023/12/18 23:12:43 uwe Exp $	*/
 
-ENTRY(KERNEL_BASE_phys)
 SECTIONS
 {
+  KERNEL_BASE_phys = 0x0001;
+  KERNEL_BASE_virt = 0xf001;
+
   /* Kernel start: */
-  .start :
+  .start (KERNEL_BASE_phys) :
   {
 *(.start)
   }
 
   /* Read-only sections, merged into text segment: */
-  .text :
+  .text (KERNEL_BASE_virt + SIZEOF(.start)) :
+  AT (LOADADDR(.start) + SIZEOF(.start))
   {
 *(.text)
 *(.text.*)
 *(.stub)
 *(.glue_7t) *(.glue_7)
-*(.rodata) *(.rodata.*)
   }
+
+  PROVIDE(__rodata_start = .);
+  .rodata :
+  {
+*(.rodata)
+*(.rodata.*)
+. = ALIGN(64);
+__CTOR_LIST__ = .;
+*(.ctors)
+*(.init_array)
+__CTOR_END__ = .;
+  }
+
   PROVIDE (__etext = .);
   PROVIDE (_etext = .);
   PROVIDE (etext = .);
-  /* Adjust the address for the data segment to start on the next page
+
+  /* Adjust the address for the data segment to start on the next large page
  boundary.  */
-  . = ALIGN(0x8000);
+  . = ALIGN(0x1);
   .data:
   {
 __data_start = . ;
@@ -35,6 +51,7 @@ SECTIONS
 *(.sdata)
 *(.sdata.*)
   }
+  . = ALIGN(8);
   _edata = .;
   PROVIDE (edata = .);
   __bss_start = .;
@@ -66,25 +83,3 @@ SECTIONS
   _bss_end__ = . ; __bss_end__ = . ; __end__ = . ;
   PROVIDE (end = .);
 }
-SECTIONS
-{
-  KERNEL_BASE_phys = 0xc000;
-  KERNEL_BASE_virt = 0xf000c000;
-
-  .start (KERNEL_BASE_phys) :
-  {
-*(.start)
-  } =0
-
-  .text (KERNEL_BASE_virt + SIZEOF(.start)) :
-  AT (LOADADDR(.start) + SIZEOF(.start))
-  {
-*(.text)
-  } =0
-
-  .data :
-  AT (LOADADDR(.text) + (ADDR(.data) - ADDR(.text)))
-  {
-*(.data)
-  }
-}



CVS commit: src/sys/arch/netwinder/conf

2023-12-18 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Mon Dec 18 23:12:43 UTC 2023

Modified Files:
src/sys/arch/netwinder/conf: kern.ldscript

Log Message:
netwinder: fix base, minimize kern.ldscript diff with evbarm

New binutils align to 0x1, not 0x8000 (which makes sense), so
adjust the base to be 0x1 so that we are loaded at a page boundary
and (I guess) don't smash the firmware in the first page.  While here,
sync with ldscript.evbarm.

Makes my netwinder boot again.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/netwinder/conf/kern.ldscript

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



CVS commit: src/sys/arch/netwinder/conf

2023-12-18 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Mon Dec 18 23:05:25 UTC 2023

Modified Files:
src/sys/arch/netwinder/conf: Makefile.netwinder.inc std.netwinder

Log Message:
netwinder: specify kernel make variables in the makefile

There's not much sense to specify makeoptions in std.netwinder for
config(1) to move them to the generated makefile, when there's already
Makefile.netwinder.inc where these variables can be specified directly.

Move ENTRYPOINT.  Do NOT move LOADADDRESS - we don't want to use it as
it is kinda wrong and it will override the ld script.  Instead
explicitly set LINKTEXT to be empty to avoid the common kernel
makefile to supply the unwanted -Ttext option.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/netwinder/conf/Makefile.netwinder.inc
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/netwinder/conf/std.netwinder

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



CVS commit: src/sys/arch/netwinder/conf

2023-12-18 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Mon Dec 18 23:05:25 UTC 2023

Modified Files:
src/sys/arch/netwinder/conf: Makefile.netwinder.inc std.netwinder

Log Message:
netwinder: specify kernel make variables in the makefile

There's not much sense to specify makeoptions in std.netwinder for
config(1) to move them to the generated makefile, when there's already
Makefile.netwinder.inc where these variables can be specified directly.

Move ENTRYPOINT.  Do NOT move LOADADDRESS - we don't want to use it as
it is kinda wrong and it will override the ld script.  Instead
explicitly set LINKTEXT to be empty to avoid the common kernel
makefile to supply the unwanted -Ttext option.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/netwinder/conf/Makefile.netwinder.inc
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/netwinder/conf/std.netwinder

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/netwinder/conf/Makefile.netwinder.inc
diff -u src/sys/arch/netwinder/conf/Makefile.netwinder.inc:1.11 src/sys/arch/netwinder/conf/Makefile.netwinder.inc:1.12
--- src/sys/arch/netwinder/conf/Makefile.netwinder.inc:1.11	Mon Aug 24 14:04:24 2015
+++ src/sys/arch/netwinder/conf/Makefile.netwinder.inc	Mon Dec 18 23:05:25 2023
@@ -1,8 +1,12 @@
-#	$NetBSD: Makefile.netwinder.inc,v 1.11 2015/08/24 14:04:24 uebayasi Exp $
+#	$NetBSD: Makefile.netwinder.inc,v 1.12 2023/12/18 23:05:25 uwe Exp $
 
 CPPFLAGS+=	-D${MACHINE}
 
 SYSTEM_FIRST_OBJ=	nwmmu.o
 SYSTEM_FIRST_SFILE=	${THISARM}/${MACHINE}/nwmmu.S
+ENTRYPOINT=		nwstart
 
+# don't let Makefile.kern.inc override placement of the text segment
+# specified in the ld script
 KERNLDSCRIPT=		${THISARM}/conf/kern.ldscript
+LINKTEXT=		# suppress -Ttext

Index: src/sys/arch/netwinder/conf/std.netwinder
diff -u src/sys/arch/netwinder/conf/std.netwinder:1.16 src/sys/arch/netwinder/conf/std.netwinder:1.17
--- src/sys/arch/netwinder/conf/std.netwinder:1.16	Fri Sep 21 14:22:37 2012
+++ src/sys/arch/netwinder/conf/std.netwinder	Mon Dec 18 23:05:25 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: std.netwinder,v 1.16 2012/09/21 14:22:37 matt Exp $
+#	$NetBSD: std.netwinder,v 1.17 2023/12/18 23:05:25 uwe Exp $
 #
 # standard NetBSD/netwinder options
 
@@ -16,8 +16,5 @@ options 	_ARM32_NEED_BUS_DMA_BOUNCE
 
 options 	ARM_INTR_IMPL=""
 
-makeoptions	LOADADDRESS="0xF000C000"
-makeoptions	ENTRYPOINT="nwstart"
-
 # Firmware leaves pckbc uninited
 options 	PCKBC_CNATTACH_SELFTEST



CVS commit: src/sys/arch/vax/vax

2023-12-18 Thread Kalvis Duckmanton
Module Name:src
Committed By:   kalvisd
Date:   Mon Dec 18 22:40:01 UTC 2023

Modified Files:
src/sys/arch/vax/vax: subr.S

Log Message:
vax: preserve AST requests raised when handling software interrupts

PR port-vax/55415

On return from a software interrupt, if the software interrupt LWP
raised an AST request, copy the AST level from its PCB to the PCB
of the interrupted LWP.

Reviewed by 


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/vax/vax/subr.S

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/vax/vax/subr.S
diff -u src/sys/arch/vax/vax/subr.S:1.42 src/sys/arch/vax/vax/subr.S:1.43
--- src/sys/arch/vax/vax/subr.S:1.42	Thu Feb 23 14:57:08 2023
+++ src/sys/arch/vax/vax/subr.S	Mon Dec 18 22:40:01 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr.S,v 1.42 2023/02/23 14:57:08 riastradh Exp $	   */
+/*	$NetBSD: subr.S,v 1.43 2023/12/18 22:40:01 kalvisd Exp $	   */
 
 /*
  * Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@@ -319,7 +319,18 @@ softint_process:
 	movl	%r6,CI_CURLWP(%r8)
 	/* XXX store-before-load barrier -- see cpu_switchto */
 #endif
-
+	/* copy AST level from current LWP to pinned LWP, reset
+	   current AST level */
+	mfpr	$PR_SSP,%r4		/* current LWP */
+	movl	L_PCB(%r4),%r4		/* PCB address */
+	movl	P0LR(%r4),%r0		/* LR and ASTLVL field, current PCB */
+	movl	P0LR(%r3),%r1		/* same, pinned LWP */
+	cmpl	%r0,%r1
+	bgtru	1f			/* AST(current) >= AST(pinned) */
+	extv	$24,$3,%r0,%r0		/* ASTLVL field for current LWP */
+	insv	%r0,$24,$3,P0LR(%r3)	/* copy to pinned LWP */
+	insv	$4,$24,$3,P0LR(%r4)	/* reset AST for current LWP */
+1:
 	mtpr	PCB_PADDR(%r3),$PR_PCBB	/* restore PA of interrupted pcb */
 	ldpctx/* implicitly updates curlwp */
 	rei



CVS commit: src/sys/arch/vax/vax

2023-12-18 Thread Kalvis Duckmanton
Module Name:src
Committed By:   kalvisd
Date:   Mon Dec 18 22:40:01 UTC 2023

Modified Files:
src/sys/arch/vax/vax: subr.S

Log Message:
vax: preserve AST requests raised when handling software interrupts

PR port-vax/55415

On return from a software interrupt, if the software interrupt LWP
raised an AST request, copy the AST level from its PCB to the PCB
of the interrupted LWP.

Reviewed by 


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/vax/vax/subr.S

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



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

2023-12-18 Thread Kalvis Duckmanton
Module Name:src
Committed By:   kalvisd
Date:   Mon Dec 18 21:11:43 UTC 2023

Modified Files:
src/external/gpl3/gcc.old/dist/gcc: reload1.c

Log Message:
gcc.old: vax: gcc/reload1.c: PR port-vax/57646

Where an output register might be reloaded, and it is a memory
reference, and the address is auto-incremented, any previously
reloaded copy of the address must be invalidated.

XXXKD: Hidden within ``#ifdef NB_FIX_VAX_BACKEND'' and enabled
only for vax at the moment.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/gpl3/gcc.old/dist/gcc/reload1.c

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



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

2023-12-18 Thread Kalvis Duckmanton
Module Name:src
Committed By:   kalvisd
Date:   Mon Dec 18 21:11:43 UTC 2023

Modified Files:
src/external/gpl3/gcc.old/dist/gcc: reload1.c

Log Message:
gcc.old: vax: gcc/reload1.c: PR port-vax/57646

Where an output register might be reloaded, and it is a memory
reference, and the address is auto-incremented, any previously
reloaded copy of the address must be invalidated.

XXXKD: Hidden within ``#ifdef NB_FIX_VAX_BACKEND'' and enabled
only for vax at the moment.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/gpl3/gcc.old/dist/gcc/reload1.c

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

Modified files:

Index: src/external/gpl3/gcc.old/dist/gcc/reload1.c
diff -u src/external/gpl3/gcc.old/dist/gcc/reload1.c:1.11 src/external/gpl3/gcc.old/dist/gcc/reload1.c:1.12
--- src/external/gpl3/gcc.old/dist/gcc/reload1.c:1.11	Mon Feb 20 02:11:07 2023
+++ src/external/gpl3/gcc.old/dist/gcc/reload1.c	Mon Dec 18 21:11:42 2023
@@ -8377,6 +8377,44 @@ emit_reload_insns (class insn_chain *cha
 		reg_last_reload_reg[out_regno + k] = 0;
 	}
 	}
+
+#ifdef NB_FIX_VAX_BACKEND
+#if AUTO_INC_DEC
+  /* Where an output register might be reloaded, and it is a
+	 memory reference, and the address is auto-incremented, any
+	 previously reloaded copy of the address must be
+	 invalidated. */
+  if (i < 0
+	  && rld[r].out != 0
+	  && MEM_P (rld[r].out))
+	{
+	  rtx out = XEXP (rld[r].out, 0); /* address expression */
+	  enum rtx_code code = GET_CODE (out);
+
+	  if (code != POST_INC && code != POST_DEC
+	  && code != PRE_INC && code != PRE_DEC)
+	{
+	  /* do nothing */
+	}
+	  else
+	{
+	  int out_regno = REGNO (XEXP (out, 0));
+	  machine_mode mode = GET_MODE (XEXP (out, 0));
+
+	  /* for the moment, handle only the case where out_regno
+		 is a hardware register */
+
+	  if (HARD_REGISTER_NUM_P (out_regno))
+		{
+		  int k, out_nregs = hard_regno_nregs (out_regno, mode);
+
+		  for (k = 0; k < out_nregs; k++)
+		reg_last_reload_reg[out_regno + k] = 0;
+		}
+	}
+	}
+#endif /* AUTO_INC_DEC */
+#endif
 }
   reg_reloaded_dead |= reg_reloaded_died;
 }



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

2023-12-18 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Mon Dec 18 16:03:26 UTC 2023

Modified Files:
src/external/bsd/dhcpcd/dist/src: bpf.c

Log Message:
Fix import


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/external/bsd/dhcpcd/dist/src/bpf.c

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



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

2023-12-18 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Mon Dec 18 16:03:26 UTC 2023

Modified Files:
src/external/bsd/dhcpcd/dist/src: bpf.c

Log Message:
Fix import


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/external/bsd/dhcpcd/dist/src/bpf.c

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

Modified files:

Index: src/external/bsd/dhcpcd/dist/src/bpf.c
diff -u src/external/bsd/dhcpcd/dist/src/bpf.c:1.21 src/external/bsd/dhcpcd/dist/src/bpf.c:1.22
--- src/external/bsd/dhcpcd/dist/src/bpf.c:1.21	Mon Dec 18 15:51:28 2023
+++ src/external/bsd/dhcpcd/dist/src/bpf.c	Mon Dec 18 16:03:26 2023
@@ -41,7 +41,6 @@
 #define	bpf_insn		sock_filter
 #else
 #include 
-#include 
 #endif
 
 #include 
@@ -316,34 +315,17 @@ ssize_t
 bpf_send(const struct bpf *bpf, uint16_t protocol,
 const void *data, size_t len)
 {
-	struct iovec iov[3];
+	struct iovec iov[2];
 	struct ether_header eh;
-	struct ether_vlan_header evh;
-	const struct interface *ifp = bpf->bpf_ifp;
 
-	switch(ifp->hwtype) {
+	switch(bpf->bpf_ifp->hwtype) {
 	case ARPHRD_ETHER:
-#ifdef BSD
-		loginfox("%d", ifp->vlanid);
-		if (ifp->vlanid) {
-			memset(_dhost, 0xff, sizeof(evh.evl_dhost));
-			memcpy(_shost, ifp->hwaddr,
-			sizeof(evh.evl_shost));
-			evh.evl_proto = htons(protocol);
-			evh.evl_encap_proto = htons(ETHERTYPE_VLAN);
-			evh.evl_tag = htons(ifp->vlanid);
-			iov[0].iov_base = 
-			iov[0].iov_len = sizeof(evh);
-		} else
-#endif
-		{
-			memset(_dhost, 0xff, sizeof(eh.ether_dhost));
-			memcpy(_shost, ifp->hwaddr,
-			sizeof(eh.ether_shost));
-			eh.ether_type = htons(protocol);
-			iov[0].iov_base = 
-			iov[0].iov_len = sizeof(eh);
-		}
+		memset(_dhost, 0xff, sizeof(eh.ether_dhost));
+		memcpy(_shost, bpf->bpf_ifp->hwaddr,
+		sizeof(eh.ether_shost));
+		eh.ether_type = htons(protocol);
+		iov[0].iov_base = 
+		iov[0].iov_len = sizeof(eh);
 		break;
 	default:
 		iov[0].iov_base = NULL;
@@ -712,7 +694,7 @@ int
 bpf_bootp(const struct bpf *bpf, __unused const struct in_addr *ia)
 {
 
-#ifdef BIOCSETWFx
+#ifdef BIOCSETWF
 	if (bpf_bootp_rw(bpf, true) == -1 ||
 	bpf_bootp_rw(bpf, false) == -1 ||
 	ioctl(bpf->bpf_fd, BIOCLOCK) == -1)



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

2023-12-18 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Mon Dec 18 16:01:31 UTC 2023

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

Log Message:
re-import dhcpcd-10.0.6 as 10.0.6a

I mistakenly had a dirty checkout.

Status:

Vendor Tag: ROY
Release Tags:   dhcpcd-10_0_6a

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

No conflicts created by this import



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

2023-12-18 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Mon Dec 18 16:01:31 UTC 2023

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

Log Message:
re-import dhcpcd-10.0.6 as 10.0.6a

I mistakenly had a dirty checkout.

Status:

Vendor Tag: ROY
Release Tags:   dhcpcd-10_0_6a

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

No conflicts created by this import



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

2023-12-18 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Mon Dec 18 15:56:33 UTC 2023

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

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

privsep: Stop proxying stderr to console and fix some detachment issues
non-privsep: Fix launcher hangup
DHCP6: Allow the invalid interface name - to mean don't assign an address 
from a delegated prefix
DHCP6: Load the configuration for the interface being activated from prefix 
delegation

Status:

Vendor Tag: ROY
Release Tags:   dhcpcd-10_0_6

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

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

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



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

2023-12-18 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Mon Dec 18 15:56:33 UTC 2023

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

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

privsep: Stop proxying stderr to console and fix some detachment issues
non-privsep: Fix launcher hangup
DHCP6: Allow the invalid interface name - to mean don't assign an address 
from a delegated prefix
DHCP6: Load the configuration for the interface being activated from prefix 
delegation

Status:

Vendor Tag: ROY
Release Tags:   dhcpcd-10_0_6

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

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

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



CVS commit: src/doc

2023-12-18 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Mon Dec 18 15:52:37 UTC 2023

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
Note dhcpcd-10.0.6


To generate a diff of this commit:
cvs rdiff -u -r1.1967 -r1.1968 src/doc/3RDPARTY
cvs rdiff -u -r1.3022 -r1.3023 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.1967 src/doc/3RDPARTY:1.1968
--- src/doc/3RDPARTY:1.1967	Mon Dec 18 15:42:26 2023
+++ src/doc/3RDPARTY	Mon Dec 18 15:52:37 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1967 2023/12/18 15:42:26 wiz Exp $
+#	$NetBSD: 3RDPARTY,v 1.1968 2023/12/18 15:52:37 roy Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -352,13 +352,13 @@ Notes:
 Use the dhcp2netbsd script.
 
 Package:	dhcpcd
-Version:	10.0.4
-Current Vers:	10.0.4
+Version:	10.0.6
+Current Vers:	10.0.6
 Maintainer:	roy
 Archive Site:	https://github.com/NetworkConfiguration/dhcpcd/releases
 Home Page:	https://roy.marples.name/projects/dhcpcd/
 Home Page:	https://github.com/NetworkConfiguration/dhcpcd
-Date:		2023-10-19
+Date:		2023-12-18
 License:	BSD (2-clause)
 Location:	external/bsd/dhcpcd/dist
 Notes:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.3022 src/doc/CHANGES:1.3023
--- src/doc/CHANGES:1.3022	Wed Dec 13 08:20:04 2023
+++ src/doc/CHANGES	Mon Dec 18 15:52:37 2023
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.3022 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.3023 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -241,3 +241,5 @@ Changes from NetBSD 10.0 to NetBSD 11.0:
 		to be used VERY early in boot. [thorpej 20231203]
 	kernel: Modularize compat90. [pgoyette 20231209]
 	libsa: Add NFSv3 support. [mlelstv 20231212]
+	dhcpcd: Import version 10.0.6. [roy 20231218]
+



CVS commit: src/doc

2023-12-18 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Mon Dec 18 15:52:37 UTC 2023

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
Note dhcpcd-10.0.6


To generate a diff of this commit:
cvs rdiff -u -r1.1967 -r1.1968 src/doc/3RDPARTY
cvs rdiff -u -r1.3022 -r1.3023 src/doc/CHANGES

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



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

2023-12-18 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Mon Dec 18 15:51:28 UTC 2023

Modified Files:
src/external/bsd/dhcpcd/dist/src: bpf.c dhcp.c dhcp6.c dhcpcd.c
if-options.c privsep.c

Log Message:
Sync with dhcpcd-10.0.6


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/external/bsd/dhcpcd/dist/src/bpf.c
cvs rdiff -u -r1.49 -r1.50 src/external/bsd/dhcpcd/dist/src/dhcp.c
cvs rdiff -u -r1.31 -r1.32 src/external/bsd/dhcpcd/dist/src/dhcp6.c
cvs rdiff -u -r1.53 -r1.54 src/external/bsd/dhcpcd/dist/src/dhcpcd.c
cvs rdiff -u -r1.35 -r1.36 src/external/bsd/dhcpcd/dist/src/if-options.c
cvs rdiff -u -r1.17 -r1.18 src/external/bsd/dhcpcd/dist/src/privsep.c

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

Modified files:

Index: src/external/bsd/dhcpcd/dist/src/bpf.c
diff -u src/external/bsd/dhcpcd/dist/src/bpf.c:1.20 src/external/bsd/dhcpcd/dist/src/bpf.c:1.21
--- src/external/bsd/dhcpcd/dist/src/bpf.c:1.20	Wed Jul 19 13:53:03 2023
+++ src/external/bsd/dhcpcd/dist/src/bpf.c	Mon Dec 18 15:51:28 2023
@@ -41,6 +41,7 @@
 #define	bpf_insn		sock_filter
 #else
 #include 
+#include 
 #endif
 
 #include 
@@ -315,17 +316,34 @@ ssize_t
 bpf_send(const struct bpf *bpf, uint16_t protocol,
 const void *data, size_t len)
 {
-	struct iovec iov[2];
+	struct iovec iov[3];
 	struct ether_header eh;
+	struct ether_vlan_header evh;
+	const struct interface *ifp = bpf->bpf_ifp;
 
-	switch(bpf->bpf_ifp->hwtype) {
+	switch(ifp->hwtype) {
 	case ARPHRD_ETHER:
-		memset(_dhost, 0xff, sizeof(eh.ether_dhost));
-		memcpy(_shost, bpf->bpf_ifp->hwaddr,
-		sizeof(eh.ether_shost));
-		eh.ether_type = htons(protocol);
-		iov[0].iov_base = 
-		iov[0].iov_len = sizeof(eh);
+#ifdef BSD
+		loginfox("%d", ifp->vlanid);
+		if (ifp->vlanid) {
+			memset(_dhost, 0xff, sizeof(evh.evl_dhost));
+			memcpy(_shost, ifp->hwaddr,
+			sizeof(evh.evl_shost));
+			evh.evl_proto = htons(protocol);
+			evh.evl_encap_proto = htons(ETHERTYPE_VLAN);
+			evh.evl_tag = htons(ifp->vlanid);
+			iov[0].iov_base = 
+			iov[0].iov_len = sizeof(evh);
+		} else
+#endif
+		{
+			memset(_dhost, 0xff, sizeof(eh.ether_dhost));
+			memcpy(_shost, ifp->hwaddr,
+			sizeof(eh.ether_shost));
+			eh.ether_type = htons(protocol);
+			iov[0].iov_base = 
+			iov[0].iov_len = sizeof(eh);
+		}
 		break;
 	default:
 		iov[0].iov_base = NULL;
@@ -694,7 +712,7 @@ int
 bpf_bootp(const struct bpf *bpf, __unused const struct in_addr *ia)
 {
 
-#ifdef BIOCSETWF
+#ifdef BIOCSETWFx
 	if (bpf_bootp_rw(bpf, true) == -1 ||
 	bpf_bootp_rw(bpf, false) == -1 ||
 	ioctl(bpf->bpf_fd, BIOCLOCK) == -1)

Index: src/external/bsd/dhcpcd/dist/src/dhcp.c
diff -u src/external/bsd/dhcpcd/dist/src/dhcp.c:1.49 src/external/bsd/dhcpcd/dist/src/dhcp.c:1.50
--- src/external/bsd/dhcpcd/dist/src/dhcp.c:1.49	Fri Oct  6 08:49:42 2023
+++ src/external/bsd/dhcpcd/dist/src/dhcp.c	Mon Dec 18 15:51:28 2023
@@ -1896,12 +1896,29 @@ dhcp_discover(void *arg)
 }
 
 static void
+dhcp_requestfailed(void *arg)
+{
+	struct interface *ifp = arg;
+	struct dhcp_state *state = D_STATE(ifp);
+
+	logwarnx("%s: failed to request the lease", ifp->name);
+	free(state->offer);
+	state->offer = NULL;
+	state->offer_len = 0;
+	state->interval = 0;
+	dhcp_discover(ifp);
+}
+
+static void
 dhcp_request(void *arg)
 {
 	struct interface *ifp = arg;
 	struct dhcp_state *state = D_STATE(ifp);
 
 	state->state = DHS_REQUEST;
+	// Handle the server being silent to our request.
+	eloop_timeout_add_sec(ifp->ctx->eloop, ifp->options->reboot,
+	dhcp_requestfailed, ifp);
 	send_request(ifp);
 }
 

Index: src/external/bsd/dhcpcd/dist/src/dhcp6.c
diff -u src/external/bsd/dhcpcd/dist/src/dhcp6.c:1.31 src/external/bsd/dhcpcd/dist/src/dhcp6.c:1.32
--- src/external/bsd/dhcpcd/dist/src/dhcp6.c:1.31	Fri Oct  6 08:49:42 2023
+++ src/external/bsd/dhcpcd/dist/src/dhcp6.c	Mon Dec 18 15:51:28 2023
@@ -2589,21 +2589,17 @@ dhcp6_validatelease(struct interface *if
 	}
 	state->has_no_binding = false;
 	nia = dhcp6_findia(ifp, m, len, sfrom, acquired);
-	if (nia == 0) {
-		if (state->state != DH6S_CONFIRM && ok_errno != 0) {
-			logerrx("%s: no useable IA found in lease", ifp->name);
-			return -1;
-		}
-
-		/* We are confirming and have an OK,
-		 * so look for ia's in our old lease.
-		 * IA's must have existed here otherwise we would
-		 * have rejected it earlier. */
-		assert(state->new != NULL && state->new_len != 0);
+	if (nia == 0 && state->state == DH6S_CONFIRM && ok_errno == 0 &&
+	state->new && state->new_len)
+	{
 		state->has_no_binding = false;
 		nia = dhcp6_findia(ifp, state->new, state->new_len,
 		sfrom, acquired);
 	}
+	if (nia == 0) {
+		logerrx("%s: no useable IA found in lease", ifp->name);
+		return -1;
+	}
 	return nia;
 }
 
@@ -2657,8 +2653,10 @@ dhcp6_readlease(struct interface *ifp, i
 	/* Check to see if the lease is still valid */
 	fd = dhcp6_validatelease(ifp, , (size_t)bytes, NULL,
 	>acquired);
-	if (fd == 

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

2023-12-18 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Mon Dec 18 15:51:28 UTC 2023

Modified Files:
src/external/bsd/dhcpcd/dist/src: bpf.c dhcp.c dhcp6.c dhcpcd.c
if-options.c privsep.c

Log Message:
Sync with dhcpcd-10.0.6


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/external/bsd/dhcpcd/dist/src/bpf.c
cvs rdiff -u -r1.49 -r1.50 src/external/bsd/dhcpcd/dist/src/dhcp.c
cvs rdiff -u -r1.31 -r1.32 src/external/bsd/dhcpcd/dist/src/dhcp6.c
cvs rdiff -u -r1.53 -r1.54 src/external/bsd/dhcpcd/dist/src/dhcpcd.c
cvs rdiff -u -r1.35 -r1.36 src/external/bsd/dhcpcd/dist/src/if-options.c
cvs rdiff -u -r1.17 -r1.18 src/external/bsd/dhcpcd/dist/src/privsep.c

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



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

2023-12-18 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Mon Dec 18 15:49:43 UTC 2023

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

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

 * privsep: Stop proxying stderr to console and fix some detachment issues
 * non-privsep: Fix launcher hangup
 * DHCP6: Allow the invalid interface name - to mean don't assign an address 
from a delegated prefix
 * DHCP6: Load the configuration for the interface being activated from prefix 
delegation


Status:

Vendor Tag: ROY
Release Tags:   dhcpcd-10_0_6

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

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

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



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

2023-12-18 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Mon Dec 18 15:49:43 UTC 2023

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

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

 * privsep: Stop proxying stderr to console and fix some detachment issues
 * non-privsep: Fix launcher hangup
 * DHCP6: Allow the invalid interface name - to mean don't assign an address 
from a delegated prefix
 * DHCP6: Load the configuration for the interface being activated from prefix 
delegation


Status:

Vendor Tag: ROY
Release Tags:   dhcpcd-10_0_6

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

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

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



CVS commit: src/doc

2023-12-18 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Dec 18 15:42:26 UTC 2023

Modified Files:
src/doc: 3RDPARTY

Log Message:
doc: openssh 9.6p1 out


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

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1966 src/doc/3RDPARTY:1.1967
--- src/doc/3RDPARTY:1.1966	Sat Dec  9 16:32:20 2023
+++ src/doc/3RDPARTY	Mon Dec 18 15:42:26 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1966 2023/12/09 16:32:20 wiz Exp $
+#	$NetBSD: 3RDPARTY,v 1.1967 2023/12/18 15:42:26 wiz Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1077,11 +1077,11 @@ Patch applied after OpenSSH import.
 
 Package:	OpenSSH
 Version:	9.5
-Current Vers:	9.5 / portable 9.5p1
+Current Vers:	9.6 / portable 9.6p1
 Maintainer:	OpenSSH
 Archive Site:	http://www.openssh.com/ftp.html
 Home Page:	http://www.openssh.com/portable.html
-Date:		2023-07-26
+Date:		2023-12-18
 Mailing List:	openssh-unix-annou...@mindrot.org
 Responsible:	thorpej, christos, elric
 License:	BSD. See src/crypto/external/bsd/openssh/dist/LICENSE



CVS commit: src/doc

2023-12-18 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Dec 18 15:42:26 UTC 2023

Modified Files:
src/doc: 3RDPARTY

Log Message:
doc: openssh 9.6p1 out


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

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



CVS commit: [netbsd-10] src/doc

2023-12-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Dec 18 14:18:58 UTC 2023

Modified Files:
src/doc [netbsd-10]: CHANGES-10.0

Log Message:
Tickets #499 - #506


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.172 -r1.1.2.173 src/doc/CHANGES-10.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-10.0
diff -u src/doc/CHANGES-10.0:1.1.2.172 src/doc/CHANGES-10.0:1.1.2.173
--- src/doc/CHANGES-10.0:1.1.2.172	Thu Dec 14 17:57:38 2023
+++ src/doc/CHANGES-10.0	Mon Dec 18 14:18:58 2023
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-10.0,v 1.1.2.172 2023/12/14 17:57:38 martin Exp $
+# $NetBSD: CHANGES-10.0,v 1.1.2.173 2023/12/18 14:18:58 martin Exp $
 
 A complete list of changes from the initial NetBSD 10.0 branch on 2022-12-16
 until the 10.0 release:
@@ -14350,3 +14350,49 @@ sys/arch/i386/stand/dosboot/Makefile		1.
 	Fix the clang build of x86 booters.
 	[rin, ticket #498]
 
+distrib/notes/common/main			1.571,1.572
+
+	Add note about zfs mount behaviour change in NetBSD 10.
+	[abs, ticket #499]
+
+usr.bin/cvslatest/cvslatest.1			1.2
+
+	cvslatest(1): PR 57778: remove RETURN VALUES.
+	[wiz, ticket #500]
+
+lib/libc/stdlib/jemalloc.c			1.64
+
+	malloc_usable_size(): make it visible with old jemalloc.
+	[mrg, ticket #501]
+
+external/bsd/top/dist/machine/m_netbsd.c	1.29
+
+	top(1): avoid crashes when proc_from_thread() returns NULL.
+	[mrg, ticket #502]
+
+external/bsd/top/dist/machine/m_netbsd.c	1.27,1.28
+
+	top(1): add network in & out bytes to the top display.
+	[mrg, ticket #503]
+
+sbin/iscsictl/iscsic_parse.c			1.5
+sbin/iscsid/iscsid_driverif.c			1.9
+
+	iscsid(8), iscsictl(8): parse IPv6 targets and handle IPv6 addresses.
+	[mlelstv, ticket #504]
+
+sys/dev/iscsi/iscsi.h1.5
+sys/dev/iscsi/iscsi_globals.h			1.28
+sys/dev/iscsi/iscsi_ioctl.c			1.34
+sys/dev/iscsi/iscsi_send.c			1.40
+sys/dev/iscsi/iscsi_text.c			1.14
+sys/dev/iscsi/iscsi_utils.c			1.29
+
+	iscsi: fix a panic in the driver and some minor problems.
+	[mlelstv, ticket #505]
+
+bin/df/df.c	1.102
+
+	df(1): correctly compute the "Filesystem" column width when using -W.
+	[kre, ticket #506]
+



CVS commit: [netbsd-10] src/doc

2023-12-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Dec 18 14:18:58 UTC 2023

Modified Files:
src/doc [netbsd-10]: CHANGES-10.0

Log Message:
Tickets #499 - #506


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.172 -r1.1.2.173 src/doc/CHANGES-10.0

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



CVS commit: [netbsd-10] src/bin/df

2023-12-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Dec 18 14:17:42 UTC 2023

Modified Files:
src/bin/df [netbsd-10]: df.c

Log Message:
Pull up following revision(s) (requested by kre in ticket #506):

bin/df/df.c: revision 1.102

Correctly compute the "Filesystem" column with when using -W
(that added "NAME=" occupies space!)


To generate a diff of this commit:
cvs rdiff -u -r1.101 -r1.101.2.1 src/bin/df/df.c

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

Modified files:

Index: src/bin/df/df.c
diff -u src/bin/df/df.c:1.101 src/bin/df/df.c:1.101.2.1
--- src/bin/df/df.c:1.101	Tue Aug  9 08:14:03 2022
+++ src/bin/df/df.c	Mon Dec 18 14:17:42 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: df.c,v 1.101 2022/08/09 08:14:03 wiz Exp $ */
+/*	$NetBSD: df.c,v 1.101.2.1 2023/12/18 14:17:42 martin Exp $ */
 
 /*
  * Copyright (c) 1980, 1990, 1993, 1994
@@ -45,7 +45,7 @@ __COPYRIGHT(
 #if 0
 static char sccsid[] = "@(#)df.c	8.7 (Berkeley) 4/2/94";
 #else
-__RCSID("$NetBSD: df.c,v 1.101 2022/08/09 08:14:03 wiz Exp $");
+__RCSID("$NetBSD: df.c,v 1.101.2.1 2023/12/18 14:17:42 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -243,8 +243,13 @@ main(int argc, char *argv[])
 
 	maxwidth = 0;
 	for (i = 0; i < mntcount; i++) {
-		width = (int)strlen(Wflag && mntbuf[i].f_mntfromlabel[0] ?
-		mntbuf[i].f_mntfromlabel : mntbuf[i].f_mntfromname);
+		width = 0;
+		if (Wflag && mntbuf[i].f_mntfromlabel[0]) {
+			/* +5 is for "NAME=" added later */
+			width = (int)strlen(mntbuf[i].f_mntfromlabel) + 5;
+		}
+		if (width == 0)
+			width = (int)strlen(mntbuf[i].f_mntfromname);
 		if (width > maxwidth)
 			maxwidth = width;
 		if (cflag)



CVS commit: [netbsd-10] src/bin/df

2023-12-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Dec 18 14:17:42 UTC 2023

Modified Files:
src/bin/df [netbsd-10]: df.c

Log Message:
Pull up following revision(s) (requested by kre in ticket #506):

bin/df/df.c: revision 1.102

Correctly compute the "Filesystem" column with when using -W
(that added "NAME=" occupies space!)


To generate a diff of this commit:
cvs rdiff -u -r1.101 -r1.101.2.1 src/bin/df/df.c

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



CVS commit: [netbsd-10] src/sys/dev/iscsi

2023-12-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Dec 18 14:15:58 UTC 2023

Modified Files:
src/sys/dev/iscsi [netbsd-10]: iscsi.h iscsi_globals.h iscsi_ioctl.c
iscsi_send.c iscsi_text.c iscsi_utils.c

Log Message:
Pull up following revision(s) (requested by mlelstv in ticket #505):

sys/dev/iscsi/iscsi_utils.c: revision 1.29
sys/dev/iscsi/iscsi.h: revision 1.5
sys/dev/iscsi/iscsi_ioctl.c: revision 1.34
sys/dev/iscsi/iscsi_globals.h: revision 1.28
sys/dev/iscsi/iscsi_text.c: revision 1.14
sys/dev/iscsi/iscsi_send.c: revision 1.40

Adapt to bignum representation of target.

Fix negotiation for mutual authentication.

Prepare for more CHAP types.

Fix crashes for invalid socket descriptors passed to kernel.

Protect usecount with connection mutex, avoids race on connection close.

Minor cosmetics.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.50.1 src/sys/dev/iscsi/iscsi.h
cvs rdiff -u -r1.27 -r1.27.4.1 src/sys/dev/iscsi/iscsi_globals.h
cvs rdiff -u -r1.33 -r1.33.4.1 src/sys/dev/iscsi/iscsi_ioctl.c
cvs rdiff -u -r1.39 -r1.39.4.1 src/sys/dev/iscsi/iscsi_send.c
cvs rdiff -u -r1.13 -r1.13.28.1 src/sys/dev/iscsi/iscsi_text.c
cvs rdiff -u -r1.28 -r1.28.4.1 src/sys/dev/iscsi/iscsi_utils.c

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



CVS commit: [netbsd-10] src/sys/dev/iscsi

2023-12-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Dec 18 14:15:58 UTC 2023

Modified Files:
src/sys/dev/iscsi [netbsd-10]: iscsi.h iscsi_globals.h iscsi_ioctl.c
iscsi_send.c iscsi_text.c iscsi_utils.c

Log Message:
Pull up following revision(s) (requested by mlelstv in ticket #505):

sys/dev/iscsi/iscsi_utils.c: revision 1.29
sys/dev/iscsi/iscsi.h: revision 1.5
sys/dev/iscsi/iscsi_ioctl.c: revision 1.34
sys/dev/iscsi/iscsi_globals.h: revision 1.28
sys/dev/iscsi/iscsi_text.c: revision 1.14
sys/dev/iscsi/iscsi_send.c: revision 1.40

Adapt to bignum representation of target.

Fix negotiation for mutual authentication.

Prepare for more CHAP types.

Fix crashes for invalid socket descriptors passed to kernel.

Protect usecount with connection mutex, avoids race on connection close.

Minor cosmetics.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.50.1 src/sys/dev/iscsi/iscsi.h
cvs rdiff -u -r1.27 -r1.27.4.1 src/sys/dev/iscsi/iscsi_globals.h
cvs rdiff -u -r1.33 -r1.33.4.1 src/sys/dev/iscsi/iscsi_ioctl.c
cvs rdiff -u -r1.39 -r1.39.4.1 src/sys/dev/iscsi/iscsi_send.c
cvs rdiff -u -r1.13 -r1.13.28.1 src/sys/dev/iscsi/iscsi_text.c
cvs rdiff -u -r1.28 -r1.28.4.1 src/sys/dev/iscsi/iscsi_utils.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/iscsi/iscsi.h
diff -u src/sys/dev/iscsi/iscsi.h:1.4 src/sys/dev/iscsi/iscsi.h:1.4.50.1
--- src/sys/dev/iscsi/iscsi.h:1.4	Wed Jun 15 04:30:30 2016
+++ src/sys/dev/iscsi/iscsi.h	Mon Dec 18 14:15:58 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: iscsi.h,v 1.4 2016/06/15 04:30:30 mlelstv Exp $	*/
+/*	$NetBSD: iscsi.h,v 1.4.50.1 2023/12/18 14:15:58 martin Exp $	*/
 
 /*-
  * Copyright (c) 2004,2006,2011 The NetBSD Foundation, Inc.
@@ -54,6 +54,13 @@ typedef enum {
   Indicates SRP authentication (for future use).
 */
 
+typedef enum {
+	ISCSI_CHAP_MD5		= 5,
+	ISCSI_CHAP_SHA1		= 6,
+	ISCSI_CHAP_SHA256	= 7,
+	ISCSI_CHAP_SHA3_256	= 8
+} iscsi_chap_types_t;
+
 typedef struct {
 	unsigned int		mutual_auth:1;
 	unsigned int		is_secure:1;

Index: src/sys/dev/iscsi/iscsi_globals.h
diff -u src/sys/dev/iscsi/iscsi_globals.h:1.27 src/sys/dev/iscsi/iscsi_globals.h:1.27.4.1
--- src/sys/dev/iscsi/iscsi_globals.h:1.27	Tue Sep 13 13:09:16 2022
+++ src/sys/dev/iscsi/iscsi_globals.h	Mon Dec 18 14:15:58 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: iscsi_globals.h,v 1.27 2022/09/13 13:09:16 mlelstv Exp $	*/
+/*	$NetBSD: iscsi_globals.h,v 1.27.4.1 2023/12/18 14:15:58 martin Exp $	*/
 
 /*-
  * Copyright (c) 2004,2005,2006,2011 The NetBSD Foundation, Inc.
@@ -135,11 +135,10 @@
 /* Connection state */
 
 typedef enum {
-	/* first three correspond to CSG/NSG coding */
 	ST_SEC_NEG	= 0,	/* security negotiation phase */
-	ST_OP_NEG	= 1,	/* operational negotiation phase */
+	ST_SEC_FIN  	= 1,	/* switch from SEC after mutual CHAP */
+	ST_OP_NEG	= 2,	/* operational negotiation phase */
 	ST_FULL_FEATURE	= 3,	/* full feature phase */
-	/* rest is internal */
 	ST_WINDING_DOWN	= 4,	/* connection termination initiated, logging out */
 	ST_LOGOUT_SENT	= 5,	/* logout has been sent */
 	ST_SETTLING	= 6,	/* waiting for things to settle down */

Index: src/sys/dev/iscsi/iscsi_ioctl.c
diff -u src/sys/dev/iscsi/iscsi_ioctl.c:1.33 src/sys/dev/iscsi/iscsi_ioctl.c:1.33.4.1
--- src/sys/dev/iscsi/iscsi_ioctl.c:1.33	Tue Sep 13 13:09:16 2022
+++ src/sys/dev/iscsi/iscsi_ioctl.c	Mon Dec 18 14:15:58 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: iscsi_ioctl.c,v 1.33 2022/09/13 13:09:16 mlelstv Exp $	*/
+/*	$NetBSD: iscsi_ioctl.c,v 1.33.4.1 2023/12/18 14:15:58 martin Exp $	*/
 
 /*-
  * Copyright (c) 2004,2005,2006,2011 The NetBSD Foundation, Inc.
@@ -728,18 +728,11 @@ create_connection(iscsi_login_parameters
 	}
 
 	rc = get_socket(par->socket, >c_sock);
-	fd_close(par->socket);
+	if (rc != EBADF)
+		fd_close(par->socket);
 
 	if (rc) {
 		DEBOUT(("Invalid socket %d\n", par->socket));
-
-		callout_destroy(>c_timeout);
-		rw_destroy(>c_sock_rw);
-		cv_destroy(>c_idle_cv);
-		cv_destroy(>c_ccb_cv);
-		cv_destroy(>c_pdu_cv);
-		cv_destroy(>c_conn_cv);
-		mutex_destroy(>c_lock);
 		free(conn, M_DEVBUF);
 		par->status = ISCSI_STATUS_INVALID_SOCKET;
 		return rc;
@@ -901,11 +894,13 @@ recreate_connection(iscsi_login_paramete
 		DEBOUT(("Too many connections (max = %d, curr = %d)\n",
 			sess->s_MaxConnections, sess->s_active_connections));
 
-		/* Always close the desecriptor */
-		fd_close(par->socket);
+		/* Close the desecriptor */
+		rc = EIO;
+		if (fd_getfile(par->socket) != NULL)
+			rc = fd_close(par->socket);
 
 		par->status = ISCSI_STATUS_MAXED_CONNECTIONS;
-		return EIO;
+		return rc;
 	}
 
 	rw_enter(>c_sock_rw, RW_WRITER);
@@ -915,7 +910,8 @@ recreate_connection(iscsi_login_paramete
 	}
 	rc = get_socket(par->socket, >c_sock);
 	rw_exit(>c_sock_rw);
-	fd_close(par->socket);
+	if (rc != EBADF)
+		fd_close(par->socket);
 
 	if (rc) {
 		DEBOUT(("Invalid socket 

CVS commit: [netbsd-10] src/sbin

2023-12-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Dec 18 14:12:35 UTC 2023

Modified Files:
src/sbin/iscsictl [netbsd-10]: iscsic_parse.c
src/sbin/iscsid [netbsd-10]: iscsid_driverif.c

Log Message:
Pull up following revision(s) (requested by mlelstv in ticket #504):

sbin/iscsictl/iscsic_parse.c: revision 1.5
sbin/iscsid/iscsid_driverif.c: revision 1.9

Parse IPv6 targets and handle IPv6 addresses.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.2.1 src/sbin/iscsictl/iscsic_parse.c
cvs rdiff -u -r1.8 -r1.8.26.1 src/sbin/iscsid/iscsid_driverif.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/iscsictl/iscsic_parse.c
diff -u src/sbin/iscsictl/iscsic_parse.c:1.4 src/sbin/iscsictl/iscsic_parse.c:1.4.2.1
--- src/sbin/iscsictl/iscsic_parse.c:1.4	Fri Dec  3 13:27:38 2021
+++ src/sbin/iscsictl/iscsic_parse.c	Mon Dec 18 14:12:35 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: iscsic_parse.c,v 1.4 2021/12/03 13:27:38 andvar Exp $	*/
+/*	$NetBSD: iscsic_parse.c,v 1.4.2.1 2023/12/18 14:12:35 martin Exp $	*/
 
 /*-
  * Copyright (c) 2005,2006,2011 The NetBSD Foundation, Inc.
@@ -48,50 +48,62 @@
 STATIC void
 get_address(iscsi_portal_address_t * portal, char *str, char *arg)
 {
-	char *sp, *sp2;
+	char *sp;
 	int val;
 
 	if (!str || !*str)
 		arg_error(arg, "Address is missing");
 
-	/* is there a port? don't check inside square brackets (IPv6 addr) */
-	for (sp = str + 1, val = 0; *sp && (*sp != ':' || val); sp++) {
-		if (*sp == '[')
-			val = 1;
-		else if (*sp == ']')
-			val = 0;
-	}
-
-	/* */
-	if (*sp) {
-		for (sp2 = sp + 1; *sp2 && *sp2 != ':'; sp2++);
-		/* if there's a second colon, assume it's an unbracketed IPv6 address */
-		if (!*sp2) {
-			/* truncate source, that's the address */
-			*sp++ = '\0';
-			if (sscanf(sp, "%d", ) != 1)
-arg_error(arg, "Bad address format: Expected port number");
-			if (val < 0 || val > 0x)
-arg_error(arg, "Bad address format: Port number out of range");
-			portal->port = (uint16_t) val;
-		}
-		/* is there a group tag? */
-		for (; isdigit((unsigned char)*sp); sp++);
-		if (*sp && *sp != ',')
-			arg_error(arg, "Bad address format: Extra character(s) '%c'", *sp);
-	} else
-		for (sp = str + 1; *sp && *sp != ','; sp++);
-
-	if (*sp) {
+	/* Parse and strip trailing group tag */
+	sp = strrchr(str, ',');
+	if (sp != NULL) {
 		if (sscanf(sp + 1, "%d", ) != 1)
 			arg_error(arg, "Bad address format: Expected group tag");
 		if (val < 0 || val > 0x)
 			arg_error(arg, "Bad address format: Group tag out of range");
 		portal->group_tag = (uint16_t) val;
-		/* truncate source, that's the address */
 		*sp = '\0';
 	}
-	/* only check length, don't verify correct format (too many possibilities) */
+
+	/* Skip over bracketed IPv6 address */
+	sp = strchr(str, ']');
+	if (sp != NULL)
+		sp++;
+	else
+		sp = str;
+
+	/* Parse and strip trailing port number */
+	sp = strchr(sp, ':');
+	if (sp != NULL) {
+		if (strchr(sp + 1, ':') != NULL) {
+			/*
+			 *  If there's a second colon, assume
+			 *  it's an unbracketed IPv6 address
+			 */
+			portal->port = 0;
+		} else {
+			if (sscanf(sp + 1, "%d", ) != 1)
+arg_error(arg, "Bad address format: Expected port number");
+			if (val < 0 || val > 0x)
+arg_error(arg, "Bad address format: Port number ut  of range");
+			portal->port = (uint16_t) val;
+			*sp = '\0';
+		}
+	}
+
+	/* Remove brackets */
+	if (*str == '[') {
+		sp = strchr(str, ']');
+		if (sp != NULL && !*(sp+1)) {
+			str = str + 1;
+			*sp = '\0';
+		}
+	}
+
+	/*
+	 * only check length, don't verify correct format
+	 * (too many possibilities)
+	 */
 	if (strlen(str) >= sizeof(portal->address))
 		arg_error(arg, "Bad address format: Address string too long");
 

Index: src/sbin/iscsid/iscsid_driverif.c
diff -u src/sbin/iscsid/iscsid_driverif.c:1.8 src/sbin/iscsid/iscsid_driverif.c:1.8.26.1
--- src/sbin/iscsid/iscsid_driverif.c:1.8	Sun May 29 13:35:45 2016
+++ src/sbin/iscsid/iscsid_driverif.c	Mon Dec 18 14:12:35 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: iscsid_driverif.c,v 1.8 2016/05/29 13:35:45 mlelstv Exp $	*/
+/*	$NetBSD: iscsid_driverif.c,v 1.8.26.1 2023/12/18 14:12:35 martin Exp $	*/
 
 /*-
  * Copyright (c) 2005,2006,2011 The NetBSD Foundation, Inc.
@@ -98,23 +98,29 @@ set_node_name(iscsid_set_node_name_req_t
 static int
 bind_socket(int sock, uint8_t * addr)
 {
-	struct sockaddr_in serverAddress;
-	struct hostent *host;
+	struct addrinfo hints, *ai, *ai0;
+	int ret = FALSE;
 
 	DEB(8, ("Binding to <%s>", addr));
-	(void) memset(, 0x0, sizeof(serverAddress));
-	host = gethostbyname((char *)addr);
-	if (host == NULL)
-		return FALSE;
-	if (host->h_length > (int)sizeof(serverAddress.sin_addr))
-		return FALSE;
-	serverAddress.sin_family = host->h_addrtype;
-	serverAddress.sin_port = 0;
-	serverAddress.sin_len = host->h_length;
-	memcpy(_addr, host->h_addr_list[0], host->h_length);
+	
+	memset(, 0, 

CVS commit: [netbsd-10] src/sbin

2023-12-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Dec 18 14:12:35 UTC 2023

Modified Files:
src/sbin/iscsictl [netbsd-10]: iscsic_parse.c
src/sbin/iscsid [netbsd-10]: iscsid_driverif.c

Log Message:
Pull up following revision(s) (requested by mlelstv in ticket #504):

sbin/iscsictl/iscsic_parse.c: revision 1.5
sbin/iscsid/iscsid_driverif.c: revision 1.9

Parse IPv6 targets and handle IPv6 addresses.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.2.1 src/sbin/iscsictl/iscsic_parse.c
cvs rdiff -u -r1.8 -r1.8.26.1 src/sbin/iscsid/iscsid_driverif.c

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



CVS commit: [netbsd-10] src/external/bsd/top/dist/machine

2023-12-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Dec 18 14:08:37 UTC 2023

Modified Files:
src/external/bsd/top/dist/machine [netbsd-10]: m_netbsd.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #503):

external/bsd/top/dist/machine/m_netbsd.c: revision 1.27
external/bsd/top/dist/machine/m_netbsd.c: revision 1.28

top: add network in & out bytes to the top display.

inspired by the macos top(1).

the first value displayed is the total in/out bytes since boot,
but each update is the amount since the prior update.  the new
fetching code heavily based upon netstat/if.c.

old version:
Swap: 128G Total, 128G Free / Pools: 13G Used

new version:
Swap: 128G Total, 128G Free / Pools: 13G Used, / Network: 26M In, 804K Out

update the list of people who have contributed to m_netbsd.c.
Remove extraneous comma after pool info


To generate a diff of this commit:
cvs rdiff -u -r1.26.2.1 -r1.26.2.2 \
src/external/bsd/top/dist/machine/m_netbsd.c

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



CVS commit: [netbsd-10] src/external/bsd/top/dist/machine

2023-12-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Dec 18 14:08:37 UTC 2023

Modified Files:
src/external/bsd/top/dist/machine [netbsd-10]: m_netbsd.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #503):

external/bsd/top/dist/machine/m_netbsd.c: revision 1.27
external/bsd/top/dist/machine/m_netbsd.c: revision 1.28

top: add network in & out bytes to the top display.

inspired by the macos top(1).

the first value displayed is the total in/out bytes since boot,
but each update is the amount since the prior update.  the new
fetching code heavily based upon netstat/if.c.

old version:
Swap: 128G Total, 128G Free / Pools: 13G Used

new version:
Swap: 128G Total, 128G Free / Pools: 13G Used, / Network: 26M In, 804K Out

update the list of people who have contributed to m_netbsd.c.
Remove extraneous comma after pool info


To generate a diff of this commit:
cvs rdiff -u -r1.26.2.1 -r1.26.2.2 \
src/external/bsd/top/dist/machine/m_netbsd.c

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

Modified files:

Index: src/external/bsd/top/dist/machine/m_netbsd.c
diff -u src/external/bsd/top/dist/machine/m_netbsd.c:1.26.2.1 src/external/bsd/top/dist/machine/m_netbsd.c:1.26.2.2
--- src/external/bsd/top/dist/machine/m_netbsd.c:1.26.2.1	Mon Dec 18 14:06:44 2023
+++ src/external/bsd/top/dist/machine/m_netbsd.c	Mon Dec 18 14:08:37 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: m_netbsd.c,v 1.26.2.1 2023/12/18 14:06:44 martin Exp $	*/
+/*	$NetBSD: m_netbsd.c,v 1.26.2.2 2023/12/18 14:08:37 martin Exp $	*/
 
 /*
  * top - a top users display for Unix
@@ -20,6 +20,14 @@
  * and should work for:
  *	NetBSD-2.0	(when released)
  * -
+ * NetBSD-4.0 updates from Christos Zoulas.
+ * NetBSD-5.0 updates from Andrew Doran, Mindaugas Rasiukevicius and
+ * Christos Zoulas.
+ * NetBSD-6.0 updates from matthew green, Christos Zoulas, and
+ * Mindaugas Rasiukevicius.
+ * NetBSD-8 updates from Leonardo Taccari.
+ * NetBSD-10 updates from Christos Zoulas and matthew green.
+ *
  * top does not need to be installed setuid or setgid with this module.
  *
  * LIBS: -lkvm
@@ -37,12 +45,12 @@
  *		Andrew Doran 
  *
  *
- * $Id: m_netbsd.c,v 1.26.2.1 2023/12/18 14:06:44 martin Exp $
+ * $Id: m_netbsd.c,v 1.26.2.2 2023/12/18 14:08:37 martin Exp $
  */
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: m_netbsd.c,v 1.26.2.1 2023/12/18 14:06:44 martin Exp $");
+__RCSID("$NetBSD: m_netbsd.c,v 1.26.2.2 2023/12/18 14:08:37 martin Exp $");
 #endif
 
 #include 
@@ -50,6 +58,9 @@ __RCSID("$NetBSD: m_netbsd.c,v 1.26.2.1 
 #include 
 #include 
 #include 
+#include 
+
+#include 
 
 #include 
 
@@ -166,9 +177,10 @@ const char *memorynames[] = {
 	NULL
 };
 
-long swap_stats[6];
+long swap_stats[9];
 const char *swapnames[] = {
-	"K Total, ", "K Used, ", "K Free ", " Pools: ", "K Used, ",
+	"K Total, ", "K Used, ", "K Free ", " Pools: ", "K Used ",
+	" Network: ", "K In, ", "K Out, ",
 	NULL
 };
 
@@ -445,11 +457,60 @@ format_header(char *uname_field)
 	return(header);
 }
 
+static void
+get_network_kilobytes(long *kb_in, long *kb_out)
+{
+	struct if_msghdr *ifm;
+	int mib[6] = { CTL_NET, AF_ROUTE, 0, 0, NET_RT_IFLIST, 0 };
+	struct rt_msghdr *rtm;
+	struct if_data *ifd = NULL;
+	static char *buf = NULL;
+	static size_t olen;
+	char *next, *lim;
+	size_t len;
+	static uint64_t last_bytes_in;
+	static uint64_t last_bytes_out;
+	uint64_t cur_bytes_in = 0;
+	uint64_t cur_bytes_out = 0;
+
+	if (sysctl(mib, 6, NULL, , NULL, 0) == -1)
+		err(1, "sysctl");
+	if (len > olen) {
+		free(buf);
+		if ((buf = malloc(len)) == NULL)
+			err(1, NULL);
+		olen = len;
+	}
+	if (sysctl(mib, 6, buf, , NULL, 0) == -1)
+		err(1, "sysctl");
+
+	lim = buf + len;
+	for (next = buf; next < lim; next += rtm->rtm_msglen) {
+		rtm = (struct rt_msghdr *)next;
+		if (rtm->rtm_version != RTM_VERSION)
+			continue;
+		switch (rtm->rtm_type) {
+		case RTM_IFINFO:
+			ifm = (struct if_msghdr *)next;
+			ifd = >ifm_data;
+
+			cur_bytes_in += ifd->ifi_ibytes;
+			cur_bytes_out += ifd->ifi_obytes;
+			break;
+		}
+	}
+
+	*kb_in = (cur_bytes_in - last_bytes_in) / 1024;
+	*kb_out = (cur_bytes_out - last_bytes_out) / 1024;
+	last_bytes_in = cur_bytes_in;
+	last_bytes_out = cur_bytes_out;
+}
+
 void
 get_system_info(struct system_info *si)
 {
 	size_t ssize;
-	int mib[2];
+	int mib[6];
 	struct uvmexp_sysctl uvmexp;
 	struct swapent *sep;
 	u_int64_t totalsize, totalinuse;
@@ -531,8 +592,10 @@ get_system_info(struct system_info *si)
 
 	swap_stats[4] = pagetok(uvmexp.poolpages);
 
+	get_network_kilobytes(_stats[6], _stats[7]);
+
 	memory_stats[6] = -1;
-	swap_stats[3] = swap_stats[5] = -1;
+	swap_stats[3] = swap_stats[5] = swap_stats[8] = -1;
 
 	/* set arrays and strings */
 	si->cpustates = cpu_states;



CVS commit: [netbsd-10] src/external/bsd/top/dist/machine

2023-12-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Dec 18 14:06:44 UTC 2023

Modified Files:
src/external/bsd/top/dist/machine [netbsd-10]: m_netbsd.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #502):

external/bsd/top/dist/machine/m_netbsd.c: revision 1.29

avoid crashes when proc_from_thread() returns NULL.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.26.2.1 src/external/bsd/top/dist/machine/m_netbsd.c

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

Modified files:

Index: src/external/bsd/top/dist/machine/m_netbsd.c
diff -u src/external/bsd/top/dist/machine/m_netbsd.c:1.26 src/external/bsd/top/dist/machine/m_netbsd.c:1.26.2.1
--- src/external/bsd/top/dist/machine/m_netbsd.c:1.26	Fri Jul 15 06:39:06 2022
+++ src/external/bsd/top/dist/machine/m_netbsd.c	Mon Dec 18 14:06:44 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: m_netbsd.c,v 1.26 2022/07/15 06:39:06 mrg Exp $	*/
+/*	$NetBSD: m_netbsd.c,v 1.26.2.1 2023/12/18 14:06:44 martin Exp $	*/
 
 /*
  * top - a top users display for Unix
@@ -37,12 +37,12 @@
  *		Andrew Doran 
  *
  *
- * $Id: m_netbsd.c,v 1.26 2022/07/15 06:39:06 mrg Exp $
+ * $Id: m_netbsd.c,v 1.26.2.1 2023/12/18 14:06:44 martin Exp $
  */
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: m_netbsd.c,v 1.26 2022/07/15 06:39:06 mrg Exp $");
+__RCSID("$NetBSD: m_netbsd.c,v 1.26.2.1 2023/12/18 14:06:44 martin Exp $");
 #endif
 
 #include 
@@ -762,18 +762,20 @@ get_lwp_info(struct system_info *si, str
 		 * status field.  threads with L_SYSTEM set are system
 		 * threads---these get ignored unless show_sysprocs is set.
 		 */
-		if (lp->l_stat != 0 && (show_system || ((lp->l_flag & LW_SYSTEM) == 0))) {
+		if (lp->l_stat != 0 &&
+		(show_system || ((lp->l_flag & LW_SYSTEM) == 0))) {
 			total_lwps++;
 			process_states[(unsigned char) lp->l_stat]++;
 			if (lp->l_stat != LSZOMB &&
 			(show_idle || (lp->l_pctcpu != 0) || 
-			(lp->l_stat == LSRUN || lp->l_stat == LSONPROC)) &&
+			 (lp->l_stat == LSRUN || lp->l_stat == LSONPROC)) &&
 			(!show_uid || uid_from_thread(lp) == sel->uid) &&
 			(!show_command ||
-			 strstr(get_command(sel, proc_from_thread(lp)),
- show_command) != NULL)) {
-	*lrefp++ = lp;
-	active_lwps++;
+			 ((pp = proc_from_thread(lp)) != NULL &&
+			  strstr(get_command(sel, pp),
+ show_command) != NULL))) {
+*lrefp++ = lp;
+active_lwps++;
 			}
 		}
 	}
@@ -1152,6 +1154,8 @@ compare_pid(pp1, pp2)
 		struct kinfo_lwp *l2 = *(struct kinfo_lwp **) pp2;
 		struct kinfo_proc2 *p1 = proc_from_thread(l1);
 		struct kinfo_proc2 *p2 = proc_from_thread(l2);
+		if (p1 == NULL || p2 == NULL)
+			return -1;
 		return p2->p_pid - p1->p_pid;
 	} else {
 		struct kinfo_proc2 *p1 = *(struct kinfo_proc2 **) pp1;
@@ -1169,6 +1173,8 @@ compare_command(pp1, pp2)
 		struct kinfo_lwp *l2 = *(struct kinfo_lwp **) pp2;
 		struct kinfo_proc2 *p1 = proc_from_thread(l1);
 		struct kinfo_proc2 *p2 = proc_from_thread(l2);
+		if (p1 == NULL || p2 == NULL)
+			return -1;
 		return strcmp(p2->p_comm, p1->p_comm);
 	} else {
 		struct kinfo_proc2 *p1 = *(struct kinfo_proc2 **) pp1;
@@ -1186,6 +1192,8 @@ compare_username(pp1, pp2)
 		struct kinfo_lwp *l2 = *(struct kinfo_lwp **) pp2;
 		struct kinfo_proc2 *p1 = proc_from_thread(l1);
 		struct kinfo_proc2 *p2 = proc_from_thread(l2);
+		if (p1 == NULL || p2 == NULL)
+			return -1;
 		return strcmp(p2->p_login, p1->p_login);
 	} else {
 		struct kinfo_proc2 *p1 = *(struct kinfo_proc2 **) pp1;



CVS commit: [netbsd-10] src/external/bsd/top/dist/machine

2023-12-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Dec 18 14:06:44 UTC 2023

Modified Files:
src/external/bsd/top/dist/machine [netbsd-10]: m_netbsd.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #502):

external/bsd/top/dist/machine/m_netbsd.c: revision 1.29

avoid crashes when proc_from_thread() returns NULL.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.26.2.1 src/external/bsd/top/dist/machine/m_netbsd.c

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



CVS commit: [netbsd-10] src/lib/libc/stdlib

2023-12-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Dec 18 14:05:23 UTC 2023

Modified Files:
src/lib/libc/stdlib [netbsd-10]: jemalloc.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #501):

lib/libc/stdlib/jemalloc.c: revision 1.64

make malloc_usable_size() visible with old jemalloc.

it's in  and applications like firefox expect it.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.55.2.1 src/lib/libc/stdlib/jemalloc.c

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

Modified files:

Index: src/lib/libc/stdlib/jemalloc.c
diff -u src/lib/libc/stdlib/jemalloc.c:1.55 src/lib/libc/stdlib/jemalloc.c:1.55.2.1
--- src/lib/libc/stdlib/jemalloc.c:1.55	Wed Nov 30 04:35:53 2022
+++ src/lib/libc/stdlib/jemalloc.c	Mon Dec 18 14:05:23 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: jemalloc.c,v 1.55 2022/11/30 04:35:53 skrll Exp $	*/
+/*	$NetBSD: jemalloc.c,v 1.55.2.1 2023/12/18 14:05:23 martin Exp $	*/
 
 /*-
  * Copyright (C) 2006,2007 Jason Evans .
@@ -117,7 +117,7 @@
 
 #include 
 /* __FBSDID("$FreeBSD: src/lib/libc/stdlib/malloc.c,v 1.147 2007/06/15 22:00:16 jasone Exp $"); */
-__RCSID("$NetBSD: jemalloc.c,v 1.55 2022/11/30 04:35:53 skrll Exp $");
+__RCSID("$NetBSD: jemalloc.c,v 1.55.2.1 2023/12/18 14:05:23 martin Exp $");
 
 #ifdef __FreeBSD__
 #include "libc_private.h"
@@ -157,6 +157,7 @@ __RCSID("$NetBSD: jemalloc.c,v 1.55 2022
 #include 
 #include 
 #include 
+#include 
 
 #ifdef __NetBSD__
 #  include 
@@ -3941,7 +3942,6 @@ free(void *ptr)
 /*
  * Begin non-standard functions.
  */
-#ifndef __NetBSD__
 size_t
 malloc_usable_size(const void *ptr)
 {
@@ -3950,7 +3950,6 @@ malloc_usable_size(const void *ptr)
 
 	return (isalloc(ptr));
 }
-#endif
 
 /*
  * End non-standard functions.



CVS commit: [netbsd-10] src/lib/libc/stdlib

2023-12-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Dec 18 14:05:23 UTC 2023

Modified Files:
src/lib/libc/stdlib [netbsd-10]: jemalloc.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #501):

lib/libc/stdlib/jemalloc.c: revision 1.64

make malloc_usable_size() visible with old jemalloc.

it's in  and applications like firefox expect it.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.55.2.1 src/lib/libc/stdlib/jemalloc.c

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



CVS commit: [netbsd-10] src/usr.bin/cvslatest

2023-12-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Dec 18 13:52:37 UTC 2023

Modified Files:
src/usr.bin/cvslatest [netbsd-10]: cvslatest.1

Log Message:
Pull up following revision(s) (requested by wiz in ticket #500):

usr.bin/cvslatest/cvslatest.1: revision 1.2

cvslatest(1): remove RETURN VALUES

Pages in section one should use EXIT STATUS instead (which this one
already provides).

Closes PR 57778 by Kouichi Hashikawa


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.1.26.1 src/usr.bin/cvslatest/cvslatest.1

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

Modified files:

Index: src/usr.bin/cvslatest/cvslatest.1
diff -u src/usr.bin/cvslatest/cvslatest.1:1.1 src/usr.bin/cvslatest/cvslatest.1:1.1.26.1
--- src/usr.bin/cvslatest/cvslatest.1:1.1	Sun Jan 24 17:08:16 2016
+++ src/usr.bin/cvslatest/cvslatest.1	Mon Dec 18 13:52:37 2023
@@ -1,4 +1,4 @@
-.\" $NetBSD: cvslatest.1,v 1.1 2016/01/24 17:08:16 christos Exp $
+.\" $NetBSD: cvslatest.1,v 1.1.26.1 2023/12/18 13:52:37 martin Exp $
 .\" Copyright (C) 2015 Thomas Klausner
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -23,7 +23,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd January 7, 2016
+.Dd December 16, 2023
 .Dt CVSLATEST 1
 .Os
 .Sh NAME
@@ -70,7 +70,5 @@ information directory.
 .Sh SEE ALSO
 .Xr cvs 1 ,
 .Xr date 1
-.Sh RETURN VALUES
-.Ex -std
 .Sh AUTHORS
 .An Christos Zoulas Aq Mt chris...@netbsd.org



CVS commit: [netbsd-10] src/usr.bin/cvslatest

2023-12-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Dec 18 13:52:37 UTC 2023

Modified Files:
src/usr.bin/cvslatest [netbsd-10]: cvslatest.1

Log Message:
Pull up following revision(s) (requested by wiz in ticket #500):

usr.bin/cvslatest/cvslatest.1: revision 1.2

cvslatest(1): remove RETURN VALUES

Pages in section one should use EXIT STATUS instead (which this one
already provides).

Closes PR 57778 by Kouichi Hashikawa


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.1.26.1 src/usr.bin/cvslatest/cvslatest.1

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



CVS commit: [netbsd-10] src/distrib/notes/common

2023-12-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Dec 18 13:50:50 UTC 2023

Modified Files:
src/distrib/notes/common [netbsd-10]: main

Log Message:
Pull up following revision(s) (requested by abs in ticket #499):

distrib/notes/common/main: revision 1.571
distrib/notes/common/main: revision 1.572

Add note about zfs mount behaviour change in NetBSD 10
main: minor style fix


To generate a diff of this commit:
cvs rdiff -u -r1.570.2.2 -r1.570.2.3 src/distrib/notes/common/main

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



CVS commit: [netbsd-10] src/distrib/notes/common

2023-12-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Dec 18 13:50:50 UTC 2023

Modified Files:
src/distrib/notes/common [netbsd-10]: main

Log Message:
Pull up following revision(s) (requested by abs in ticket #499):

distrib/notes/common/main: revision 1.571
distrib/notes/common/main: revision 1.572

Add note about zfs mount behaviour change in NetBSD 10
main: minor style fix


To generate a diff of this commit:
cvs rdiff -u -r1.570.2.2 -r1.570.2.3 src/distrib/notes/common/main

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

Modified files:

Index: src/distrib/notes/common/main
diff -u src/distrib/notes/common/main:1.570.2.2 src/distrib/notes/common/main:1.570.2.3
--- src/distrib/notes/common/main:1.570.2.2	Sun Nov  5 18:14:43 2023
+++ src/distrib/notes/common/main	Mon Dec 18 13:50:50 2023
@@ -1,4 +1,4 @@
-.\"	$NetBSD: main,v 1.570.2.2 2023/11/05 18:14:43 martin Exp $
+.\"	$NetBSD: main,v 1.570.2.3 2023/12/18 13:50:50 martin Exp $
 .\"
 .\" Copyright (c) 1999-2012 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -830,6 +830,16 @@ and thus all issues that are fixed by
 .Ic postinstall
 by default will be handled.
 .Pp
+In
+.Nx 9
+and earlier, filesystems listed in
+.Pa /etc/fstab
+would be mounted before non-legacy
+.Ic zfs
+filesystems. Starting from
+.Nx 10
+this order has been reversed.
+.Pp
 If you have ever run a version of
 .Nx -current
 between April 18, 2020 and September 23, 2022 (the version numbers



CVS commit: src/usr.bin/make/unit-tests

2023-12-18 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Dec 18 11:13:51 UTC 2023

Modified Files:
src/usr.bin/make/unit-tests: varmod-subst-regex.mk varmod-subst.mk

Log Message:
tests/make: fix typo in test for ':C' modifier

The expression ${U:...} was always undefined, as there was no variable
named 'U'; the intended form was ${:U:...}.  Due to this typo, the
comments in the tests for the ':S' and the ':C' modifier contradicted
each other.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/usr.bin/make/unit-tests/varmod-subst-regex.mk
cvs rdiff -u -r1.13 -r1.14 src/usr.bin/make/unit-tests/varmod-subst.mk

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

Modified files:

Index: src/usr.bin/make/unit-tests/varmod-subst-regex.mk
diff -u src/usr.bin/make/unit-tests/varmod-subst-regex.mk:1.10 src/usr.bin/make/unit-tests/varmod-subst-regex.mk:1.11
--- src/usr.bin/make/unit-tests/varmod-subst-regex.mk:1.10	Sun Dec 17 14:07:22 2023
+++ src/usr.bin/make/unit-tests/varmod-subst-regex.mk	Mon Dec 18 11:13:51 2023
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-subst-regex.mk,v 1.10 2023/12/17 14:07:22 rillig Exp $
+# $NetBSD: varmod-subst-regex.mk,v 1.11 2023/12/18 11:13:51 rillig Exp $
 #
 # Tests for the :C,from,to, variable modifier.
 
@@ -88,23 +88,43 @@ all: unmatched-subexpression
 # Like the ':S' modifier, the ':C' modifier matches on an expression
 # that contains no words at all, but only if the regular expression matches an
 # empty string, for example, when the regular expression is anchored at the
-# beginning or the end of the word.
-.if "<${U:S,^,prefix,}> <${:U:C,^,prefix,}>" != "<> "
+# beginning or the end of the word.  An unanchored regular expression that
+# matches the empty string is uncommon in practice, as it would match before
+# each character of the word.
+.if "<${:U:S,,unanchored,}> <${:U:C,.?,unanchored,}>" != "<> "
 .  error
 .endif
-.if "<${U:S,$,suffix,}> <${:U:C,$,suffix,}>" != "<> "
+.if "<${:U:S,^,prefix,}> <${:U:C,^,prefix,}>" != " "
 .  error
 .endif
-.if "<${U:S,^$,whole,}> <${:U:C,^$,whole,}>" != "<> "
+.if "<${:U:S,$,suffix,}> <${:U:C,$,suffix,}>" != " "
 .  error
 .endif
-.if "<${U:S,^,prefix,g}> <${:U:C,^,prefix,g}>" != "<> "
+.if "<${:U:S,^$,whole,}> <${:U:C,^$,whole,}>" != " "
 .  error
 .endif
-.if "<${U:S,$,suffix,g}> <${:U:C,$,suffix,g}>" != "<> "
+.if "<${:U:S,,unanchored,g}> <${:U:C,.?,unanchored,g}>" != "<> "
 .  error
 .endif
-.if "<${U:S,^$,whole,g}> <${:U:C,^$,whole,g}>" != "<> "
+.if "<${:U:S,^,prefix,g}> <${:U:C,^,prefix,g}>" != " "
+.  error
+.endif
+.if "<${:U:S,$,suffix,g}> <${:U:C,$,suffix,g}>" != " "
+.  error
+.endif
+.if "<${:U:S,^$,whole,g}> <${:U:C,^$,whole,g}>" != " "
+.  error
+.endif
+.if "<${:U:S,,unanchored,W}> <${:U:C,.?,unanchored,W}>" != "<> "
+.  error
+.endif
+.if "<${:U:S,^,prefix,W}> <${:U:C,^,prefix,W}>" != " "
+.  error
+.endif
+.if "<${:U:S,$,suffix,W}> <${:U:C,$,suffix,W}>" != " "
+.  error
+.endif
+.if "<${:U:S,^$,whole,W}> <${:U:C,^$,whole,W}>" != " "
 .  error
 .endif
 

Index: src/usr.bin/make/unit-tests/varmod-subst.mk
diff -u src/usr.bin/make/unit-tests/varmod-subst.mk:1.13 src/usr.bin/make/unit-tests/varmod-subst.mk:1.14
--- src/usr.bin/make/unit-tests/varmod-subst.mk:1.13	Sun Dec 17 14:07:22 2023
+++ src/usr.bin/make/unit-tests/varmod-subst.mk	Mon Dec 18 11:13:51 2023
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-subst.mk,v 1.13 2023/12/17 14:07:22 rillig Exp $
+# $NetBSD: varmod-subst.mk,v 1.14 2023/12/18 11:13:51 rillig Exp $
 #
 # Tests for the :S,from,to, variable modifier.
 
@@ -142,8 +142,9 @@ WORDS=		sequences of letters
 .endif
 
 
-# In an empty expression, the ':S' modifier matches a single time if the
-# search string is anchored at the beginning or at the end.
+# In an empty expression, the ':S' modifier matches a single time, but only if
+# the search string is empty and anchored at either the beginning or the end
+# of the word.
 .if ${:U:S,,out-of-nothing,} != ""
 .  error
 .endif
@@ -156,6 +157,30 @@ WORDS=		sequences of letters
 .if ${:U:S,^$,out-of-nothing,} != "out-of-nothing"
 .  error
 .endif
+.if ${:U:S,,out-of-nothing,g} != ""
+.  error
+.endif
+.if ${:U:S,^,out-of-nothing,g} != "out-of-nothing"
+.  error
+.endif
+.if ${:U:S,$,out-of-nothing,g} != "out-of-nothing"
+.  error
+.endif
+.if ${:U:S,^$,out-of-nothing,g} != "out-of-nothing"
+.  error
+.endif
+.if ${:U:S,,out-of-nothing,W} != ""
+.  error
+.endif
+.if ${:U:S,^,out-of-nothing,W} != "out-of-nothing"
+.  error
+.endif
+.if ${:U:S,$,out-of-nothing,W} != "out-of-nothing"
+.  error
+.endif
+.if ${:U:S,^$,out-of-nothing,W} != "out-of-nothing"
+.  error
+.endif
 
 
 mod-subst:



CVS commit: src/usr.bin/make/unit-tests

2023-12-18 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Dec 18 11:13:51 UTC 2023

Modified Files:
src/usr.bin/make/unit-tests: varmod-subst-regex.mk varmod-subst.mk

Log Message:
tests/make: fix typo in test for ':C' modifier

The expression ${U:...} was always undefined, as there was no variable
named 'U'; the intended form was ${:U:...}.  Due to this typo, the
comments in the tests for the ':S' and the ':C' modifier contradicted
each other.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/usr.bin/make/unit-tests/varmod-subst-regex.mk
cvs rdiff -u -r1.13 -r1.14 src/usr.bin/make/unit-tests/varmod-subst.mk

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



CVS commit: src/bin/df

2023-12-18 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Dec 18 08:27:24 UTC 2023

Modified Files:
src/bin/df: df.c

Log Message:
Correctly compute the "Filesystem" column with when using -W
(that added "NAME=" occupies space!)

XXX pullup -10


To generate a diff of this commit:
cvs rdiff -u -r1.101 -r1.102 src/bin/df/df.c

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

Modified files:

Index: src/bin/df/df.c
diff -u src/bin/df/df.c:1.101 src/bin/df/df.c:1.102
--- src/bin/df/df.c:1.101	Tue Aug  9 08:14:03 2022
+++ src/bin/df/df.c	Mon Dec 18 08:27:24 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: df.c,v 1.101 2022/08/09 08:14:03 wiz Exp $ */
+/*	$NetBSD: df.c,v 1.102 2023/12/18 08:27:24 kre Exp $ */
 
 /*
  * Copyright (c) 1980, 1990, 1993, 1994
@@ -45,7 +45,7 @@ __COPYRIGHT(
 #if 0
 static char sccsid[] = "@(#)df.c	8.7 (Berkeley) 4/2/94";
 #else
-__RCSID("$NetBSD: df.c,v 1.101 2022/08/09 08:14:03 wiz Exp $");
+__RCSID("$NetBSD: df.c,v 1.102 2023/12/18 08:27:24 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -243,8 +243,13 @@ main(int argc, char *argv[])
 
 	maxwidth = 0;
 	for (i = 0; i < mntcount; i++) {
-		width = (int)strlen(Wflag && mntbuf[i].f_mntfromlabel[0] ?
-		mntbuf[i].f_mntfromlabel : mntbuf[i].f_mntfromname);
+		width = 0;
+		if (Wflag && mntbuf[i].f_mntfromlabel[0]) {
+			/* +5 is for "NAME=" added later */
+			width = (int)strlen(mntbuf[i].f_mntfromlabel) + 5;
+		}
+		if (width == 0)
+			width = (int)strlen(mntbuf[i].f_mntfromname);
 		if (width > maxwidth)
 			maxwidth = width;
 		if (cflag)



CVS commit: src/bin/df

2023-12-18 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Dec 18 08:27:24 UTC 2023

Modified Files:
src/bin/df: df.c

Log Message:
Correctly compute the "Filesystem" column with when using -W
(that added "NAME=" occupies space!)

XXX pullup -10


To generate a diff of this commit:
cvs rdiff -u -r1.101 -r1.102 src/bin/df/df.c

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