CVS commit: src/sys/arch/amd64/amd64

2022-09-12 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Tue Sep 13 05:36:29 UTC 2022

Modified Files:
src/sys/arch/amd64/amd64: lock_stubs.S

Log Message:
Fix PR kern/57007.  I missed applying a part of the original patch.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/amd64/amd64/lock_stubs.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/amd64/amd64/lock_stubs.S
diff -u src/sys/arch/amd64/amd64/lock_stubs.S:1.37 src/sys/arch/amd64/amd64/lock_stubs.S:1.38
--- src/sys/arch/amd64/amd64/lock_stubs.S:1.37	Wed Sep  7 00:40:18 2022
+++ src/sys/arch/amd64/amd64/lock_stubs.S	Tue Sep 13 05:36:29 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: lock_stubs.S,v 1.37 2022/09/07 00:40:18 knakahara Exp $	*/
+/*	$NetBSD: lock_stubs.S,v 1.38 2022/09/13 05:36:29 knakahara Exp $	*/
 
 /*
  * Copyright (c) 2006, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -124,13 +124,13 @@ ENTRY(mutex_spin_exit)
 	movl	CPU_INFO_MTX_OLDSPL(%r8), %edi
 	incl	CPU_INFO_MTX_COUNT(%r8)
 	jnz	1f
-	cmpl	CPU_INFO_ILEVEL(%r8), %edi
+	cmpb	CPU_INFO_ILEVEL(%r8), %dil
 	jae	1f
-	movl	CPU_INFO_IUNMASK(%r8,%rdi,4), %esi
+	movq	CPU_INFO_IUNMASK(%r8,%rdi,8), %rsi
 	CLI(ax)
-	testl	CPU_INFO_IPENDING(%r8), %esi
+	testq	CPU_INFO_IPENDING(%r8), %rsi
 	jnz	_C_LABEL(Xspllower)
-	movl	%edi, CPU_INFO_ILEVEL(%r8)
+	movb	%dil, CPU_INFO_ILEVEL(%r8)
 	STI(ax)
 1:	rep	/* double byte ret as branch */
 	ret	/* target: see AMD docs */
@@ -141,23 +141,27 @@ ENTRY(mutex_spin_exit)
 	movb	$0x00, MTX_LOCK(%rdi)
 	movl	CPU_INFO_MTX_OLDSPL(%rsi), %ecx
 	incl	CPU_INFO_MTX_COUNT(%rsi)
-	movl	CPU_INFO_ILEVEL(%rsi),%edx
+	movzbl	CPU_INFO_ILEVEL(%rsi),%edx
 	cmovnzl	%edx,%ecx
-	pushq	%rbx
 	cmpl	%edx,%ecx			/* new level is lower? */
 	jae	2f
+	xorq	%rdi,%rdi			/* rdi: ci_ipending mask */
+	notq	%rdi
+	shrq	$8,%rdi
+	movq	%rcx,%r9			/* r9: shifted new level */
+	shlq	$56,%r9
 1:
-	movl	CPU_INFO_IPENDING(%rsi),%eax
-	testl	%eax,CPU_INFO_IUNMASK(%rsi,%rcx,4)/* deferred interrupts? */
+	movq	CPU_INFO_IPENDING(%rsi),%rax
+	testq	%rax,CPU_INFO_IUNMASK(%rsi,%rcx,8)/* deferred interrupts? */
 	jnz	3f
-	movl	%eax,%ebx
-	cmpxchg8b CPU_INFO_ISTATE(%rsi)		/* swap in new ilevel */
+	movq	%rax,%r8
+	andq	%rdi,%r8
+	orq	%r9,%r8
+	cmpxchgq %r8,CPU_INFO_ISTATE(%rsi)	/* swap in new ilevel */
 	jnz	4f
 2:
-	popq	%rbx
 	ret
 3:
-	popq	%rbx
 	movl	%ecx, %edi
 	jmp	_C_LABEL(Xspllower)
 4:



CVS commit: src/sys/arch/amd64/amd64

2022-09-12 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Tue Sep 13 05:36:29 UTC 2022

Modified Files:
src/sys/arch/amd64/amd64: lock_stubs.S

Log Message:
Fix PR kern/57007.  I missed applying a part of the original patch.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/amd64/amd64/lock_stubs.S

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



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

2022-09-12 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Sep 13 01:22:12 UTC 2022

Modified Files:
src/sys/arch/powerpc/include: fenv.h

Log Message:
fesetexceptflag(): Set FE_ALL_INVALID instead of FE_ALL_EXCEPT for
FE_INVALID. Taken from FreeBSD:

https://cgit.freebsd.org/src/commit/lib/msun/powerpc/fenv.h?id=e7bd4f846f0c9185aebfd3d116bb78ab137280fa

> [POWERPC] msun: fix incorrect flag in fesetexceptflag
> Fix incorrect mask being used when FE_INVALID bit is wanted by user.
> The problem was noticed thanks to msun fenv tests.
>
> Reviewed by:  jhibbits, luporl
> Sponsored by: Eldorado Research Institute (eldorado.org.br)
> Differential Revision:https://reviews.freebsd.org/D27201

No regression for full ATF on both real and emulated FPU.

XXX
Import some tests from FreeBSD's lib/msun/tests.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/powerpc/include/fenv.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/powerpc/include/fenv.h
diff -u src/sys/arch/powerpc/include/fenv.h:1.6 src/sys/arch/powerpc/include/fenv.h:1.7
--- src/sys/arch/powerpc/include/fenv.h:1.6	Wed Oct 30 02:44:29 2019
+++ src/sys/arch/powerpc/include/fenv.h	Tue Sep 13 01:22:12 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: fenv.h,v 1.6 2019/10/30 02:44:29 christos Exp $	*/
+/*	$NetBSD: fenv.h,v 1.7 2022/09/13 01:22:12 rin Exp $	*/
 
 /*-
  * Copyright (c) 2004-2005 David Schultz 
@@ -177,7 +177,7 @@ fesetexceptflag(const fexcept_t *__flagp
 	union __fpscr __r;
 
 	if (__excepts & FE_INVALID)
-		__excepts |= FE_ALL_EXCEPT;
+		__excepts |= FE_ALL_INVALID;
 	__mffs(&__r.__d);
 	__r.__bits.__reg &= ~__excepts;
 	__r.__bits.__reg |= *__flagp & __excepts;



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

2022-09-12 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Sep 13 01:22:12 UTC 2022

Modified Files:
src/sys/arch/powerpc/include: fenv.h

Log Message:
fesetexceptflag(): Set FE_ALL_INVALID instead of FE_ALL_EXCEPT for
FE_INVALID. Taken from FreeBSD:

https://cgit.freebsd.org/src/commit/lib/msun/powerpc/fenv.h?id=e7bd4f846f0c9185aebfd3d116bb78ab137280fa

> [POWERPC] msun: fix incorrect flag in fesetexceptflag
> Fix incorrect mask being used when FE_INVALID bit is wanted by user.
> The problem was noticed thanks to msun fenv tests.
>
> Reviewed by:  jhibbits, luporl
> Sponsored by: Eldorado Research Institute (eldorado.org.br)
> Differential Revision:https://reviews.freebsd.org/D27201

No regression for full ATF on both real and emulated FPU.

XXX
Import some tests from FreeBSD's lib/msun/tests.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/powerpc/include/fenv.h

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



CVS commit: [netbsd-9] src/doc

2022-09-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 12 17:12:39 UTC 2022

Modified Files:
src/doc [netbsd-9]: CHANGES-9.4

Log Message:
Ticket #1523 has been re-instated


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.14 -r1.1.2.15 src/doc/CHANGES-9.4

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



CVS commit: [netbsd-9] src/doc

2022-09-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 12 17:12:39 UTC 2022

Modified Files:
src/doc [netbsd-9]: CHANGES-9.4

Log Message:
Ticket #1523 has been re-instated


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.14 -r1.1.2.15 src/doc/CHANGES-9.4

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-9.4
diff -u src/doc/CHANGES-9.4:1.1.2.14 src/doc/CHANGES-9.4:1.1.2.15
--- src/doc/CHANGES-9.4:1.1.2.14	Mon Sep 12 15:03:25 2022
+++ src/doc/CHANGES-9.4	Mon Sep 12 17:12:39 2022
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.4,v 1.1.2.14 2022/09/12 15:03:25 martin Exp $
+# $NetBSD: CHANGES-9.4,v 1.1.2.15 2022/09/12 17:12:39 martin Exp $
 
 A complete list of changes from the NetBSD 9.3 release to the NetBSD 9.4
 release:
@@ -218,3 +218,15 @@ usr.bin/netstat/vtw.c		1.11,1.13
 	- KNF. Style fixes.
 	[msaitoh, ticket #1522]
 
+usr.bin/ftp/Makefileup to 1.39
+usr.bin/ftp/fetch.c up to 1.235
+usr.bin/ftp/ftp.1   up to 1.147
+usr.bin/ftp/ftp_var.h   up to 1.86
+usr.bin/ftp/main.c  up to 1.128
+usr.bin/ftp/ssl.c   up to 1.12
+usr.bin/ftp/util.c  up to 1.164
+usr.bin/ftp/version.h   up to 1.94
+
+	ftp(1): PR 57003: Support relative redirects.
+	[christos, #1523]
+



CVS commit: [netbsd-8] src/doc

2022-09-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 12 17:10:34 UTC 2022

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

Log Message:
Ticket #1763 has been re-instated


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.150 -r1.1.2.151 src/doc/CHANGES-8.3

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

Modified files:

Index: src/doc/CHANGES-8.3
diff -u src/doc/CHANGES-8.3:1.1.2.150 src/doc/CHANGES-8.3:1.1.2.151
--- src/doc/CHANGES-8.3:1.1.2.150	Mon Sep 12 15:05:58 2022
+++ src/doc/CHANGES-8.3	Mon Sep 12 17:10:34 2022
@@ -1,4 +1,4 @@
- $NetBSD: CHANGES-8.3,v 1.1.2.150 2022/09/12 15:05:58 martin Exp $
+ $NetBSD: CHANGES-8.3,v 1.1.2.151 2022/09/12 17:10:34 martin Exp $
 
 A complete list of changes from the NetBSD 8.2 release to the NetBSD 8.3
 release:
@@ -2814,3 +2814,27 @@ usr.bin/netstat/vtw.c		1.11,1.13
 	- KNF. Style fixes.
 	[msaitoh, ticket #1762]
 
+usr.bin/ftp/Makefileup to 1.39
+usr.bin/ftp/cmds.c  up to 1.141
+usr.bin/ftp/complete.c  up to 1.47
+usr.bin/ftp/domacro.c   up to 1.23
+usr.bin/ftp/extern.hup to 1.82
+usr.bin/ftp/fetch.c up to 1.235
+usr.bin/ftp/ftp.1   up to 1.147
+usr.bin/ftp/ftp.c   up to 1.174
+usr.bin/ftp/ftp_var.h   up to 1.86
+usr.bin/ftp/main.c  up to 1.128
+usr.bin/ftp/progressbar.c   up to 1.24
+usr.bin/ftp/progressbar.h   up to 1.9
+usr.bin/ftp/ssl.c   up to 1.12
+usr.bin/ftp/ssl.h   up to 1.5
+usr.bin/ftp/util.c  up to 1.164
+usr.bin/ftp/version.h   up to 1.94
+
+	ftp(1): validate address from PASV and LPSV response.
+	Use raw write(2) instead of fwrite(3) to avoid stream
+	corruption because of the progress bar interrupts.
+	Fixes for PR 56219 and PR 55857.
+	PR 57003: Support relative redirects.
+	[christos, #1763]
+



CVS commit: [netbsd-8] src/doc

2022-09-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 12 17:10:34 UTC 2022

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

Log Message:
Ticket #1763 has been re-instated


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.150 -r1.1.2.151 src/doc/CHANGES-8.3

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



CVS commit: [netbsd-8] src/usr.bin/ftp

2022-09-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 12 17:08:13 UTC 2022

Modified Files:
src/usr.bin/ftp [netbsd-8]: Makefile cmds.c complete.c domacro.c
extern.h fetch.c ftp.1 ftp.c ftp_var.h main.c progressbar.c
progressbar.h ssl.c ssl.h util.c version.h

Log Message:
Catch up to current, requested by christos in ticket #1763:

usr.bin/ftp/Makefileup to 1.39
usr.bin/ftp/cmds.c  up to 1.141
usr.bin/ftp/complete.c  up to 1.47
usr.bin/ftp/domacro.c   up to 1.23
usr.bin/ftp/extern.hup to 1.82
usr.bin/ftp/fetch.c up to 1.235
usr.bin/ftp/ftp.1   up to 1.147
usr.bin/ftp/ftp.c   up to 1.174
usr.bin/ftp/ftp_var.h   up to 1.86
usr.bin/ftp/main.c  up to 1.128
usr.bin/ftp/progressbar.c   up to 1.24
usr.bin/ftp/progressbar.h   up to 1.9
usr.bin/ftp/ssl.c   up to 1.12
usr.bin/ftp/ssl.h   up to 1.5
usr.bin/ftp/util.c  up to 1.164
usr.bin/ftp/version.h   up to 1.94

ftp(1): validate address from PASV and LPSV response.
ftp(1): use raw write(2) instead of fwrite(3) to avoid stream
corruption because of the progress bar interrupts.
Fixes for PR 56219 and PR 55857.
PR 57003: Support relative redirects.


To generate a diff of this commit:
cvs rdiff -u -r1.37.2.2 -r1.37.2.3 src/usr.bin/ftp/Makefile
cvs rdiff -u -r1.137.8.2 -r1.137.8.3 src/usr.bin/ftp/cmds.c
cvs rdiff -u -r1.46.38.2 -r1.46.38.3 src/usr.bin/ftp/complete.c
cvs rdiff -u -r1.22.38.2 -r1.22.38.3 src/usr.bin/ftp/domacro.c
cvs rdiff -u -r1.80.24.2 -r1.80.24.3 src/usr.bin/ftp/extern.h
cvs rdiff -u -r1.228.4.2 -r1.228.4.3 src/usr.bin/ftp/fetch.c
cvs rdiff -u -r1.135.8.2 -r1.135.8.3 src/usr.bin/ftp/ftp.1
cvs rdiff -u -r1.167.6.2 -r1.167.6.3 src/usr.bin/ftp/ftp.c
cvs rdiff -u -r1.84.8.2 -r1.84.8.3 src/usr.bin/ftp/ftp_var.h
cvs rdiff -u -r1.123.8.2 -r1.123.8.3 src/usr.bin/ftp/main.c
cvs rdiff -u -r1.22.24.2 -r1.22.24.3 src/usr.bin/ftp/progressbar.c
cvs rdiff -u -r1.8.38.2 -r1.8.38.3 src/usr.bin/ftp/progressbar.h
cvs rdiff -u -r1.5.8.2 -r1.5.8.3 src/usr.bin/ftp/ssl.c
cvs rdiff -u -r1.3.8.2 -r1.3.8.3 src/usr.bin/ftp/ssl.h
cvs rdiff -u -r1.158.22.2 -r1.158.22.3 src/usr.bin/ftp/util.c
cvs rdiff -u -r1.87.8.2 -r1.87.8.3 src/usr.bin/ftp/version.h

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/ftp/Makefile
diff -u src/usr.bin/ftp/Makefile:1.37.2.2 src/usr.bin/ftp/Makefile:1.37.2.3
--- src/usr.bin/ftp/Makefile:1.37.2.2	Mon Sep 12 15:05:21 2022
+++ src/usr.bin/ftp/Makefile	Mon Sep 12 17:08:13 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.37.2.2 2022/09/12 15:05:21 martin Exp $
+#	$NetBSD: Makefile,v 1.37.2.3 2022/09/12 17:08:13 martin Exp $
 #	from: @(#)Makefile	8.2 (Berkeley) 4/3/94
 
 .include 
@@ -8,6 +8,7 @@ USE_FORT?= yes	# network client
 PROG=	ftp
 SRCS=	cmds.c cmdtab.c complete.c domacro.c fetch.c ftp.c main.c \
 	progressbar.c ruserpass.c util.c
+SRCS+=	ssl.c
 
 # Uncomment the following to provide defaults for gate-ftp operation
 #
@@ -19,7 +20,6 @@ CPPFLAGS+=-DNO_EDITCOMPLETE -DNO_ABOUT -
 LDADD+=	-ledit -lterminfo
 DPADD+=	${LIBEDIT} ${LIBTERMINFO}
 CPPFLAGS+= -DWITH_SSL
-SRCS+=ssl.c
 LDADD+= -lssl -lcrypto
 DPADD+= ${LIBSSL} ${LIBCRYPTO}
 .endif
@@ -31,4 +31,6 @@ CPPFLAGS+= -DINET6
 cmds.o fetch.o: version.h
 main.o:	ftp_var.h
 
+CWARNFLAGS.gcc+=	${GCC_NO_FORMAT_OVERFLOW}
+
 .include 

Index: src/usr.bin/ftp/cmds.c
diff -u src/usr.bin/ftp/cmds.c:1.137.8.2 src/usr.bin/ftp/cmds.c:1.137.8.3
--- src/usr.bin/ftp/cmds.c:1.137.8.2	Mon Sep 12 15:05:21 2022
+++ src/usr.bin/ftp/cmds.c	Mon Sep 12 17:08:13 2022
@@ -1,7 +1,7 @@
-/*	$NetBSD: cmds.c,v 1.137.8.2 2022/09/12 15:05:21 martin Exp $	*/
+/*	$NetBSD: cmds.c,v 1.137.8.3 2022/09/12 17:08:13 martin Exp $	*/
 
 /*-
- * Copyright (c) 1996-2009 The NetBSD Foundation, Inc.
+ * Copyright (c) 1996-2021 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -96,7 +96,7 @@
 #if 0
 static char sccsid[] = "@(#)cmds.c	8.6 (Berkeley) 10/9/94";
 #else
-__RCSID("$NetBSD: cmds.c,v 1.137.8.2 2022/09/12 15:05:21 martin Exp $");
+__RCSID("$NetBSD: cmds.c,v 1.137.8.3 2022/09/12 17:08:13 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -1131,7 +1131,7 @@ setdebug(int argc, char *argv[])
 		options |= SO_DEBUG;
 	else
 		options &= ~SO_DEBUG;
-	fprintf(ttyout, "Debugging %s (ftp_debug=%d).\n", onoff(ftp_debug), ftp_debug);
+	fprintf(ttyout, "Debugging %s (debug=%d).\n", 

CVS commit: [netbsd-8] src/usr.bin/ftp

2022-09-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 12 17:08:13 UTC 2022

Modified Files:
src/usr.bin/ftp [netbsd-8]: Makefile cmds.c complete.c domacro.c
extern.h fetch.c ftp.1 ftp.c ftp_var.h main.c progressbar.c
progressbar.h ssl.c ssl.h util.c version.h

Log Message:
Catch up to current, requested by christos in ticket #1763:

usr.bin/ftp/Makefileup to 1.39
usr.bin/ftp/cmds.c  up to 1.141
usr.bin/ftp/complete.c  up to 1.47
usr.bin/ftp/domacro.c   up to 1.23
usr.bin/ftp/extern.hup to 1.82
usr.bin/ftp/fetch.c up to 1.235
usr.bin/ftp/ftp.1   up to 1.147
usr.bin/ftp/ftp.c   up to 1.174
usr.bin/ftp/ftp_var.h   up to 1.86
usr.bin/ftp/main.c  up to 1.128
usr.bin/ftp/progressbar.c   up to 1.24
usr.bin/ftp/progressbar.h   up to 1.9
usr.bin/ftp/ssl.c   up to 1.12
usr.bin/ftp/ssl.h   up to 1.5
usr.bin/ftp/util.c  up to 1.164
usr.bin/ftp/version.h   up to 1.94

ftp(1): validate address from PASV and LPSV response.
ftp(1): use raw write(2) instead of fwrite(3) to avoid stream
corruption because of the progress bar interrupts.
Fixes for PR 56219 and PR 55857.
PR 57003: Support relative redirects.


To generate a diff of this commit:
cvs rdiff -u -r1.37.2.2 -r1.37.2.3 src/usr.bin/ftp/Makefile
cvs rdiff -u -r1.137.8.2 -r1.137.8.3 src/usr.bin/ftp/cmds.c
cvs rdiff -u -r1.46.38.2 -r1.46.38.3 src/usr.bin/ftp/complete.c
cvs rdiff -u -r1.22.38.2 -r1.22.38.3 src/usr.bin/ftp/domacro.c
cvs rdiff -u -r1.80.24.2 -r1.80.24.3 src/usr.bin/ftp/extern.h
cvs rdiff -u -r1.228.4.2 -r1.228.4.3 src/usr.bin/ftp/fetch.c
cvs rdiff -u -r1.135.8.2 -r1.135.8.3 src/usr.bin/ftp/ftp.1
cvs rdiff -u -r1.167.6.2 -r1.167.6.3 src/usr.bin/ftp/ftp.c
cvs rdiff -u -r1.84.8.2 -r1.84.8.3 src/usr.bin/ftp/ftp_var.h
cvs rdiff -u -r1.123.8.2 -r1.123.8.3 src/usr.bin/ftp/main.c
cvs rdiff -u -r1.22.24.2 -r1.22.24.3 src/usr.bin/ftp/progressbar.c
cvs rdiff -u -r1.8.38.2 -r1.8.38.3 src/usr.bin/ftp/progressbar.h
cvs rdiff -u -r1.5.8.2 -r1.5.8.3 src/usr.bin/ftp/ssl.c
cvs rdiff -u -r1.3.8.2 -r1.3.8.3 src/usr.bin/ftp/ssl.h
cvs rdiff -u -r1.158.22.2 -r1.158.22.3 src/usr.bin/ftp/util.c
cvs rdiff -u -r1.87.8.2 -r1.87.8.3 src/usr.bin/ftp/version.h

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



CVS commit: [netbsd-9] src/usr.bin/ftp

2022-09-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 12 17:06:56 UTC 2022

Modified Files:
src/usr.bin/ftp [netbsd-9]: Makefile cmds.c fetch.c ftp.1 ftp.c
ftp_var.h main.c progressbar.c progressbar.h ssl.c ssl.h util.c
version.h

Log Message:
Catch up to current, requested by christos in ticket #1523

usr.bin/ftp/Makefileup to 1.39
usr.bin/ftp/fetch.c up to 1.235
usr.bin/ftp/ftp.1   up to 1.147
usr.bin/ftp/ftp_var.h   up to 1.86
usr.bin/ftp/main.c  up to 1.128
usr.bin/ftp/ssl.c   up to 1.12
usr.bin/ftp/util.c  up to 1.164
usr.bin/ftp/version.h   up to 1.94

PR 57003: Support relative redirects.


To generate a diff of this commit:
cvs rdiff -u -r1.37.12.3 -r1.37.12.4 src/usr.bin/ftp/Makefile
cvs rdiff -u -r1.140.2.1 -r1.140.2.2 src/usr.bin/ftp/cmds.c
cvs rdiff -u -r1.231.2.4 -r1.231.2.5 src/usr.bin/ftp/fetch.c
cvs rdiff -u -r1.136.8.3 -r1.136.8.4 src/usr.bin/ftp/ftp.1
cvs rdiff -u -r1.168.2.6 -r1.168.2.7 src/usr.bin/ftp/ftp.c
cvs rdiff -u -r1.85.6.2 -r1.85.6.3 src/usr.bin/ftp/ftp_var.h
cvs rdiff -u -r1.126.2.2 -r1.126.2.3 src/usr.bin/ftp/main.c
cvs rdiff -u -r1.23.2.1 -r1.23.2.2 src/usr.bin/ftp/progressbar.c
cvs rdiff -u -r1.8.48.1 -r1.8.48.2 src/usr.bin/ftp/progressbar.h
cvs rdiff -u -r1.8.2.4 -r1.8.2.5 src/usr.bin/ftp/ssl.c
cvs rdiff -u -r1.4.2.1 -r1.4.2.2 src/usr.bin/ftp/ssl.h
cvs rdiff -u -r1.160.2.3 -r1.160.2.4 src/usr.bin/ftp/util.c
cvs rdiff -u -r1.87.18.5 -r1.87.18.6 src/usr.bin/ftp/version.h

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



CVS commit: [netbsd-9] src/usr.bin/ftp

2022-09-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 12 17:06:56 UTC 2022

Modified Files:
src/usr.bin/ftp [netbsd-9]: Makefile cmds.c fetch.c ftp.1 ftp.c
ftp_var.h main.c progressbar.c progressbar.h ssl.c ssl.h util.c
version.h

Log Message:
Catch up to current, requested by christos in ticket #1523

usr.bin/ftp/Makefileup to 1.39
usr.bin/ftp/fetch.c up to 1.235
usr.bin/ftp/ftp.1   up to 1.147
usr.bin/ftp/ftp_var.h   up to 1.86
usr.bin/ftp/main.c  up to 1.128
usr.bin/ftp/ssl.c   up to 1.12
usr.bin/ftp/util.c  up to 1.164
usr.bin/ftp/version.h   up to 1.94

PR 57003: Support relative redirects.


To generate a diff of this commit:
cvs rdiff -u -r1.37.12.3 -r1.37.12.4 src/usr.bin/ftp/Makefile
cvs rdiff -u -r1.140.2.1 -r1.140.2.2 src/usr.bin/ftp/cmds.c
cvs rdiff -u -r1.231.2.4 -r1.231.2.5 src/usr.bin/ftp/fetch.c
cvs rdiff -u -r1.136.8.3 -r1.136.8.4 src/usr.bin/ftp/ftp.1
cvs rdiff -u -r1.168.2.6 -r1.168.2.7 src/usr.bin/ftp/ftp.c
cvs rdiff -u -r1.85.6.2 -r1.85.6.3 src/usr.bin/ftp/ftp_var.h
cvs rdiff -u -r1.126.2.2 -r1.126.2.3 src/usr.bin/ftp/main.c
cvs rdiff -u -r1.23.2.1 -r1.23.2.2 src/usr.bin/ftp/progressbar.c
cvs rdiff -u -r1.8.48.1 -r1.8.48.2 src/usr.bin/ftp/progressbar.h
cvs rdiff -u -r1.8.2.4 -r1.8.2.5 src/usr.bin/ftp/ssl.c
cvs rdiff -u -r1.4.2.1 -r1.4.2.2 src/usr.bin/ftp/ssl.h
cvs rdiff -u -r1.160.2.3 -r1.160.2.4 src/usr.bin/ftp/util.c
cvs rdiff -u -r1.87.18.5 -r1.87.18.6 src/usr.bin/ftp/version.h

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/ftp/Makefile
diff -u src/usr.bin/ftp/Makefile:1.37.12.3 src/usr.bin/ftp/Makefile:1.37.12.4
--- src/usr.bin/ftp/Makefile:1.37.12.3	Mon Sep 12 15:02:47 2022
+++ src/usr.bin/ftp/Makefile	Mon Sep 12 17:06:56 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.37.12.3 2022/09/12 15:02:47 martin Exp $
+#	$NetBSD: Makefile,v 1.37.12.4 2022/09/12 17:06:56 martin Exp $
 #	from: @(#)Makefile	8.2 (Berkeley) 4/3/94
 
 .include 
@@ -31,4 +31,6 @@ CPPFLAGS+= -DINET6
 cmds.o fetch.o: version.h
 main.o:	ftp_var.h
 
+CWARNFLAGS.gcc+=	${GCC_NO_FORMAT_OVERFLOW}
+
 .include 

Index: src/usr.bin/ftp/cmds.c
diff -u src/usr.bin/ftp/cmds.c:1.140.2.1 src/usr.bin/ftp/cmds.c:1.140.2.2
--- src/usr.bin/ftp/cmds.c:1.140.2.1	Mon Jun 14 11:52:52 2021
+++ src/usr.bin/ftp/cmds.c	Mon Sep 12 17:06:56 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: cmds.c,v 1.140.2.1 2021/06/14 11:52:52 martin Exp $	*/
+/*	$NetBSD: cmds.c,v 1.140.2.2 2022/09/12 17:06:56 martin Exp $	*/
 
 /*-
  * Copyright (c) 1996-2021 The NetBSD Foundation, Inc.
@@ -96,7 +96,7 @@
 #if 0
 static char sccsid[] = "@(#)cmds.c	8.6 (Berkeley) 10/9/94";
 #else
-__RCSID("$NetBSD: cmds.c,v 1.140.2.1 2021/06/14 11:52:52 martin Exp $");
+__RCSID("$NetBSD: cmds.c,v 1.140.2.2 2022/09/12 17:06:56 martin Exp $");
 #endif
 #endif /* not lint */
 

Index: src/usr.bin/ftp/fetch.c
diff -u src/usr.bin/ftp/fetch.c:1.231.2.4 src/usr.bin/ftp/fetch.c:1.231.2.5
--- src/usr.bin/ftp/fetch.c:1.231.2.4	Mon Sep 12 15:02:47 2022
+++ src/usr.bin/ftp/fetch.c	Mon Sep 12 17:06:56 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: fetch.c,v 1.231.2.4 2022/09/12 15:02:47 martin Exp $	*/
+/*	$NetBSD: fetch.c,v 1.231.2.5 2022/09/12 17:06:56 martin Exp $	*/
 
 /*-
  * Copyright (c) 1997-2015 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: fetch.c,v 1.231.2.4 2022/09/12 15:02:47 martin Exp $");
+__RCSID("$NetBSD: fetch.c,v 1.231.2.5 2022/09/12 17:06:56 martin Exp $");
 #endif /* not lint */
 
 /*
@@ -106,12 +106,13 @@ __dead static void	timeouthttp(int);
 static int	auth_url(const char *, char **, const struct authinfo *);
 static void	base64_encode(const unsigned char *, size_t, unsigned char *);
 #endif
-static int	go_fetch(const char *);
+static int	go_fetch(const char *, struct urlinfo *);
 static int	fetch_ftp(const char *);
-static int	fetch_url(const char *, const char *, char *, char *);
+static int	fetch_url(const char *, const char *, char *, char *,
+struct urlinfo *);
 static const char *match_token(const char **, const char *);
 static int	parse_url(const char *, const char *, struct urlinfo *,
-struct authinfo *);
+struct authinfo *, struct urlinfo *);
 static void	url_decode(char *);
 static void	freeauthinfo(struct authinfo *);
 static void	freeurlinfo(struct urlinfo *);
@@ -274,7 +275,7 @@ auth_url(const char *challenge, char **r
 	scheme = "Basic";	/* only support Basic authentication */
 	gotpass = NULL;
 
-	DPRINTF("auth_url: challenge `%s'\n", challenge);
+	DPRINTF("%s: challenge `%s'\n", __func__, challenge);
 
 	if (! match_token(, scheme)) {
 		warnx("Unsupported authentication challenge `%s'",
@@ -336,7 

CVS commit: [netbsd-8] src/doc

2022-09-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 12 15:05:58 UTC 2022

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

Log Message:
backout of #1763


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.149 -r1.1.2.150 src/doc/CHANGES-8.3

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

Modified files:

Index: src/doc/CHANGES-8.3
diff -u src/doc/CHANGES-8.3:1.1.2.149 src/doc/CHANGES-8.3:1.1.2.150
--- src/doc/CHANGES-8.3:1.1.2.149	Mon Sep 12 14:49:03 2022
+++ src/doc/CHANGES-8.3	Mon Sep 12 15:05:58 2022
@@ -1,4 +1,4 @@
- $NetBSD: CHANGES-8.3,v 1.1.2.149 2022/09/12 14:49:03 martin Exp $
+ $NetBSD: CHANGES-8.3,v 1.1.2.150 2022/09/12 15:05:58 martin Exp $
 
 A complete list of changes from the NetBSD 8.2 release to the NetBSD 8.3
 release:
@@ -2814,27 +2814,3 @@ usr.bin/netstat/vtw.c		1.11,1.13
 	- KNF. Style fixes.
 	[msaitoh, ticket #1762]
 
-usr.bin/ftp/Makefileup to 1.39
-usr.bin/ftp/cmds.c  up to 1.141
-usr.bin/ftp/complete.c  up to 1.47
-usr.bin/ftp/domacro.c   up to 1.23
-usr.bin/ftp/extern.hup to 1.82
-usr.bin/ftp/fetch.c up to 1.235
-usr.bin/ftp/ftp.1   up to 1.147
-usr.bin/ftp/ftp.c   up to 1.174
-usr.bin/ftp/ftp_var.h   up to 1.86
-usr.bin/ftp/main.c  up to 1.128
-usr.bin/ftp/progressbar.c   up to 1.24
-usr.bin/ftp/progressbar.h   up to 1.9
-usr.bin/ftp/ssl.c   up to 1.11
-usr.bin/ftp/ssl.h   up to 1.5
-usr.bin/ftp/util.c  up to 1.164
-usr.bin/ftp/version.h   up to 1.94
-
-	ftp(1): validate address from PASV and LPSV response.
-	Use raw write(2) instead of fwrite(3) to avoid stream
-	corruption because of the progress bar interrupts.
-	Fixes for PR 56219 and PR 55857.
-	PR 57003: Support relative redirects.
-	[christos, #1763]
-



CVS commit: src/usr.bin/ftp

2022-09-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep 12 15:10:31 UTC 2022

Modified Files:
src/usr.bin/ftp: ssl.c

Log Message:
Disable verification for now until we implement installation of trust anchors.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/usr.bin/ftp/ssl.c

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

Modified files:

Index: src/usr.bin/ftp/ssl.c
diff -u src/usr.bin/ftp/ssl.c:1.11 src/usr.bin/ftp/ssl.c:1.12
--- src/usr.bin/ftp/ssl.c:1.11	Tue Aug 30 04:51:28 2022
+++ src/usr.bin/ftp/ssl.c	Mon Sep 12 11:10:31 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: ssl.c,v 1.11 2022/08/30 08:51:28 christos Exp $	*/
+/*	$NetBSD: ssl.c,v 1.12 2022/09/12 15:10:31 christos Exp $	*/
 
 /*-
  * Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav
@@ -34,7 +34,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: ssl.c,v 1.11 2022/08/30 08:51:28 christos Exp $");
+__RCSID("$NetBSD: ssl.c,v 1.12 2022/09/12 15:10:31 christos Exp $");
 #endif
 
 #include 
@@ -589,7 +589,7 @@ fetch_start_ssl(int sock, const char *se
 	SSL_CTX *ctx;
 	X509_VERIFY_PARAM *param;
 	int ret, ssl_err;
-	int verify = getenv("NO_CERT_VERIFY") == NULL;
+	int verify = 0;	// getenv("NO_CERT_VERIFY") == NULL;
 
 	/* Init the SSL library and context */
 	if (!SSL_library_init()){



CVS commit: src/usr.bin/ftp

2022-09-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep 12 15:10:31 UTC 2022

Modified Files:
src/usr.bin/ftp: ssl.c

Log Message:
Disable verification for now until we implement installation of trust anchors.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/usr.bin/ftp/ssl.c

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



CVS commit: [netbsd-8] src/doc

2022-09-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 12 15:05:58 UTC 2022

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

Log Message:
backout of #1763


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.149 -r1.1.2.150 src/doc/CHANGES-8.3

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



CVS commit: [netbsd-8] src/usr.bin/ftp

2022-09-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 12 15:05:21 UTC 2022

Modified Files:
src/usr.bin/ftp [netbsd-8]: Makefile cmds.c complete.c domacro.c
extern.h fetch.c ftp.1 ftp.c ftp_var.h main.c progressbar.c
progressbar.h ssl.c ssl.h util.c version.h

Log Message:
Backout ticket #1763 for now - trust anchors are not solved.


To generate a diff of this commit:
cvs rdiff -u -r1.37.2.1 -r1.37.2.2 src/usr.bin/ftp/Makefile
cvs rdiff -u -r1.137.8.1 -r1.137.8.2 src/usr.bin/ftp/cmds.c
cvs rdiff -u -r1.46.38.1 -r1.46.38.2 src/usr.bin/ftp/complete.c
cvs rdiff -u -r1.22.38.1 -r1.22.38.2 src/usr.bin/ftp/domacro.c
cvs rdiff -u -r1.80.24.1 -r1.80.24.2 src/usr.bin/ftp/extern.h
cvs rdiff -u -r1.228.4.1 -r1.228.4.2 src/usr.bin/ftp/fetch.c
cvs rdiff -u -r1.135.8.1 -r1.135.8.2 src/usr.bin/ftp/ftp.1
cvs rdiff -u -r1.167.6.1 -r1.167.6.2 src/usr.bin/ftp/ftp.c
cvs rdiff -u -r1.84.8.1 -r1.84.8.2 src/usr.bin/ftp/ftp_var.h
cvs rdiff -u -r1.123.8.1 -r1.123.8.2 src/usr.bin/ftp/main.c
cvs rdiff -u -r1.22.24.1 -r1.22.24.2 src/usr.bin/ftp/progressbar.c
cvs rdiff -u -r1.8.38.1 -r1.8.38.2 src/usr.bin/ftp/progressbar.h
cvs rdiff -u -r1.5.8.1 -r1.5.8.2 src/usr.bin/ftp/ssl.c
cvs rdiff -u -r1.3.8.1 -r1.3.8.2 src/usr.bin/ftp/ssl.h
cvs rdiff -u -r1.158.22.1 -r1.158.22.2 src/usr.bin/ftp/util.c
cvs rdiff -u -r1.87.8.1 -r1.87.8.2 src/usr.bin/ftp/version.h

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/ftp/Makefile
diff -u src/usr.bin/ftp/Makefile:1.37.2.1 src/usr.bin/ftp/Makefile:1.37.2.2
--- src/usr.bin/ftp/Makefile:1.37.2.1	Mon Sep 12 14:46:51 2022
+++ src/usr.bin/ftp/Makefile	Mon Sep 12 15:05:21 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.37.2.1 2022/09/12 14:46:51 martin Exp $
+#	$NetBSD: Makefile,v 1.37.2.2 2022/09/12 15:05:21 martin Exp $
 #	from: @(#)Makefile	8.2 (Berkeley) 4/3/94
 
 .include 
@@ -8,7 +8,6 @@ USE_FORT?= yes	# network client
 PROG=	ftp
 SRCS=	cmds.c cmdtab.c complete.c domacro.c fetch.c ftp.c main.c \
 	progressbar.c ruserpass.c util.c
-SRCS+=	ssl.c
 
 # Uncomment the following to provide defaults for gate-ftp operation
 #
@@ -20,6 +19,7 @@ CPPFLAGS+=-DNO_EDITCOMPLETE -DNO_ABOUT -
 LDADD+=	-ledit -lterminfo
 DPADD+=	${LIBEDIT} ${LIBTERMINFO}
 CPPFLAGS+= -DWITH_SSL
+SRCS+=ssl.c
 LDADD+= -lssl -lcrypto
 DPADD+= ${LIBSSL} ${LIBCRYPTO}
 .endif
@@ -31,6 +31,4 @@ CPPFLAGS+= -DINET6
 cmds.o fetch.o: version.h
 main.o:	ftp_var.h
 
-CWARNFLAGS.gcc+=	${GCC_NO_FORMAT_OVERFLOW}
-
 .include 

Index: src/usr.bin/ftp/cmds.c
diff -u src/usr.bin/ftp/cmds.c:1.137.8.1 src/usr.bin/ftp/cmds.c:1.137.8.2
--- src/usr.bin/ftp/cmds.c:1.137.8.1	Mon Sep 12 14:46:51 2022
+++ src/usr.bin/ftp/cmds.c	Mon Sep 12 15:05:21 2022
@@ -1,7 +1,7 @@
-/*	$NetBSD: cmds.c,v 1.137.8.1 2022/09/12 14:46:51 martin Exp $	*/
+/*	$NetBSD: cmds.c,v 1.137.8.2 2022/09/12 15:05:21 martin Exp $	*/
 
 /*-
- * Copyright (c) 1996-2021 The NetBSD Foundation, Inc.
+ * Copyright (c) 1996-2009 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -96,7 +96,7 @@
 #if 0
 static char sccsid[] = "@(#)cmds.c	8.6 (Berkeley) 10/9/94";
 #else
-__RCSID("$NetBSD: cmds.c,v 1.137.8.1 2022/09/12 14:46:51 martin Exp $");
+__RCSID("$NetBSD: cmds.c,v 1.137.8.2 2022/09/12 15:05:21 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -1131,7 +1131,7 @@ setdebug(int argc, char *argv[])
 		options |= SO_DEBUG;
 	else
 		options &= ~SO_DEBUG;
-	fprintf(ttyout, "Debugging %s (debug=%d).\n", onoff(ftp_debug), ftp_debug);
+	fprintf(ttyout, "Debugging %s (ftp_debug=%d).\n", onoff(ftp_debug), ftp_debug);
 	code = ftp_debug > 0;
 }
 
@@ -1158,8 +1158,7 @@ cd(int argc, char *argv[])
 	}
 	if (r == COMPLETE) {
 		dirchange = 1;
-		remotecwd[0] = '\0';
-		remcwdvalid = 0;
+		updateremotecwd();
 	}
 }
 
@@ -1545,9 +1544,9 @@ pwd(int argc, char *argv[])
 		UPRINTF("usage: %s\n", argv[0]);
 		return;
 	}
-	if (!remcwdvalid || remotecwd[0] == '\0')
+	if (! remotecwd[0])
 		updateremotecwd();
-	if (remotecwd[0] == '\0')
+	if (! remotecwd[0])
 		fprintf(ttyout, "Unable to determine remote directory\n");
 	else {
 		fprintf(ttyout, "Remote directory: %s\n", remotecwd);
@@ -1776,18 +1775,6 @@ quit(int argc, char *argv[])
 	exit(0);
 }
 
-void __dead
-justquit(void)
-{
-
-	quit(0, NULL);
-	/*
-	 * quit is not __dead, but for our invocation it never will return,
-	 * but some compilers are not smart enough to find this out.
-	 */
-	exit(0);
-}
-
 /*
  * Terminate session, but don't exit.
  * May be called with 0, NULL.
@@ -2197,7 +2184,7 @@ LOOP:
 	}
 	break;
 }
-/* FALLTHROUGH */
+/* intentional drop through */
 			default:
 *cp2++ = *cp1;
 break;
@@ -2372,8 +2359,7 @@ cdup(int argc, char *argv[])
 	}
 	if (r == COMPLETE) {
 		dirchange = 1;
-		remotecwd[0] = '\0';
-		remcwdvalid = 0;
+		updateremotecwd();
 	}
 }
 

Index: src/usr.bin/ftp/complete.c
diff -u 

CVS commit: [netbsd-8] src/usr.bin/ftp

2022-09-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 12 15:05:21 UTC 2022

Modified Files:
src/usr.bin/ftp [netbsd-8]: Makefile cmds.c complete.c domacro.c
extern.h fetch.c ftp.1 ftp.c ftp_var.h main.c progressbar.c
progressbar.h ssl.c ssl.h util.c version.h

Log Message:
Backout ticket #1763 for now - trust anchors are not solved.


To generate a diff of this commit:
cvs rdiff -u -r1.37.2.1 -r1.37.2.2 src/usr.bin/ftp/Makefile
cvs rdiff -u -r1.137.8.1 -r1.137.8.2 src/usr.bin/ftp/cmds.c
cvs rdiff -u -r1.46.38.1 -r1.46.38.2 src/usr.bin/ftp/complete.c
cvs rdiff -u -r1.22.38.1 -r1.22.38.2 src/usr.bin/ftp/domacro.c
cvs rdiff -u -r1.80.24.1 -r1.80.24.2 src/usr.bin/ftp/extern.h
cvs rdiff -u -r1.228.4.1 -r1.228.4.2 src/usr.bin/ftp/fetch.c
cvs rdiff -u -r1.135.8.1 -r1.135.8.2 src/usr.bin/ftp/ftp.1
cvs rdiff -u -r1.167.6.1 -r1.167.6.2 src/usr.bin/ftp/ftp.c
cvs rdiff -u -r1.84.8.1 -r1.84.8.2 src/usr.bin/ftp/ftp_var.h
cvs rdiff -u -r1.123.8.1 -r1.123.8.2 src/usr.bin/ftp/main.c
cvs rdiff -u -r1.22.24.1 -r1.22.24.2 src/usr.bin/ftp/progressbar.c
cvs rdiff -u -r1.8.38.1 -r1.8.38.2 src/usr.bin/ftp/progressbar.h
cvs rdiff -u -r1.5.8.1 -r1.5.8.2 src/usr.bin/ftp/ssl.c
cvs rdiff -u -r1.3.8.1 -r1.3.8.2 src/usr.bin/ftp/ssl.h
cvs rdiff -u -r1.158.22.1 -r1.158.22.2 src/usr.bin/ftp/util.c
cvs rdiff -u -r1.87.8.1 -r1.87.8.2 src/usr.bin/ftp/version.h

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



CVS commit: [netbsd-9] src/doc

2022-09-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 12 15:03:25 UTC 2022

Modified Files:
src/doc [netbsd-9]: CHANGES-9.4

Log Message:
backout of #1523


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.13 -r1.1.2.14 src/doc/CHANGES-9.4

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-9.4
diff -u src/doc/CHANGES-9.4:1.1.2.13 src/doc/CHANGES-9.4:1.1.2.14
--- src/doc/CHANGES-9.4:1.1.2.13	Mon Sep 12 14:44:35 2022
+++ src/doc/CHANGES-9.4	Mon Sep 12 15:03:25 2022
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.4,v 1.1.2.13 2022/09/12 14:44:35 martin Exp $
+# $NetBSD: CHANGES-9.4,v 1.1.2.14 2022/09/12 15:03:25 martin Exp $
 
 A complete list of changes from the NetBSD 9.3 release to the NetBSD 9.4
 release:
@@ -218,14 +218,3 @@ usr.bin/netstat/vtw.c		1.11,1.13
 	- KNF. Style fixes.
 	[msaitoh, ticket #1522]
 
-usr.bin/ftp/Makefileup to 1.39
-usr.bin/ftp/fetch.c up to 1.235
-usr.bin/ftp/ftp.1   up to 1.147
-usr.bin/ftp/ftp_var.h   up to 1.86
-usr.bin/ftp/main.c  up to 1.128
-usr.bin/ftp/ssl.c   up to 1.11
-usr.bin/ftp/util.c  up to 1.164
-usr.bin/ftp/version.h   up to 1.94
-
-	ftp(1): PR 57003: Support relative redirects.
-	[christos, #1523]



CVS commit: [netbsd-9] src/doc

2022-09-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 12 15:03:25 UTC 2022

Modified Files:
src/doc [netbsd-9]: CHANGES-9.4

Log Message:
backout of #1523


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.13 -r1.1.2.14 src/doc/CHANGES-9.4

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



CVS commit: [netbsd-9] src/usr.bin/ftp

2022-09-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 12 15:02:47 UTC 2022

Modified Files:
src/usr.bin/ftp [netbsd-9]: Makefile fetch.c ftp.1 ftp_var.h main.c
ssl.c util.c version.h

Log Message:
Back out ticket #1523 for now - trust anchor validation is not solved.


To generate a diff of this commit:
cvs rdiff -u -r1.37.12.2 -r1.37.12.3 src/usr.bin/ftp/Makefile
cvs rdiff -u -r1.231.2.3 -r1.231.2.4 src/usr.bin/ftp/fetch.c
cvs rdiff -u -r1.136.8.2 -r1.136.8.3 src/usr.bin/ftp/ftp.1
cvs rdiff -u -r1.85.6.1 -r1.85.6.2 src/usr.bin/ftp/ftp_var.h
cvs rdiff -u -r1.126.2.1 -r1.126.2.2 src/usr.bin/ftp/main.c
cvs rdiff -u -r1.8.2.3 -r1.8.2.4 src/usr.bin/ftp/ssl.c
cvs rdiff -u -r1.160.2.2 -r1.160.2.3 src/usr.bin/ftp/util.c
cvs rdiff -u -r1.87.18.4 -r1.87.18.5 src/usr.bin/ftp/version.h

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/ftp/Makefile
diff -u src/usr.bin/ftp/Makefile:1.37.12.2 src/usr.bin/ftp/Makefile:1.37.12.3
--- src/usr.bin/ftp/Makefile:1.37.12.2	Mon Sep 12 14:42:55 2022
+++ src/usr.bin/ftp/Makefile	Mon Sep 12 15:02:47 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.37.12.2 2022/09/12 14:42:55 martin Exp $
+#	$NetBSD: Makefile,v 1.37.12.3 2022/09/12 15:02:47 martin Exp $
 #	from: @(#)Makefile	8.2 (Berkeley) 4/3/94
 
 .include 
@@ -31,6 +31,4 @@ CPPFLAGS+= -DINET6
 cmds.o fetch.o: version.h
 main.o:	ftp_var.h
 
-CWARNFLAGS.gcc+=	${GCC_NO_FORMAT_OVERFLOW}
-
 .include 

Index: src/usr.bin/ftp/fetch.c
diff -u src/usr.bin/ftp/fetch.c:1.231.2.3 src/usr.bin/ftp/fetch.c:1.231.2.4
--- src/usr.bin/ftp/fetch.c:1.231.2.3	Mon Sep 12 14:42:55 2022
+++ src/usr.bin/ftp/fetch.c	Mon Sep 12 15:02:47 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: fetch.c,v 1.231.2.3 2022/09/12 14:42:55 martin Exp $	*/
+/*	$NetBSD: fetch.c,v 1.231.2.4 2022/09/12 15:02:47 martin Exp $	*/
 
 /*-
  * Copyright (c) 1997-2015 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: fetch.c,v 1.231.2.3 2022/09/12 14:42:55 martin Exp $");
+__RCSID("$NetBSD: fetch.c,v 1.231.2.4 2022/09/12 15:02:47 martin Exp $");
 #endif /* not lint */
 
 /*
@@ -106,13 +106,12 @@ __dead static void	timeouthttp(int);
 static int	auth_url(const char *, char **, const struct authinfo *);
 static void	base64_encode(const unsigned char *, size_t, unsigned char *);
 #endif
-static int	go_fetch(const char *, struct urlinfo *);
+static int	go_fetch(const char *);
 static int	fetch_ftp(const char *);
-static int	fetch_url(const char *, const char *, char *, char *,
-struct urlinfo *);
+static int	fetch_url(const char *, const char *, char *, char *);
 static const char *match_token(const char **, const char *);
 static int	parse_url(const char *, const char *, struct urlinfo *,
-struct authinfo *, struct urlinfo *);
+struct authinfo *);
 static void	url_decode(char *);
 static void	freeauthinfo(struct authinfo *);
 static void	freeurlinfo(struct urlinfo *);
@@ -275,7 +274,7 @@ auth_url(const char *challenge, char **r
 	scheme = "Basic";	/* only support Basic authentication */
 	gotpass = NULL;
 
-	DPRINTF("%s: challenge `%s'\n", __func__, challenge);
+	DPRINTF("auth_url: challenge `%s'\n", challenge);
 
 	if (! match_token(, scheme)) {
 		warnx("Unsupported authentication challenge `%s'",
@@ -337,7 +336,7 @@ auth_url(const char *challenge, char **r
 	*response = ftp_malloc(rlen);
 	(void)strlcpy(*response, scheme, rlen);
 	len = strlcat(*response, " ", rlen);
-			/* use	`clen - 1'  to not encode the trailing NUL */
+			/* use  `clen - 1'  to not encode the trailing NUL */
 	base64_encode((unsigned char *)clear, clen - 1,
 	(unsigned char *)*response + len);
 	memset(clear, 0, clen);
@@ -368,7 +367,7 @@ base64_encode(const unsigned char *clear
 			| ((clear[i + 1] >> 4) & 0x0f)];
 		*(cp++) = enc[((clear[i + 1] << 2) & 0x3c)
 			| ((clear[i + 2] >> 6) & 0x03)];
-		*(cp++) = enc[((clear[i + 2]	 ) & 0x3f)];
+		*(cp++) = enc[((clear[i + 2] ) & 0x3f)];
 	}
 	*cp = '\0';
 	while (i-- > len)
@@ -401,42 +400,6 @@ url_decode(char *url)
 	*q = '\0';
 }
 
-static const char *
-get_port(const struct urlinfo *ui)
-{
-
-	switch(ui->utype) {
-	case HTTP_URL_T:
-		return httpport;
-	case FTP_URL_T:
-		return ftpport;
-	case FILE_URL_T:
-		return "";
-#ifdef WITH_SSL
-	case HTTPS_URL_T:
-		return httpsport;
-#endif
-	default:
-		return NULL;
-	}
-}
-
-static int
-use_relative(const struct urlinfo *ui)
-{
-	if (ui == NULL)
-		return 0;
-	switch (ui->utype) {
-	case HTTP_URL_T:
-	case FILE_URL_T:
-#ifdef WITH_SSL
-	case HTTPS_URL_T:
-#endif
-		return 1;
-	default:
-		return 0;
-	}
-}
 
 /*
  * Parse URL of form (per RFC 3986):
@@ -472,7 +435,7 @@ use_relative(const struct urlinfo *ui)
 
 static int
 parse_url(const char *url, const char *desc, struct urlinfo *ui,
-struct authinfo *auth, struct urlinfo *rui)
+struct authinfo *auth) 
 {
 	const char	*origurl, *tport;
 	char		*cp, *ep, *thost;
@@ -483,26 

CVS commit: [netbsd-9] src/usr.bin/ftp

2022-09-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 12 15:02:47 UTC 2022

Modified Files:
src/usr.bin/ftp [netbsd-9]: Makefile fetch.c ftp.1 ftp_var.h main.c
ssl.c util.c version.h

Log Message:
Back out ticket #1523 for now - trust anchor validation is not solved.


To generate a diff of this commit:
cvs rdiff -u -r1.37.12.2 -r1.37.12.3 src/usr.bin/ftp/Makefile
cvs rdiff -u -r1.231.2.3 -r1.231.2.4 src/usr.bin/ftp/fetch.c
cvs rdiff -u -r1.136.8.2 -r1.136.8.3 src/usr.bin/ftp/ftp.1
cvs rdiff -u -r1.85.6.1 -r1.85.6.2 src/usr.bin/ftp/ftp_var.h
cvs rdiff -u -r1.126.2.1 -r1.126.2.2 src/usr.bin/ftp/main.c
cvs rdiff -u -r1.8.2.3 -r1.8.2.4 src/usr.bin/ftp/ssl.c
cvs rdiff -u -r1.160.2.2 -r1.160.2.3 src/usr.bin/ftp/util.c
cvs rdiff -u -r1.87.18.4 -r1.87.18.5 src/usr.bin/ftp/version.h

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



CVS commit: [netbsd-8] src/doc

2022-09-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 12 14:49:03 UTC 2022

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

Log Message:
Tickets #1762 and #1763


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.148 -r1.1.2.149 src/doc/CHANGES-8.3

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

Modified files:

Index: src/doc/CHANGES-8.3
diff -u src/doc/CHANGES-8.3:1.1.2.148 src/doc/CHANGES-8.3:1.1.2.149
--- src/doc/CHANGES-8.3:1.1.2.148	Sat Sep 10 08:22:38 2022
+++ src/doc/CHANGES-8.3	Mon Sep 12 14:49:03 2022
@@ -1,4 +1,4 @@
- $NetBSD: CHANGES-8.3,v 1.1.2.148 2022/09/10 08:22:38 martin Exp $
+ $NetBSD: CHANGES-8.3,v 1.1.2.149 2022/09/12 14:49:03 martin Exp $
 
 A complete list of changes from the NetBSD 8.2 release to the NetBSD 8.3
 release:
@@ -2784,3 +2784,57 @@ sys/kern/kern_core.c1.37
 	Avoid a GCC warning.
 	[mrg, ticket #1761]
 
+usr.bin/netstat/atalk.c		1.18,1.20-1.21
+usr.bin/netstat/bpf.c		1.16 via patch
+usr.bin/netstat/fast_ipsec.c	1.24 via patch
+usr.bin/netstat/if.c		1.97-1.99,1.101-1.104 via patch
+usr.bin/netstat/inet.c		1.111,1.115-1.116 via patch
+usr.bin/netstat/inet6.c		1.70,1.74-1.75,1.80-1.81 via patch
+usr.bin/netstat/main.c		1.100,1.102-1.103
+usr.bin/netstat/mbuf.c		1.34-1.35
+usr.bin/netstat/mroute.c	1.26-1.27
+usr.bin/netstat/mroute6.c	1.16
+usr.bin/netstat/netstat.h	1.52-1.53
+usr.bin/netstat/pfkey.c		1.4-1.5 via patch
+usr.bin/netstat/pfsync.c	1.4-1.5 via patch
+usr.bin/netstat/route.c		1.87-1.88
+usr.bin/netstat/unix.c		1.36-1.37
+usr.bin/netstat/vtw.c		1.11,1.13
+
+	- Add names of a few more ICMPv6 messages.
+	  Also make the array be explicitly 256 entries long.
+	- sprintf() -> snprintf(), and adjust a buffer size to avoid any
+	  potential for overflow.
+	- Add missing {IP,IP6}_STAT_NOIPSEC to netstat.
+	- Don't show any of the completely and utterly undocumented VTW info
+	  if the feature isn't enabled.
+	- Print oqdrops correctly.
+	- netstat.1: Add various xrefs present in the body to "See Also".
+	- Limit maximum owner name to appease gcc.
+	- KNF. Style fixes.
+	[msaitoh, ticket #1762]
+
+usr.bin/ftp/Makefileup to 1.39
+usr.bin/ftp/cmds.c  up to 1.141
+usr.bin/ftp/complete.c  up to 1.47
+usr.bin/ftp/domacro.c   up to 1.23
+usr.bin/ftp/extern.hup to 1.82
+usr.bin/ftp/fetch.c up to 1.235
+usr.bin/ftp/ftp.1   up to 1.147
+usr.bin/ftp/ftp.c   up to 1.174
+usr.bin/ftp/ftp_var.h   up to 1.86
+usr.bin/ftp/main.c  up to 1.128
+usr.bin/ftp/progressbar.c   up to 1.24
+usr.bin/ftp/progressbar.h   up to 1.9
+usr.bin/ftp/ssl.c   up to 1.11
+usr.bin/ftp/ssl.h   up to 1.5
+usr.bin/ftp/util.c  up to 1.164
+usr.bin/ftp/version.h   up to 1.94
+
+	ftp(1): validate address from PASV and LPSV response.
+	Use raw write(2) instead of fwrite(3) to avoid stream
+	corruption because of the progress bar interrupts.
+	Fixes for PR 56219 and PR 55857.
+	PR 57003: Support relative redirects.
+	[christos, #1763]
+



CVS commit: [netbsd-8] src/doc

2022-09-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 12 14:49:03 UTC 2022

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

Log Message:
Tickets #1762 and #1763


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.148 -r1.1.2.149 src/doc/CHANGES-8.3

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



CVS commit: [netbsd-8] src/usr.bin/ftp

2022-09-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 12 14:46:51 UTC 2022

Modified Files:
src/usr.bin/ftp [netbsd-8]: Makefile cmds.c complete.c domacro.c
extern.h fetch.c ftp.1 ftp.c ftp_var.h main.c progressbar.c
progressbar.h ssl.c ssl.h util.c version.h

Log Message:
Catch up to current, requested by christos in ticket #1763:

usr.bin/ftp/Makefileup to 1.39
usr.bin/ftp/cmds.c  up to 1.141
usr.bin/ftp/complete.c  up to 1.47
usr.bin/ftp/domacro.c   up to 1.23
usr.bin/ftp/extern.hup to 1.82
usr.bin/ftp/fetch.c up to 1.235
usr.bin/ftp/ftp.1   up to 1.147
usr.bin/ftp/ftp.c   up to 1.174
usr.bin/ftp/ftp_var.h   up to 1.86
usr.bin/ftp/main.c  up to 1.128
usr.bin/ftp/progressbar.c   up to 1.24
usr.bin/ftp/progressbar.h   up to 1.9
usr.bin/ftp/ssl.c   up to 1.11
usr.bin/ftp/ssl.h   up to 1.5
usr.bin/ftp/util.c  up to 1.164
usr.bin/ftp/version.h   up to 1.94

ftp(1): validate address from PASV and LPSV response.
ftp(1): use raw write(2) instead of fwrite(3) to avoid stream
corruption because of the progress bar interrupts.
Fixes for PR 56219 and PR 55857.
PR 57003: Support relative redirects.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.37.2.1 src/usr.bin/ftp/Makefile
cvs rdiff -u -r1.137 -r1.137.8.1 src/usr.bin/ftp/cmds.c
cvs rdiff -u -r1.46 -r1.46.38.1 src/usr.bin/ftp/complete.c
cvs rdiff -u -r1.22 -r1.22.38.1 src/usr.bin/ftp/domacro.c
cvs rdiff -u -r1.80 -r1.80.24.1 src/usr.bin/ftp/extern.h
cvs rdiff -u -r1.228 -r1.228.4.1 src/usr.bin/ftp/fetch.c
cvs rdiff -u -r1.135 -r1.135.8.1 src/usr.bin/ftp/ftp.1
cvs rdiff -u -r1.167 -r1.167.6.1 src/usr.bin/ftp/ftp.c
cvs rdiff -u -r1.84 -r1.84.8.1 src/usr.bin/ftp/ftp_var.h
cvs rdiff -u -r1.123 -r1.123.8.1 src/usr.bin/ftp/main.c
cvs rdiff -u -r1.22 -r1.22.24.1 src/usr.bin/ftp/progressbar.c
cvs rdiff -u -r1.8 -r1.8.38.1 src/usr.bin/ftp/progressbar.h
cvs rdiff -u -r1.5 -r1.5.8.1 src/usr.bin/ftp/ssl.c
cvs rdiff -u -r1.3 -r1.3.8.1 src/usr.bin/ftp/ssl.h
cvs rdiff -u -r1.158 -r1.158.22.1 src/usr.bin/ftp/util.c
cvs rdiff -u -r1.87 -r1.87.8.1 src/usr.bin/ftp/version.h

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/ftp/Makefile
diff -u src/usr.bin/ftp/Makefile:1.37 src/usr.bin/ftp/Makefile:1.37.2.1
--- src/usr.bin/ftp/Makefile:1.37	Sun May 21 15:28:43 2017
+++ src/usr.bin/ftp/Makefile	Mon Sep 12 14:46:51 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.37 2017/05/21 15:28:43 riastradh Exp $
+#	$NetBSD: Makefile,v 1.37.2.1 2022/09/12 14:46:51 martin Exp $
 #	from: @(#)Makefile	8.2 (Berkeley) 4/3/94
 
 .include 
@@ -8,6 +8,7 @@ USE_FORT?= yes	# network client
 PROG=	ftp
 SRCS=	cmds.c cmdtab.c complete.c domacro.c fetch.c ftp.c main.c \
 	progressbar.c ruserpass.c util.c
+SRCS+=	ssl.c
 
 # Uncomment the following to provide defaults for gate-ftp operation
 #
@@ -19,7 +20,6 @@ CPPFLAGS+=-DNO_EDITCOMPLETE -DNO_ABOUT -
 LDADD+=	-ledit -lterminfo
 DPADD+=	${LIBEDIT} ${LIBTERMINFO}
 CPPFLAGS+= -DWITH_SSL
-SRCS+=ssl.c
 LDADD+= -lssl -lcrypto
 DPADD+= ${LIBSSL} ${LIBCRYPTO}
 .endif
@@ -31,4 +31,6 @@ CPPFLAGS+= -DINET6
 cmds.o fetch.o: version.h
 main.o:	ftp_var.h
 
+CWARNFLAGS.gcc+=	${GCC_NO_FORMAT_OVERFLOW}
+
 .include 

Index: src/usr.bin/ftp/cmds.c
diff -u src/usr.bin/ftp/cmds.c:1.137 src/usr.bin/ftp/cmds.c:1.137.8.1
--- src/usr.bin/ftp/cmds.c:1.137	Sat Feb 27 16:31:31 2016
+++ src/usr.bin/ftp/cmds.c	Mon Sep 12 14:46:51 2022
@@ -1,7 +1,7 @@
-/*	$NetBSD: cmds.c,v 1.137 2016/02/27 16:31:31 christos Exp $	*/
+/*	$NetBSD: cmds.c,v 1.137.8.1 2022/09/12 14:46:51 martin Exp $	*/
 
 /*-
- * Copyright (c) 1996-2009 The NetBSD Foundation, Inc.
+ * Copyright (c) 1996-2021 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -96,7 +96,7 @@
 #if 0
 static char sccsid[] = "@(#)cmds.c	8.6 (Berkeley) 10/9/94";
 #else
-__RCSID("$NetBSD: cmds.c,v 1.137 2016/02/27 16:31:31 christos Exp $");
+__RCSID("$NetBSD: cmds.c,v 1.137.8.1 2022/09/12 14:46:51 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -1131,7 +1131,7 @@ setdebug(int argc, char *argv[])
 		options |= SO_DEBUG;
 	else
 		options &= ~SO_DEBUG;
-	fprintf(ttyout, "Debugging %s (ftp_debug=%d).\n", onoff(ftp_debug), ftp_debug);
+	fprintf(ttyout, "Debugging %s (debug=%d).\n", onoff(ftp_debug), ftp_debug);
 	code = ftp_debug > 0;
 }
 
@@ -1158,7 +1158,8 @@ cd(int argc, char 

CVS commit: [netbsd-8] src/usr.bin/ftp

2022-09-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 12 14:46:51 UTC 2022

Modified Files:
src/usr.bin/ftp [netbsd-8]: Makefile cmds.c complete.c domacro.c
extern.h fetch.c ftp.1 ftp.c ftp_var.h main.c progressbar.c
progressbar.h ssl.c ssl.h util.c version.h

Log Message:
Catch up to current, requested by christos in ticket #1763:

usr.bin/ftp/Makefileup to 1.39
usr.bin/ftp/cmds.c  up to 1.141
usr.bin/ftp/complete.c  up to 1.47
usr.bin/ftp/domacro.c   up to 1.23
usr.bin/ftp/extern.hup to 1.82
usr.bin/ftp/fetch.c up to 1.235
usr.bin/ftp/ftp.1   up to 1.147
usr.bin/ftp/ftp.c   up to 1.174
usr.bin/ftp/ftp_var.h   up to 1.86
usr.bin/ftp/main.c  up to 1.128
usr.bin/ftp/progressbar.c   up to 1.24
usr.bin/ftp/progressbar.h   up to 1.9
usr.bin/ftp/ssl.c   up to 1.11
usr.bin/ftp/ssl.h   up to 1.5
usr.bin/ftp/util.c  up to 1.164
usr.bin/ftp/version.h   up to 1.94

ftp(1): validate address from PASV and LPSV response.
ftp(1): use raw write(2) instead of fwrite(3) to avoid stream
corruption because of the progress bar interrupts.
Fixes for PR 56219 and PR 55857.
PR 57003: Support relative redirects.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.37.2.1 src/usr.bin/ftp/Makefile
cvs rdiff -u -r1.137 -r1.137.8.1 src/usr.bin/ftp/cmds.c
cvs rdiff -u -r1.46 -r1.46.38.1 src/usr.bin/ftp/complete.c
cvs rdiff -u -r1.22 -r1.22.38.1 src/usr.bin/ftp/domacro.c
cvs rdiff -u -r1.80 -r1.80.24.1 src/usr.bin/ftp/extern.h
cvs rdiff -u -r1.228 -r1.228.4.1 src/usr.bin/ftp/fetch.c
cvs rdiff -u -r1.135 -r1.135.8.1 src/usr.bin/ftp/ftp.1
cvs rdiff -u -r1.167 -r1.167.6.1 src/usr.bin/ftp/ftp.c
cvs rdiff -u -r1.84 -r1.84.8.1 src/usr.bin/ftp/ftp_var.h
cvs rdiff -u -r1.123 -r1.123.8.1 src/usr.bin/ftp/main.c
cvs rdiff -u -r1.22 -r1.22.24.1 src/usr.bin/ftp/progressbar.c
cvs rdiff -u -r1.8 -r1.8.38.1 src/usr.bin/ftp/progressbar.h
cvs rdiff -u -r1.5 -r1.5.8.1 src/usr.bin/ftp/ssl.c
cvs rdiff -u -r1.3 -r1.3.8.1 src/usr.bin/ftp/ssl.h
cvs rdiff -u -r1.158 -r1.158.22.1 src/usr.bin/ftp/util.c
cvs rdiff -u -r1.87 -r1.87.8.1 src/usr.bin/ftp/version.h

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



CVS commit: [netbsd-9] src/doc

2022-09-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 12 14:44:35 UTC 2022

Modified Files:
src/doc [netbsd-9]: CHANGES-9.4

Log Message:
Tickets #1522 and #1523


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.12 -r1.1.2.13 src/doc/CHANGES-9.4

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-9.4
diff -u src/doc/CHANGES-9.4:1.1.2.12 src/doc/CHANGES-9.4:1.1.2.13
--- src/doc/CHANGES-9.4:1.1.2.12	Sun Sep 11 18:26:10 2022
+++ src/doc/CHANGES-9.4	Mon Sep 12 14:44:35 2022
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.4,v 1.1.2.12 2022/09/11 18:26:10 martin Exp $
+# $NetBSD: CHANGES-9.4,v 1.1.2.13 2022/09/12 14:44:35 martin Exp $
 
 A complete list of changes from the NetBSD 9.3 release to the NetBSD 9.4
 release:
@@ -188,3 +188,44 @@ sys/arch/atari/conf/SMALL030			(regen)
 	Improve VGA console settings for Milan, especially for sysinst.
 	[tsutsui, ticket #1521]
 
+usr.bin/netstat/atalk.c		1.18,1.20-1.21
+usr.bin/netstat/bpf.c		1.16 via patch
+usr.bin/netstat/fast_ipsec.c	1.24
+usr.bin/netstat/if.c		1.97-1.99,1.101-1.104 via patch
+usr.bin/netstat/inet.c		1.111,1.115-1.116 via patch
+usr.bin/netstat/inet6.c		1.74-1.75,1.80-1.81 via patch
+usr.bin/netstat/main.c		1.100-1.103
+usr.bin/netstat/mbuf.c		1.35
+usr.bin/netstat/mroute.c	1.26-1.27
+usr.bin/netstat/mroute6.c	1.16
+usr.bin/netstat/netstat.h	1.52-1.53
+usr.bin/netstat/pfkey.c		1.4-1.5 via patch
+usr.bin/netstat/pfsync.c	1.4-1.5 via patch
+usr.bin/netstat/route.c		1.86-1.88
+usr.bin/netstat/unix.c		1.36-1.37
+usr.bin/netstat/vtw.c		1.11,1.13
+
+	- sprintf() -> snprintf(), and adjust a buffer size to avoid any
+	  potential for overflow.
+	- Fix netstat -rs to print it correctly.
+	- Add missing {IP,IP6}_STAT_NOIPSEC to netstat.
+	- Don't show any of the completely and utterly undocumented VTW info
+	  if the feature isn't enabled.
+	- Print oqdrops correctly.
+	- Remove Network ATM soft intr queue reporting, we don't have that
+	  in the kernel anymore.
+	- netstat.1: Add various xrefs present in the body to "See Also".
+	- KNF. Style fixes.
+	[msaitoh, ticket #1522]
+
+usr.bin/ftp/Makefileup to 1.39
+usr.bin/ftp/fetch.c up to 1.235
+usr.bin/ftp/ftp.1   up to 1.147
+usr.bin/ftp/ftp_var.h   up to 1.86
+usr.bin/ftp/main.c  up to 1.128
+usr.bin/ftp/ssl.c   up to 1.11
+usr.bin/ftp/util.c  up to 1.164
+usr.bin/ftp/version.h   up to 1.94
+
+	ftp(1): PR 57003: Support relative redirects.
+	[christos, #1523]



CVS commit: [netbsd-9] src/doc

2022-09-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 12 14:44:35 UTC 2022

Modified Files:
src/doc [netbsd-9]: CHANGES-9.4

Log Message:
Tickets #1522 and #1523


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.12 -r1.1.2.13 src/doc/CHANGES-9.4

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



CVS commit: [netbsd-9] src/usr.bin/ftp

2022-09-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 12 14:42:56 UTC 2022

Modified Files:
src/usr.bin/ftp [netbsd-9]: Makefile fetch.c ftp.1 ftp_var.h main.c
ssl.c util.c version.h

Log Message:
Catch up to current, requested by christos in ticket #1523

usr.bin/ftp/Makefileup to 1.39
usr.bin/ftp/fetch.c up to 1.235
usr.bin/ftp/ftp.1   up to 1.147
usr.bin/ftp/ftp_var.h   up to 1.86
usr.bin/ftp/main.c  up to 1.128
usr.bin/ftp/ssl.c   up to 1.11
usr.bin/ftp/util.c  up to 1.164
usr.bin/ftp/version.h   up to 1.94

PR 57003: Support relative redirects.


To generate a diff of this commit:
cvs rdiff -u -r1.37.12.1 -r1.37.12.2 src/usr.bin/ftp/Makefile
cvs rdiff -u -r1.231.2.2 -r1.231.2.3 src/usr.bin/ftp/fetch.c
cvs rdiff -u -r1.136.8.1 -r1.136.8.2 src/usr.bin/ftp/ftp.1
cvs rdiff -u -r1.85 -r1.85.6.1 src/usr.bin/ftp/ftp_var.h
cvs rdiff -u -r1.126 -r1.126.2.1 src/usr.bin/ftp/main.c
cvs rdiff -u -r1.8.2.2 -r1.8.2.3 src/usr.bin/ftp/ssl.c
cvs rdiff -u -r1.160.2.1 -r1.160.2.2 src/usr.bin/ftp/util.c
cvs rdiff -u -r1.87.18.3 -r1.87.18.4 src/usr.bin/ftp/version.h

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/ftp/Makefile
diff -u src/usr.bin/ftp/Makefile:1.37.12.1 src/usr.bin/ftp/Makefile:1.37.12.2
--- src/usr.bin/ftp/Makefile:1.37.12.1	Mon Jun 14 11:57:39 2021
+++ src/usr.bin/ftp/Makefile	Mon Sep 12 14:42:55 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.37.12.1 2021/06/14 11:57:39 martin Exp $
+#	$NetBSD: Makefile,v 1.37.12.2 2022/09/12 14:42:55 martin Exp $
 #	from: @(#)Makefile	8.2 (Berkeley) 4/3/94
 
 .include 
@@ -31,4 +31,6 @@ CPPFLAGS+= -DINET6
 cmds.o fetch.o: version.h
 main.o:	ftp_var.h
 
+CWARNFLAGS.gcc+=	${GCC_NO_FORMAT_OVERFLOW}
+
 .include 

Index: src/usr.bin/ftp/fetch.c
diff -u src/usr.bin/ftp/fetch.c:1.231.2.2 src/usr.bin/ftp/fetch.c:1.231.2.3
--- src/usr.bin/ftp/fetch.c:1.231.2.2	Sun Oct 24 10:13:40 2021
+++ src/usr.bin/ftp/fetch.c	Mon Sep 12 14:42:55 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: fetch.c,v 1.231.2.2 2021/10/24 10:13:40 martin Exp $	*/
+/*	$NetBSD: fetch.c,v 1.231.2.3 2022/09/12 14:42:55 martin Exp $	*/
 
 /*-
  * Copyright (c) 1997-2015 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: fetch.c,v 1.231.2.2 2021/10/24 10:13:40 martin Exp $");
+__RCSID("$NetBSD: fetch.c,v 1.231.2.3 2022/09/12 14:42:55 martin Exp $");
 #endif /* not lint */
 
 /*
@@ -106,12 +106,13 @@ __dead static void	timeouthttp(int);
 static int	auth_url(const char *, char **, const struct authinfo *);
 static void	base64_encode(const unsigned char *, size_t, unsigned char *);
 #endif
-static int	go_fetch(const char *);
+static int	go_fetch(const char *, struct urlinfo *);
 static int	fetch_ftp(const char *);
-static int	fetch_url(const char *, const char *, char *, char *);
+static int	fetch_url(const char *, const char *, char *, char *,
+struct urlinfo *);
 static const char *match_token(const char **, const char *);
 static int	parse_url(const char *, const char *, struct urlinfo *,
-struct authinfo *);
+struct authinfo *, struct urlinfo *);
 static void	url_decode(char *);
 static void	freeauthinfo(struct authinfo *);
 static void	freeurlinfo(struct urlinfo *);
@@ -274,7 +275,7 @@ auth_url(const char *challenge, char **r
 	scheme = "Basic";	/* only support Basic authentication */
 	gotpass = NULL;
 
-	DPRINTF("auth_url: challenge `%s'\n", challenge);
+	DPRINTF("%s: challenge `%s'\n", __func__, challenge);
 
 	if (! match_token(, scheme)) {
 		warnx("Unsupported authentication challenge `%s'",
@@ -336,7 +337,7 @@ auth_url(const char *challenge, char **r
 	*response = ftp_malloc(rlen);
 	(void)strlcpy(*response, scheme, rlen);
 	len = strlcat(*response, " ", rlen);
-			/* use  `clen - 1'  to not encode the trailing NUL */
+			/* use	`clen - 1'  to not encode the trailing NUL */
 	base64_encode((unsigned char *)clear, clen - 1,
 	(unsigned char *)*response + len);
 	memset(clear, 0, clen);
@@ -367,7 +368,7 @@ base64_encode(const unsigned char *clear
 			| ((clear[i + 1] >> 4) & 0x0f)];
 		*(cp++) = enc[((clear[i + 1] << 2) & 0x3c)
 			| ((clear[i + 2] >> 6) & 0x03)];
-		*(cp++) = enc[((clear[i + 2] ) & 0x3f)];
+		*(cp++) = enc[((clear[i + 2]	 ) & 0x3f)];
 	}
 	*cp = '\0';
 	while (i-- > len)
@@ -400,6 +401,42 @@ url_decode(char *url)
 	*q = '\0';
 }
 
+static const char *
+get_port(const struct urlinfo *ui)
+{
+
+	switch(ui->utype) {
+	case HTTP_URL_T:
+		return httpport;
+	case FTP_URL_T:
+		return ftpport;
+	case FILE_URL_T:
+		return "";
+#ifdef WITH_SSL
+	case HTTPS_URL_T:
+		return httpsport;
+#endif
+	default:
+		return NULL;
+	}
+}
+
+static int

CVS commit: [netbsd-9] src/usr.bin/ftp

2022-09-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 12 14:42:56 UTC 2022

Modified Files:
src/usr.bin/ftp [netbsd-9]: Makefile fetch.c ftp.1 ftp_var.h main.c
ssl.c util.c version.h

Log Message:
Catch up to current, requested by christos in ticket #1523

usr.bin/ftp/Makefileup to 1.39
usr.bin/ftp/fetch.c up to 1.235
usr.bin/ftp/ftp.1   up to 1.147
usr.bin/ftp/ftp_var.h   up to 1.86
usr.bin/ftp/main.c  up to 1.128
usr.bin/ftp/ssl.c   up to 1.11
usr.bin/ftp/util.c  up to 1.164
usr.bin/ftp/version.h   up to 1.94

PR 57003: Support relative redirects.


To generate a diff of this commit:
cvs rdiff -u -r1.37.12.1 -r1.37.12.2 src/usr.bin/ftp/Makefile
cvs rdiff -u -r1.231.2.2 -r1.231.2.3 src/usr.bin/ftp/fetch.c
cvs rdiff -u -r1.136.8.1 -r1.136.8.2 src/usr.bin/ftp/ftp.1
cvs rdiff -u -r1.85 -r1.85.6.1 src/usr.bin/ftp/ftp_var.h
cvs rdiff -u -r1.126 -r1.126.2.1 src/usr.bin/ftp/main.c
cvs rdiff -u -r1.8.2.2 -r1.8.2.3 src/usr.bin/ftp/ssl.c
cvs rdiff -u -r1.160.2.1 -r1.160.2.2 src/usr.bin/ftp/util.c
cvs rdiff -u -r1.87.18.3 -r1.87.18.4 src/usr.bin/ftp/version.h

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



CVS commit: [netbsd-8] src/usr.bin/netstat

2022-09-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 12 14:29:20 UTC 2022

Modified Files:
src/usr.bin/netstat [netbsd-8]: atalk.c bpf.c fast_ipsec.c if.c inet.c
inet6.c main.c mbuf.c mroute.c mroute6.c netstat.1 netstat.h
pfkey.c pfsync.c route.c unix.c vtw.c

Log Message:
Pull up the following, requested by msaitoh in ticket #1762:

usr.bin/netstat/atalk.c 1.18,1.20-1.21
usr.bin/netstat/bpf.c   1.16 via patch
usr.bin/netstat/fast_ipsec.c1.24 via patch
usr.bin/netstat/if.c1.97-1.99,1.101-1.104 via patch
usr.bin/netstat/inet.c  1.111,1.115-1.116 via patch
usr.bin/netstat/inet6.c 1.70,1.74-1.75,1.80-1.81 via patch
usr.bin/netstat/main.c  1.100,1.102-1.103
usr.bin/netstat/mbuf.c  1.34-1.35
usr.bin/netstat/mroute.c1.26-1.27
usr.bin/netstat/mroute6.c   1.16
usr.bin/netstat/netstat.h   1.52-1.53
usr.bin/netstat/pfkey.c 1.4-1.5 via patch
usr.bin/netstat/pfsync.c1.4-1.5 via patch
usr.bin/netstat/route.c 1.87-1.88
usr.bin/netstat/unix.c  1.36-1.37
usr.bin/netstat/vtw.c   1.11,1.13

- Add names of a few more ICMPv6 messages.
  Also make the array be explicitly 256 entries long.
- sprintf() -> snprintf(), and adjust a buffer size to avoid any
  potential for overflow.
- Add missing {IP,IP6}_STAT_NOIPSEC to netstat.
- Don't show any of the completely and utterly undocumented VTW info
  if the feature isn't enabled.
- Print oqdrops correctly.
- netstat.1: Add various xrefs present in the body to "See Also".
- Limit maximum owner name to appease gcc.
- KNF. Style fixes.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.16.8.1 src/usr.bin/netstat/atalk.c
cvs rdiff -u -r1.11 -r1.11.22.1 src/usr.bin/netstat/bpf.c
cvs rdiff -u -r1.21.4.1 -r1.21.4.2 src/usr.bin/netstat/fast_ipsec.c
cvs rdiff -u -r1.94.4.1 -r1.94.4.2 src/usr.bin/netstat/if.c
cvs rdiff -u -r1.107 -r1.107.6.1 src/usr.bin/netstat/inet.c
cvs rdiff -u -r1.69 -r1.69.6.1 src/usr.bin/netstat/inet6.c
cvs rdiff -u -r1.99 -r1.99.8.1 src/usr.bin/netstat/main.c
cvs rdiff -u -r1.33 -r1.33.8.1 src/usr.bin/netstat/mbuf.c
cvs rdiff -u -r1.25 -r1.25.8.1 src/usr.bin/netstat/mroute.c
cvs rdiff -u -r1.15 -r1.15.8.1 src/usr.bin/netstat/mroute6.c
cvs rdiff -u -r1.73 -r1.73.8.1 src/usr.bin/netstat/netstat.1
cvs rdiff -u -r1.51 -r1.51.8.1 src/usr.bin/netstat/netstat.h
cvs rdiff -u -r1.1 -r1.1.34.1 src/usr.bin/netstat/pfkey.c
cvs rdiff -u -r1.1 -r1.1.38.1 src/usr.bin/netstat/pfsync.c
cvs rdiff -u -r1.85 -r1.85.8.1 src/usr.bin/netstat/route.c
cvs rdiff -u -r1.35 -r1.35.6.1 src/usr.bin/netstat/unix.c
cvs rdiff -u -r1.9 -r1.9.8.1 src/usr.bin/netstat/vtw.c

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

Modified files:

Index: src/usr.bin/netstat/atalk.c
diff -u src/usr.bin/netstat/atalk.c:1.16 src/usr.bin/netstat/atalk.c:1.16.8.1
--- src/usr.bin/netstat/atalk.c:1.16	Sat Jun  6 13:08:31 2015
+++ src/usr.bin/netstat/atalk.c	Mon Sep 12 14:29:19 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: atalk.c,v 1.16 2015/06/06 13:08:31 joerg Exp $	*/
+/*	$NetBSD: atalk.c,v 1.16.8.1 2022/09/12 14:29:19 martin Exp $	*/
 
 /*
  * Copyright (c) 1983, 1988, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "from @(#)atalk.c	1.1 (Whistle) 6/6/96";
 #else
-__RCSID("$NetBSD: atalk.c,v 1.16 2015/06/06 13:08:31 joerg Exp $");
+__RCSID("$NetBSD: atalk.c,v 1.16.8.1 2022/09/12 14:29:19 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -62,9 +62,6 @@ __RCSID("$NetBSD: atalk.c,v 1.16 2015/06
 #include 
 #include "netstat.h"
 
-struct ddpcbddpcb;
-struct socket   sockb;
-
 static int first = 1;
 
 /*
@@ -84,11 +81,12 @@ at_pr_net(const struct sockaddr_at *sat,
 		case 0x:
 			return "";
 		case ATADDR_ANYNET:
-			return ("*");
+			return "*";
 		}
 	}
-	(void)snprintf(mybuf, sizeof(mybuf), "%hu", ntohs(sat->sat_addr.s_net));
-	return (mybuf);
+	(void)snprintf(mybuf, sizeof(mybuf), "%hu",
+	ntohs(sat->sat_addr.s_net));
+	return mybuf;
 }
 
 static const char *
@@ -101,12 +99,12 @@ at_pr_host(const struct sockaddr_at *sat
 		case ATADDR_BCAST:
 			return "bcast";
 		case ATADDR_ANYNODE:
-			return ("*");
+			return "*";
 		}
 	}
-	(void)snprintf(mybuf, sizeof(mybuf), "%d", 
+	(void)snprintf(mybuf, sizeof(mybuf), "%d",
 	(unsigned int)sat->sat_addr.s_node);
-	return (mybuf);
+	return mybuf;
 }
 
 static const char *
@@ -116,13 +114,13 @@ at_pr_port(const struct sockaddr_at *sat
 
 	switch (sat->sat_port) {
 	case ATADDR_ANYPORT:
-		return ("*");
+		return "*";
 	case 0xff:
 		return "";
 	default:
 		(void)snprintf(mybuf, sizeof(mybuf), "%d",
 		(unsigned int)sat->sat_port);
-		return (mybuf);
+		return mybuf;
 	}
 }
 
@@ -140,7 +138,7 @@ at_pr_range(const struct sockaddr_at *sa
 		(void)snprintf(mybuf, sizeof(mybuf), "%d",
 			

CVS commit: [netbsd-8] src/usr.bin/netstat

2022-09-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 12 14:29:20 UTC 2022

Modified Files:
src/usr.bin/netstat [netbsd-8]: atalk.c bpf.c fast_ipsec.c if.c inet.c
inet6.c main.c mbuf.c mroute.c mroute6.c netstat.1 netstat.h
pfkey.c pfsync.c route.c unix.c vtw.c

Log Message:
Pull up the following, requested by msaitoh in ticket #1762:

usr.bin/netstat/atalk.c 1.18,1.20-1.21
usr.bin/netstat/bpf.c   1.16 via patch
usr.bin/netstat/fast_ipsec.c1.24 via patch
usr.bin/netstat/if.c1.97-1.99,1.101-1.104 via patch
usr.bin/netstat/inet.c  1.111,1.115-1.116 via patch
usr.bin/netstat/inet6.c 1.70,1.74-1.75,1.80-1.81 via patch
usr.bin/netstat/main.c  1.100,1.102-1.103
usr.bin/netstat/mbuf.c  1.34-1.35
usr.bin/netstat/mroute.c1.26-1.27
usr.bin/netstat/mroute6.c   1.16
usr.bin/netstat/netstat.h   1.52-1.53
usr.bin/netstat/pfkey.c 1.4-1.5 via patch
usr.bin/netstat/pfsync.c1.4-1.5 via patch
usr.bin/netstat/route.c 1.87-1.88
usr.bin/netstat/unix.c  1.36-1.37
usr.bin/netstat/vtw.c   1.11,1.13

- Add names of a few more ICMPv6 messages.
  Also make the array be explicitly 256 entries long.
- sprintf() -> snprintf(), and adjust a buffer size to avoid any
  potential for overflow.
- Add missing {IP,IP6}_STAT_NOIPSEC to netstat.
- Don't show any of the completely and utterly undocumented VTW info
  if the feature isn't enabled.
- Print oqdrops correctly.
- netstat.1: Add various xrefs present in the body to "See Also".
- Limit maximum owner name to appease gcc.
- KNF. Style fixes.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.16.8.1 src/usr.bin/netstat/atalk.c
cvs rdiff -u -r1.11 -r1.11.22.1 src/usr.bin/netstat/bpf.c
cvs rdiff -u -r1.21.4.1 -r1.21.4.2 src/usr.bin/netstat/fast_ipsec.c
cvs rdiff -u -r1.94.4.1 -r1.94.4.2 src/usr.bin/netstat/if.c
cvs rdiff -u -r1.107 -r1.107.6.1 src/usr.bin/netstat/inet.c
cvs rdiff -u -r1.69 -r1.69.6.1 src/usr.bin/netstat/inet6.c
cvs rdiff -u -r1.99 -r1.99.8.1 src/usr.bin/netstat/main.c
cvs rdiff -u -r1.33 -r1.33.8.1 src/usr.bin/netstat/mbuf.c
cvs rdiff -u -r1.25 -r1.25.8.1 src/usr.bin/netstat/mroute.c
cvs rdiff -u -r1.15 -r1.15.8.1 src/usr.bin/netstat/mroute6.c
cvs rdiff -u -r1.73 -r1.73.8.1 src/usr.bin/netstat/netstat.1
cvs rdiff -u -r1.51 -r1.51.8.1 src/usr.bin/netstat/netstat.h
cvs rdiff -u -r1.1 -r1.1.34.1 src/usr.bin/netstat/pfkey.c
cvs rdiff -u -r1.1 -r1.1.38.1 src/usr.bin/netstat/pfsync.c
cvs rdiff -u -r1.85 -r1.85.8.1 src/usr.bin/netstat/route.c
cvs rdiff -u -r1.35 -r1.35.6.1 src/usr.bin/netstat/unix.c
cvs rdiff -u -r1.9 -r1.9.8.1 src/usr.bin/netstat/vtw.c

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



CVS commit: [netbsd-9] src/usr.bin/netstat

2022-09-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 12 14:23:41 UTC 2022

Modified Files:
src/usr.bin/netstat [netbsd-9]: atalk.c bpf.c fast_ipsec.c if.c inet.c
inet6.c main.c mbuf.c mroute.c mroute6.c netstat.1 netstat.h
pfkey.c pfsync.c route.c unix.c vtw.c

Log Message:
Pull up the following, requested by msaitoh in ticket #1522:

usr.bin/netstat/atalk.c 1.18,1.20-1.21
usr.bin/netstat/bpf.c   1.16 via patch
usr.bin/netstat/fast_ipsec.c1.24
usr.bin/netstat/if.c1.97-1.99,1.101-1.104 via patch
usr.bin/netstat/inet.c  1.111,1.115-1.116 via patch
usr.bin/netstat/inet6.c 1.74-1.75,1.80-1.81 via patch
usr.bin/netstat/main.c  1.100-1.103
usr.bin/netstat/mbuf.c  1.35
usr.bin/netstat/mroute.c1.26-1.27
usr.bin/netstat/mroute6.c   1.16
usr.bin/netstat/netstat.h   1.52-1.53
usr.bin/netstat/pfkey.c 1.4-1.5 via patch
usr.bin/netstat/pfsync.c1.4-1.5 via patch
usr.bin/netstat/route.c 1.86-1.88
usr.bin/netstat/unix.c  1.36-1.37
usr.bin/netstat/vtw.c   1.11,1.13

- sprintf() -> snprintf(), and adjust a buffer size to avoid any
  potential for overflow.
- Fix netstat -rs to print it correctly.
- Add missing {IP,IP6}_STAT_NOIPSEC to netstat.
- Don't show any of the completely and utterly undocumented VTW info
  if the feature isn't enabled.
- Print oqdrops correctly.
- Remove Network ATM soft intr queue reporting, we don't have that
  in the kernel anymore.
- netstat.1: Add various xrefs present in the body to "See Also".
- KNF. Style fixes.


To generate a diff of this commit:
cvs rdiff -u -r1.16.18.1 -r1.16.18.2 src/usr.bin/netstat/atalk.c
cvs rdiff -u -r1.13.4.1 -r1.13.4.2 src/usr.bin/netstat/bpf.c
cvs rdiff -u -r1.22.8.1 -r1.22.8.2 src/usr.bin/netstat/fast_ipsec.c
cvs rdiff -u -r1.95 -r1.95.2.1 src/usr.bin/netstat/if.c
cvs rdiff -u -r1.109.2.1 -r1.109.2.2 src/usr.bin/netstat/inet.c
cvs rdiff -u -r1.72.2.1 -r1.72.2.2 src/usr.bin/netstat/inet6.c
cvs rdiff -u -r1.99 -r1.99.18.1 src/usr.bin/netstat/main.c
cvs rdiff -u -r1.34 -r1.34.2.1 src/usr.bin/netstat/mbuf.c
cvs rdiff -u -r1.25 -r1.25.18.1 src/usr.bin/netstat/mroute.c
cvs rdiff -u -r1.15 -r1.15.18.1 src/usr.bin/netstat/mroute6.c
cvs rdiff -u -r1.73 -r1.73.18.1 src/usr.bin/netstat/netstat.1
cvs rdiff -u -r1.51 -r1.51.18.1 src/usr.bin/netstat/netstat.h
cvs rdiff -u -r1.1.44.1 -r1.1.44.2 src/usr.bin/netstat/pfkey.c
cvs rdiff -u -r1.1.48.1 -r1.1.48.2 src/usr.bin/netstat/pfsync.c
cvs rdiff -u -r1.85 -r1.85.18.1 src/usr.bin/netstat/route.c
cvs rdiff -u -r1.35 -r1.35.16.1 src/usr.bin/netstat/unix.c
cvs rdiff -u -r1.10 -r1.10.4.1 src/usr.bin/netstat/vtw.c

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



CVS commit: [netbsd-9] src/usr.bin/netstat

2022-09-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 12 14:23:41 UTC 2022

Modified Files:
src/usr.bin/netstat [netbsd-9]: atalk.c bpf.c fast_ipsec.c if.c inet.c
inet6.c main.c mbuf.c mroute.c mroute6.c netstat.1 netstat.h
pfkey.c pfsync.c route.c unix.c vtw.c

Log Message:
Pull up the following, requested by msaitoh in ticket #1522:

usr.bin/netstat/atalk.c 1.18,1.20-1.21
usr.bin/netstat/bpf.c   1.16 via patch
usr.bin/netstat/fast_ipsec.c1.24
usr.bin/netstat/if.c1.97-1.99,1.101-1.104 via patch
usr.bin/netstat/inet.c  1.111,1.115-1.116 via patch
usr.bin/netstat/inet6.c 1.74-1.75,1.80-1.81 via patch
usr.bin/netstat/main.c  1.100-1.103
usr.bin/netstat/mbuf.c  1.35
usr.bin/netstat/mroute.c1.26-1.27
usr.bin/netstat/mroute6.c   1.16
usr.bin/netstat/netstat.h   1.52-1.53
usr.bin/netstat/pfkey.c 1.4-1.5 via patch
usr.bin/netstat/pfsync.c1.4-1.5 via patch
usr.bin/netstat/route.c 1.86-1.88
usr.bin/netstat/unix.c  1.36-1.37
usr.bin/netstat/vtw.c   1.11,1.13

- sprintf() -> snprintf(), and adjust a buffer size to avoid any
  potential for overflow.
- Fix netstat -rs to print it correctly.
- Add missing {IP,IP6}_STAT_NOIPSEC to netstat.
- Don't show any of the completely and utterly undocumented VTW info
  if the feature isn't enabled.
- Print oqdrops correctly.
- Remove Network ATM soft intr queue reporting, we don't have that
  in the kernel anymore.
- netstat.1: Add various xrefs present in the body to "See Also".
- KNF. Style fixes.


To generate a diff of this commit:
cvs rdiff -u -r1.16.18.1 -r1.16.18.2 src/usr.bin/netstat/atalk.c
cvs rdiff -u -r1.13.4.1 -r1.13.4.2 src/usr.bin/netstat/bpf.c
cvs rdiff -u -r1.22.8.1 -r1.22.8.2 src/usr.bin/netstat/fast_ipsec.c
cvs rdiff -u -r1.95 -r1.95.2.1 src/usr.bin/netstat/if.c
cvs rdiff -u -r1.109.2.1 -r1.109.2.2 src/usr.bin/netstat/inet.c
cvs rdiff -u -r1.72.2.1 -r1.72.2.2 src/usr.bin/netstat/inet6.c
cvs rdiff -u -r1.99 -r1.99.18.1 src/usr.bin/netstat/main.c
cvs rdiff -u -r1.34 -r1.34.2.1 src/usr.bin/netstat/mbuf.c
cvs rdiff -u -r1.25 -r1.25.18.1 src/usr.bin/netstat/mroute.c
cvs rdiff -u -r1.15 -r1.15.18.1 src/usr.bin/netstat/mroute6.c
cvs rdiff -u -r1.73 -r1.73.18.1 src/usr.bin/netstat/netstat.1
cvs rdiff -u -r1.51 -r1.51.18.1 src/usr.bin/netstat/netstat.h
cvs rdiff -u -r1.1.44.1 -r1.1.44.2 src/usr.bin/netstat/pfkey.c
cvs rdiff -u -r1.1.48.1 -r1.1.48.2 src/usr.bin/netstat/pfsync.c
cvs rdiff -u -r1.85 -r1.85.18.1 src/usr.bin/netstat/route.c
cvs rdiff -u -r1.35 -r1.35.16.1 src/usr.bin/netstat/unix.c
cvs rdiff -u -r1.10 -r1.10.4.1 src/usr.bin/netstat/vtw.c

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

Modified files:

Index: src/usr.bin/netstat/atalk.c
diff -u src/usr.bin/netstat/atalk.c:1.16.18.1 src/usr.bin/netstat/atalk.c:1.16.18.2
--- src/usr.bin/netstat/atalk.c:1.16.18.1	Mon Aug 19 15:56:49 2019
+++ src/usr.bin/netstat/atalk.c	Mon Sep 12 14:23:41 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: atalk.c,v 1.16.18.1 2019/08/19 15:56:49 martin Exp $	*/
+/*	$NetBSD: atalk.c,v 1.16.18.2 2022/09/12 14:23:41 martin Exp $	*/
 
 /*
  * Copyright (c) 1983, 1988, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "from @(#)atalk.c	1.1 (Whistle) 6/6/96";
 #else
-__RCSID("$NetBSD: atalk.c,v 1.16.18.1 2019/08/19 15:56:49 martin Exp $");
+__RCSID("$NetBSD: atalk.c,v 1.16.18.2 2022/09/12 14:23:41 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -63,9 +63,6 @@ __RCSID("$NetBSD: atalk.c,v 1.16.18.1 20
 #include "netstat.h"
 #include "prog_ops.h"
 
-struct ddpcbddpcb;
-struct socket   sockb;
-
 static int first = 1;
 
 /*
@@ -85,11 +82,12 @@ at_pr_net(const struct sockaddr_at *sat,
 		case 0x:
 			return "";
 		case ATADDR_ANYNET:
-			return ("*");
+			return "*";
 		}
 	}
-	(void)snprintf(mybuf, sizeof(mybuf), "%hu", ntohs(sat->sat_addr.s_net));
-	return (mybuf);
+	(void)snprintf(mybuf, sizeof(mybuf), "%hu",
+	ntohs(sat->sat_addr.s_net));
+	return mybuf;
 }
 
 static const char *
@@ -102,12 +100,12 @@ at_pr_host(const struct sockaddr_at *sat
 		case ATADDR_BCAST:
 			return "bcast";
 		case ATADDR_ANYNODE:
-			return ("*");
+			return "*";
 		}
 	}
-	(void)snprintf(mybuf, sizeof(mybuf), "%d", 
+	(void)snprintf(mybuf, sizeof(mybuf), "%d",
 	(unsigned int)sat->sat_addr.s_node);
-	return (mybuf);
+	return mybuf;
 }
 
 static const char *
@@ -117,13 +115,13 @@ at_pr_port(const struct sockaddr_at *sat
 
 	switch (sat->sat_port) {
 	case ATADDR_ANYPORT:
-		return ("*");
+		return "*";
 	case 0xff:
 		return "";
 	default:
 		(void)snprintf(mybuf, sizeof(mybuf), "%d",
 		(unsigned int)sat->sat_port);
-		return (mybuf);
+		return mybuf;
 	}
 }
 
@@ -141,7 +139,7 @@ at_pr_range(const struct sockaddr_at *sa
 		

Re: CVS commit: src/sys/fs/union

2022-09-12 Thread Rin Okuyama

Thanks for quick fix!

rin

On 2022/09/12 22:10, Christos Zoulas wrote:

Yup!

christos


On Sep 12, 2022, at 5:04 AM, Rin Okuyama  wrote:

Hi,

On 2022/09/12 0:42, Christos Zoulas wrote:

@@ -420,11 +423,11 @@ union_statvfs(struct mount *mp, struct s
  {
int error;
struct union_mount *um = MOUNTTOUNIONMOUNT(mp);
-   struct statvfs *sbuf = malloc(sizeof(*sbuf), M_TEMP, M_WAITOK | M_ZERO);
+   struct statvfs *sbuf = kmem_alloc(sizeof(*sbuf), KM_SLEEP);
unsigned long lbsize;
#ifdef UNION_DIAGNOSTIC
-   printf("union_statvfs(mp = %p, lvp = %p, uvp = %p)\n", mp,
+   printf("%s(mp = %p, lvp = %p, uvp = %p)\n", __func__, mp,
um->um_lowervp, um->um_uppervp);
  #endif



kmem_zalloc() here?

Thanks,
rin




CVS commit: src/sys/fs

2022-09-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep 12 13:11:41 UTC 2022

Modified Files:
src/sys/fs/union: union_vfsops.c
src/sys/fs/unionfs: unionfs_vfsops.c

Log Message:
kmem_alloc -> kmem_zalloc, thanks Rin.


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.83 src/sys/fs/union/union_vfsops.c
cvs rdiff -u -r1.15 -r1.16 src/sys/fs/unionfs/unionfs_vfsops.c

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

Modified files:

Index: src/sys/fs/union/union_vfsops.c
diff -u src/sys/fs/union/union_vfsops.c:1.82 src/sys/fs/union/union_vfsops.c:1.83
--- src/sys/fs/union/union_vfsops.c:1.82	Sun Sep 11 11:42:29 2022
+++ src/sys/fs/union/union_vfsops.c	Mon Sep 12 09:11:41 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: union_vfsops.c,v 1.82 2022/09/11 15:42:29 christos Exp $	*/
+/*	$NetBSD: union_vfsops.c,v 1.83 2022/09/12 13:11:41 christos Exp $	*/
 
 /*
  * Copyright (c) 1994 The Regents of the University of California.
@@ -77,7 +77,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: union_vfsops.c,v 1.82 2022/09/11 15:42:29 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: union_vfsops.c,v 1.83 2022/09/12 13:11:41 christos Exp $");
 
 #include 
 #include 
@@ -423,7 +423,7 @@ union_statvfs(struct mount *mp, struct s
 {
 	int error;
 	struct union_mount *um = MOUNTTOUNIONMOUNT(mp);
-	struct statvfs *sbuf = kmem_alloc(sizeof(*sbuf), KM_SLEEP);
+	struct statvfs *sbuf = kmem_zalloc(sizeof(*sbuf), KM_SLEEP);
 	unsigned long lbsize;
 
 #ifdef UNION_DIAGNOSTIC

Index: src/sys/fs/unionfs/unionfs_vfsops.c
diff -u src/sys/fs/unionfs/unionfs_vfsops.c:1.15 src/sys/fs/unionfs/unionfs_vfsops.c:1.16
--- src/sys/fs/unionfs/unionfs_vfsops.c:1.15	Sun Sep 11 12:42:07 2022
+++ src/sys/fs/unionfs/unionfs_vfsops.c	Mon Sep 12 09:11:41 2022
@@ -392,7 +392,7 @@ unionfs_statvfs(struct mount *mp, struct
 	struct unionfs_mount *ump;
 	int		error;
 	uint64_t	lbsize;
-	struct statvfs *sbuf = kmem_alloc(sizeof(*sbuf), KM_SLEEP);
+	struct statvfs *sbuf = kmem_zalloc(sizeof(*sbuf), KM_SLEEP);
 
 	ump = MOUNTTOUNIONFSMOUNT(mp);
 



CVS commit: src/sys/fs

2022-09-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep 12 13:11:41 UTC 2022

Modified Files:
src/sys/fs/union: union_vfsops.c
src/sys/fs/unionfs: unionfs_vfsops.c

Log Message:
kmem_alloc -> kmem_zalloc, thanks Rin.


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.83 src/sys/fs/union/union_vfsops.c
cvs rdiff -u -r1.15 -r1.16 src/sys/fs/unionfs/unionfs_vfsops.c

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



Re: CVS commit: src/sys/fs/union

2022-09-12 Thread Christos Zoulas
Yup!

christos

> On Sep 12, 2022, at 5:04 AM, Rin Okuyama  wrote:
> 
> Hi,
> 
> On 2022/09/12 0:42, Christos Zoulas wrote:
>> @@ -420,11 +423,11 @@ union_statvfs(struct mount *mp, struct s
>>  {
>>  int error;
>>  struct union_mount *um = MOUNTTOUNIONMOUNT(mp);
>> -struct statvfs *sbuf = malloc(sizeof(*sbuf), M_TEMP, M_WAITOK | M_ZERO);
>> +struct statvfs *sbuf = kmem_alloc(sizeof(*sbuf), KM_SLEEP);
>>  unsigned long lbsize;
>>#ifdef UNION_DIAGNOSTIC
>> -printf("union_statvfs(mp = %p, lvp = %p, uvp = %p)\n", mp,
>> +printf("%s(mp = %p, lvp = %p, uvp = %p)\n", __func__, mp,
>>  um->um_lowervp, um->um_uppervp);
>>  #endif
>> 
> 
> kmem_zalloc() here?
> 
> Thanks,
> rin



signature.asc
Description: Message signed with OpenPGP


CVS commit: src/libexec/httpd

2022-09-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 12 10:34:20 UTC 2022

Modified Files:
src/libexec/httpd: bozohttpd.8

Log Message:
Document the -q option.


To generate a diff of this commit:
cvs rdiff -u -r1.91 -r1.92 src/libexec/httpd/bozohttpd.8

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

Modified files:

Index: src/libexec/httpd/bozohttpd.8
diff -u src/libexec/httpd/bozohttpd.8:1.91 src/libexec/httpd/bozohttpd.8:1.92
--- src/libexec/httpd/bozohttpd.8:1.91	Wed May 18 00:37:11 2022
+++ src/libexec/httpd/bozohttpd.8	Mon Sep 12 10:34:20 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: bozohttpd.8,v 1.91 2022/05/18 00:37:11 mrg Exp $
+.\"	$NetBSD: bozohttpd.8,v 1.92 2022/09/12 10:34:20 martin Exp $
 .\"
 .\"	$eterna: bozohttpd.8,v 1.101 2011/11/18 01:25:11 mrg Exp $
 .\"
@@ -26,7 +26,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd May 24, 17
+.Dd Sep 12, 22
 .Dt BOZOHTTPD 8
 .Os
 .Sh NAME
@@ -34,7 +34,7 @@
 .Nd hyper text transfer protocol version 1.1 daemon
 .Sh SYNOPSIS
 .Nm
-.Op Fl EGHVXdefhnsu
+.Op Fl EGHVXdefhnqsu
 .Op Fl C Ar suffix cgihandler
 .Op Fl I Ar port
 .Op Fl L Ar prefix script
@@ -77,7 +77,9 @@ writes logs to
 .Xr syslog 3
 using the ftp facility (but see the
 .Fl s
-option for testing.)
+option for testing and the
+.Fl q
+option for supressing this.)
 .Nm
 is designed to be small, simple and relatively featureless,
 hopefully increasing its security.
@@ -256,6 +258,8 @@ translations from
 .Dq public_html
 to
 .Ar pubdir .
+.It Fl q
+Quiet mode - no log entries generated.
 .It Fl R Ar readme
 When directory indexing is enabled, include the contents of the file
 .Ar readme



CVS commit: src/libexec/httpd

2022-09-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 12 10:34:20 UTC 2022

Modified Files:
src/libexec/httpd: bozohttpd.8

Log Message:
Document the -q option.


To generate a diff of this commit:
cvs rdiff -u -r1.91 -r1.92 src/libexec/httpd/bozohttpd.8

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



CVS commit: src/libexec/httpd

2022-09-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 12 10:30:39 UTC 2022

Modified Files:
src/libexec/httpd: bozohttpd.c bozohttpd.h main.c ssl-bozo.c

Log Message:
Add a -q option to make http quiet (no log messages).

Usefull when running multiple instances and some for (high traffic)
APIs e.g. to receive log data from appliences - it makes not sense
to duplicate the whole log in the xferlog file (but we can't configure
that at the syslog level due to other httpd instances using that).


To generate a diff of this commit:
cvs rdiff -u -r1.141 -r1.142 src/libexec/httpd/bozohttpd.c
cvs rdiff -u -r1.72 -r1.73 src/libexec/httpd/bozohttpd.h
cvs rdiff -u -r1.29 -r1.30 src/libexec/httpd/main.c
cvs rdiff -u -r1.31 -r1.32 src/libexec/httpd/ssl-bozo.c

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

Modified files:

Index: src/libexec/httpd/bozohttpd.c
diff -u src/libexec/httpd/bozohttpd.c:1.141 src/libexec/httpd/bozohttpd.c:1.142
--- src/libexec/httpd/bozohttpd.c:1.141	Wed May 18 00:37:11 2022
+++ src/libexec/httpd/bozohttpd.c	Mon Sep 12 10:30:39 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: bozohttpd.c,v 1.141 2022/05/18 00:37:11 mrg Exp $	*/
+/*	$NetBSD: bozohttpd.c,v 1.142 2022/09/12 10:30:39 martin Exp $	*/
 
 /*	$eterna: bozohttpd.c,v 1.178 2011/11/18 09:21:15 mrg Exp $	*/
 
@@ -2022,11 +2022,13 @@ debug__(bozohttpd_t *httpd, int level, c
 
 	savederrno = errno;
 	va_start(ap, fmt);
-	if (httpd->logstderr) {
-		vfprintf(stderr, fmt, ap);
-		fputs("\n", stderr);
-	} else
-		vsyslog(LOG_DEBUG, fmt, ap);
+	if (!httpd->nolog) {
+		if (httpd->logstderr) {
+			vfprintf(stderr, fmt, ap);
+			fputs("\n", stderr);
+		} else
+			vsyslog(LOG_DEBUG, fmt, ap);
+	}
 	va_end(ap);
 	errno = savederrno;
 }
@@ -2039,12 +2041,14 @@ bozowarn(bozohttpd_t *httpd, const char 
 	va_list ap;
 
 	va_start(ap, fmt);
-	if (httpd->logstderr || isatty(STDERR_FILENO)) {
-		//fputs("warning: ", stderr);
-		vfprintf(stderr, fmt, ap);
-		fputs("\n", stderr);
-	} else
-		vsyslog(LOG_INFO, fmt, ap);
+	if (!httpd->nolog) {
+		if (httpd->logstderr || isatty(STDERR_FILENO)) {
+			//fputs("warning: ", stderr);
+			vfprintf(stderr, fmt, ap);
+			fputs("\n", stderr);
+		} else
+			vsyslog(LOG_INFO, fmt, ap);
+	}
 	va_end(ap);
 }
 
@@ -2054,12 +2058,14 @@ bozoerr(bozohttpd_t *httpd, int code, co
 	va_list ap;
 
 	va_start(ap, fmt);
-	if (httpd->logstderr || isatty(STDERR_FILENO)) {
-		//fputs("error: ", stderr);
-		vfprintf(stderr, fmt, ap);
-		fputs("\n", stderr);
-	} else
-		vsyslog(LOG_ERR, fmt, ap);
+	if (!httpd->nolog) {
+		if (httpd->logstderr || isatty(STDERR_FILENO)) {
+			//fputs("error: ", stderr);
+			vfprintf(stderr, fmt, ap);
+			fputs("\n", stderr);
+		} else
+			vsyslog(LOG_ERR, fmt, ap);
+	}
 	va_end(ap);
 	exit(code);
 }
@@ -2591,6 +2597,10 @@ bozo_setup(bozohttpd_t *httpd, bozoprefs
 	strcmp(cp, "true") == 0) {
 		httpd->logstderr = 1;
 	}
+	if ((cp = bozo_get_pref(prefs, "no log")) != NULL &&
+	strcmp(cp, "true") == 0) {
+		httpd->nolog = 1;
+	}
 	if ((cp = bozo_get_pref(prefs, "bind address")) != NULL) {
 		httpd->bindaddress = bozostrdup(httpd, NULL, cp);
 	}

Index: src/libexec/httpd/bozohttpd.h
diff -u src/libexec/httpd/bozohttpd.h:1.72 src/libexec/httpd/bozohttpd.h:1.73
--- src/libexec/httpd/bozohttpd.h:1.72	Wed May 18 00:37:11 2022
+++ src/libexec/httpd/bozohttpd.h	Mon Sep 12 10:30:39 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: bozohttpd.h,v 1.72 2022/05/18 00:37:11 mrg Exp $	*/
+/*	$NetBSD: bozohttpd.h,v 1.73 2022/09/12 10:30:39 martin Exp $	*/
 
 /*	$eterna: bozohttpd.h,v 1.39 2011/11/18 09:21:15 mrg Exp $	*/
 
@@ -103,6 +103,7 @@ typedef struct bozohttpd_t {
 	char		*virtbase;	/* virtual directory base */
 	int		 unknown_slash;	/* unknown vhosts go to normal slashdir */
 	int		 logstderr;	/* log to stderr (even if not tty) */
+	int		 nolog;		/* do not log anything */
 	int		 background;	/* drop into daemon mode */
 	int		 foreground;	/* keep daemon mode in foreground */
 	char		*pidfile;	/* path to the pid file, if any */

Index: src/libexec/httpd/main.c
diff -u src/libexec/httpd/main.c:1.29 src/libexec/httpd/main.c:1.30
--- src/libexec/httpd/main.c:1.29	Tue Aug 24 09:47:36 2021
+++ src/libexec/httpd/main.c	Mon Sep 12 10:30:39 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.29 2021/08/24 09:47:36 mrg Exp $	*/
+/*	$NetBSD: main.c,v 1.30 2022/09/12 10:30:39 martin Exp $	*/
 
 /*	$eterna: main.c,v 1.6 2011/11/18 09:21:15 mrg Exp $	*/
 /* from: eterna: bozohttpd.c,v 1.159 2009/05/23 02:14:30 mrg Exp 	*/
@@ -102,6 +102,8 @@ usage(bozohttpd_t *httpd, char *progname
 		bozowarn(httpd, "   -P pidfile\t\tpid file path");
 	if (have_user)
 		bozowarn(httpd, "   -p dir\t\t\"public_html\" directory name");
+	if (have_core)
+		bozowarn(httpd, "   -q\t\tquiet mode, no logging");
 	if (have_dirindex)
 		bozowarn(httpd, "   -R readme\t\tput readme file in footer "
 "of directory index");
@@ -164,7 +166,7 @@ main(int argc, char **argv)
 	 */
 
 	while ((c = 

CVS commit: src/libexec/httpd

2022-09-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 12 10:30:39 UTC 2022

Modified Files:
src/libexec/httpd: bozohttpd.c bozohttpd.h main.c ssl-bozo.c

Log Message:
Add a -q option to make http quiet (no log messages).

Usefull when running multiple instances and some for (high traffic)
APIs e.g. to receive log data from appliences - it makes not sense
to duplicate the whole log in the xferlog file (but we can't configure
that at the syslog level due to other httpd instances using that).


To generate a diff of this commit:
cvs rdiff -u -r1.141 -r1.142 src/libexec/httpd/bozohttpd.c
cvs rdiff -u -r1.72 -r1.73 src/libexec/httpd/bozohttpd.h
cvs rdiff -u -r1.29 -r1.30 src/libexec/httpd/main.c
cvs rdiff -u -r1.31 -r1.32 src/libexec/httpd/ssl-bozo.c

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



Re: CVS commit: src/sys/fs/union

2022-09-12 Thread Rin Okuyama

Hi,

On 2022/09/12 0:42, Christos Zoulas wrote:

@@ -420,11 +423,11 @@ union_statvfs(struct mount *mp, struct s
  {
int error;
struct union_mount *um = MOUNTTOUNIONMOUNT(mp);
-   struct statvfs *sbuf = malloc(sizeof(*sbuf), M_TEMP, M_WAITOK | M_ZERO);
+   struct statvfs *sbuf = kmem_alloc(sizeof(*sbuf), KM_SLEEP);
unsigned long lbsize;
  
  #ifdef UNION_DIAGNOSTIC

-   printf("union_statvfs(mp = %p, lvp = %p, uvp = %p)\n", mp,
+   printf("%s(mp = %p, lvp = %p, uvp = %p)\n", __func__, mp,
um->um_lowervp, um->um_uppervp);
  #endif
  


kmem_zalloc() here?

Thanks,
rin


CVS commit: src/sys/arch/powerpc/include/booke

2022-09-12 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Sep 12 08:14:55 UTC 2022

Modified Files:
src/sys/arch/powerpc/include/booke: intr.h

Log Message:
PR port-powerpc/56922

__HAVE_FAST_SOFTINTS is broken for powerpc.
Disable it temporarily also for booke.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/powerpc/include/booke/intr.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/powerpc/include/booke/intr.h
diff -u src/sys/arch/powerpc/include/booke/intr.h:1.12 src/sys/arch/powerpc/include/booke/intr.h:1.13
--- src/sys/arch/powerpc/include/booke/intr.h:1.12	Sat Nov 23 19:40:36 2019
+++ src/sys/arch/powerpc/include/booke/intr.h	Mon Sep 12 08:14:55 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.h,v 1.12 2019/11/23 19:40:36 ad Exp $	*/
+/*	$NetBSD: intr.h,v 1.13 2022/09/12 08:14:55 rin Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -77,7 +77,9 @@
 #define IPI_SUSPEND	0x0020
 #define IPI_AST		0x0040
 
+#if 0	/* PR port-powerpc/56922: fast softints are broken on powerpc */
 #define	__HAVE_FAST_SOFTINTS	1
+#endif
 #define	SOFTINT_KPREEMPT	SOFTINT_COUNT
 
 #ifndef _LOCORE



CVS commit: src/sys/arch/powerpc/include/booke

2022-09-12 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Sep 12 08:14:55 UTC 2022

Modified Files:
src/sys/arch/powerpc/include/booke: intr.h

Log Message:
PR port-powerpc/56922

__HAVE_FAST_SOFTINTS is broken for powerpc.
Disable it temporarily also for booke.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/powerpc/include/booke/intr.h

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



CVS commit: src/doc

2022-09-12 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Sep 12 08:11:51 UTC 2022

Modified Files:
src/doc: HACKS

Log Message:
Document -O0 hack for ibm4xx copy{in,out}() for clang 13.0.0.


To generate a diff of this commit:
cvs rdiff -u -r1.230 -r1.231 src/doc/HACKS

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

Modified files:

Index: src/doc/HACKS
diff -u src/doc/HACKS:1.230 src/doc/HACKS:1.231
--- src/doc/HACKS:1.230	Wed Aug 10 13:38:26 2022
+++ src/doc/HACKS	Mon Sep 12 08:11:51 2022
@@ -1,4 +1,4 @@
-# $NetBSD: HACKS,v 1.230 2022/08/10 13:38:26 rin Exp $
+# $NetBSD: HACKS,v 1.231 2022/09/12 08:11:51 rin Exp $
 #
 # This file is intended to document workarounds for currently unsolved
 # (mostly) compiler bugs.
@@ -1054,3 +1054,13 @@ descr
 
 	https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105209
 kcah
+
+hack	compile copy{in,out}() for ibm4xx with -O0 for clang
+cdate	Mon Sep 12 08:06:36 UTC 2022
+who	rin
+port	evbppc
+file	sys/arch/powerpc/ibm4xx/trap.c: 1.99
+descr
+	clang 13.0.0 miscompiles copy{in,out}() with -O[12]. As a result,
+	kernel cannot execute /sbin/init.
+kcah



CVS commit: src/doc

2022-09-12 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Sep 12 08:11:51 UTC 2022

Modified Files:
src/doc: HACKS

Log Message:
Document -O0 hack for ibm4xx copy{in,out}() for clang 13.0.0.


To generate a diff of this commit:
cvs rdiff -u -r1.230 -r1.231 src/doc/HACKS

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



CVS commit: src/sys/arch/powerpc/ibm4xx

2022-09-12 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Sep 12 08:06:36 UTC 2022

Modified Files:
src/sys/arch/powerpc/ibm4xx: trap.c

Log Message:
Work around clang 13.0.0 bug; copy{in,out}() are miscompiled with -O[12],
by which /sbin/init cannot be executed.


To generate a diff of this commit:
cvs rdiff -u -r1.98 -r1.99 src/sys/arch/powerpc/ibm4xx/trap.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/powerpc/ibm4xx

2022-09-12 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Sep 12 08:06:36 UTC 2022

Modified Files:
src/sys/arch/powerpc/ibm4xx: trap.c

Log Message:
Work around clang 13.0.0 bug; copy{in,out}() are miscompiled with -O[12],
by which /sbin/init cannot be executed.


To generate a diff of this commit:
cvs rdiff -u -r1.98 -r1.99 src/sys/arch/powerpc/ibm4xx/trap.c

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

Modified files:

Index: src/sys/arch/powerpc/ibm4xx/trap.c
diff -u src/sys/arch/powerpc/ibm4xx/trap.c:1.98 src/sys/arch/powerpc/ibm4xx/trap.c:1.99
--- src/sys/arch/powerpc/ibm4xx/trap.c:1.98	Mon Sep 12 08:02:44 2022
+++ src/sys/arch/powerpc/ibm4xx/trap.c	Mon Sep 12 08:06:36 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.98 2022/09/12 08:02:44 rin Exp $	*/
+/*	$NetBSD: trap.c,v 1.99 2022/09/12 08:06:36 rin Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -69,7 +69,7 @@
 #define	__UFETCHSTORE_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.98 2022/09/12 08:02:44 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.99 2022/09/12 08:06:36 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -427,6 +427,9 @@ extern void vunmaprange(vaddr_t, vsize_t
 static int bigcopyin(const void *, void *, size_t );
 static int bigcopyout(const void *, void *, size_t );
 
+#ifdef __clang__
+#pragma clang optimize off
+#endif
 int
 copyin(const void *uaddr, void *kaddr, size_t len)
 {
@@ -509,6 +512,9 @@ copyin(const void *uaddr, void *kaddr, s
 	curpcb->pcb_onfault = NULL;
 	return 0;
 }
+#ifdef __clang__
+#pragma clang optimize on
+#endif
 
 static int
 bigcopyin(const void *uaddr, void *kaddr, size_t len)
@@ -542,6 +548,9 @@ bigcopyin(const void *uaddr, void *kaddr
 	return error;
 }
 
+#ifdef __clang__
+#pragma clang optimize off
+#endif
 int
 copyout(const void *kaddr, void *uaddr, size_t len)
 {
@@ -625,6 +634,9 @@ copyout(const void *kaddr, void *uaddr, 
 	curpcb->pcb_onfault = NULL;
 	return 0;
 }
+#ifdef __clang__
+#pragma clang optimize on
+#endif
 
 static int
 bigcopyout(const void *kaddr, void *uaddr, size_t len)



CVS commit: src/sys/arch/powerpc

2022-09-12 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Sep 12 08:02:44 UTC 2022

Modified Files:
src/sys/arch/powerpc/ibm4xx: 4xx_trap_subr.S copyinstr.c copyoutstr.c
pmap.c trap.c trap_subr.S
src/sys/arch/powerpc/include/ibm4xx: spr.h
src/sys/arch/powerpc/powerpc: db_interface.c

Log Message:
Make ibm4xx kernels compiled by clang.

As clang cannot correctly assemble m[ft]pid:
- for asm sources, use m[ft]spr from/to SPR_PID
- for C sources, use M[FT]PID macros (see include/ibm4xx/spr.h)
This is ugly...

No binary changes for GCC-compiled kernels.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/powerpc/ibm4xx/4xx_trap_subr.S
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/powerpc/ibm4xx/copyinstr.c \
src/sys/arch/powerpc/ibm4xx/copyoutstr.c
cvs rdiff -u -r1.105 -r1.106 src/sys/arch/powerpc/ibm4xx/pmap.c
cvs rdiff -u -r1.97 -r1.98 src/sys/arch/powerpc/ibm4xx/trap.c
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/powerpc/ibm4xx/trap_subr.S
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/powerpc/include/ibm4xx/spr.h
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/powerpc/powerpc/db_interface.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/powerpc

2022-09-12 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Sep 12 08:02:44 UTC 2022

Modified Files:
src/sys/arch/powerpc/ibm4xx: 4xx_trap_subr.S copyinstr.c copyoutstr.c
pmap.c trap.c trap_subr.S
src/sys/arch/powerpc/include/ibm4xx: spr.h
src/sys/arch/powerpc/powerpc: db_interface.c

Log Message:
Make ibm4xx kernels compiled by clang.

As clang cannot correctly assemble m[ft]pid:
- for asm sources, use m[ft]spr from/to SPR_PID
- for C sources, use M[FT]PID macros (see include/ibm4xx/spr.h)
This is ugly...

No binary changes for GCC-compiled kernels.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/powerpc/ibm4xx/4xx_trap_subr.S
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/powerpc/ibm4xx/copyinstr.c \
src/sys/arch/powerpc/ibm4xx/copyoutstr.c
cvs rdiff -u -r1.105 -r1.106 src/sys/arch/powerpc/ibm4xx/pmap.c
cvs rdiff -u -r1.97 -r1.98 src/sys/arch/powerpc/ibm4xx/trap.c
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/powerpc/ibm4xx/trap_subr.S
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/powerpc/include/ibm4xx/spr.h
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/powerpc/powerpc/db_interface.c

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

Modified files:

Index: src/sys/arch/powerpc/ibm4xx/4xx_trap_subr.S
diff -u src/sys/arch/powerpc/ibm4xx/4xx_trap_subr.S:1.9 src/sys/arch/powerpc/ibm4xx/4xx_trap_subr.S:1.10
--- src/sys/arch/powerpc/ibm4xx/4xx_trap_subr.S:1.9	Sun Jul 12 21:16:23 2020
+++ src/sys/arch/powerpc/ibm4xx/4xx_trap_subr.S	Mon Sep 12 08:02:44 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: 4xx_trap_subr.S,v 1.9 2020/07/12 21:16:23 rin Exp $	*/
+/*	$NetBSD: 4xx_trap_subr.S,v 1.10 2022/09/12 08:02:44 rin Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -95,12 +95,12 @@ s4xx_miss:
 	.globl	_C_LABEL(pmap_tlbmiss)
 
 	/* If the kernel stack would fault, don't use it. */
-	mfpid	%r30
+	mfspr	%r30,SPR_PID
 	li	%r31,KERNEL_PID
-	mtpid	%r31
+	mtspr	SPR_PID,%r31
 	li	%r31,-FRAMELEN
 	tlbsx.	%r31,%r31,%r1
-	mtpid	%r30
+	mtspr	SPR_PID,%r30
 	beq	1f
 
 	/*

Index: src/sys/arch/powerpc/ibm4xx/copyinstr.c
diff -u src/sys/arch/powerpc/ibm4xx/copyinstr.c:1.14 src/sys/arch/powerpc/ibm4xx/copyinstr.c:1.15
--- src/sys/arch/powerpc/ibm4xx/copyinstr.c:1.14	Fri Jun 19 07:31:59 2020
+++ src/sys/arch/powerpc/ibm4xx/copyinstr.c	Mon Sep 12 08:02:44 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: copyinstr.c,v 1.14 2020/06/19 07:31:59 rin Exp $	*/
+/*	$NetBSD: copyinstr.c,v 1.15 2022/09/12 08:02:44 rin Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -36,10 +36,11 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: copyinstr.c,v 1.14 2020/06/19 07:31:59 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: copyinstr.c,v 1.15 2022/09/12 08:02:44 rin Exp $");
 
 #include 
 #include 
+#include 
 #include 
 
 int
@@ -76,20 +77,23 @@ copyinstr(const void *udaddr, void *kadd
 		"li %1,0x20;"
 		"andc %1,%0,%1; mtmsr %1;"	/* Disable IMMU */
 		"isync;"
-		"mfpid %1;"			/* Save old PID */
+		MFPID(%1)			/* Save old PID */
 
 		"1: "
-		"mtpid %4; isync;"		/* Load user ctx */
+		MTPID(%4)			/* Load user ctx */
+		"isync;"
 		"lbz %2,0(%5); addi %5,%5,1;"	/* Load byte */
 		"sync;"
-		"mtpid %1; isync;"
+		MTPID(%1)
+		"isync;"
 		"stb %2,0(%6); dcbst 0,%6; addi %6,%6,1;"
 		/* Store kernel byte */
 		"or. %2,%2,%2;"
 		"sync;"
 		"bdnzf 2,1b;"			/* while(ctr-- && !zero) */
 
-		"mtpid %1; mtmsr %0;"		/* Restore PID, MSR */
+		MTPID(%1)			/* Restore PID, MSR */
+		"mtmsr %0;"
 		"isync;"
 		"mfctr %3;"			/* Restore resid */
 		: "=" (msr), "=" (pid), "=" (data), "+r" (resid)
Index: src/sys/arch/powerpc/ibm4xx/copyoutstr.c
diff -u src/sys/arch/powerpc/ibm4xx/copyoutstr.c:1.14 src/sys/arch/powerpc/ibm4xx/copyoutstr.c:1.15
--- src/sys/arch/powerpc/ibm4xx/copyoutstr.c:1.14	Fri Jun 19 07:31:59 2020
+++ src/sys/arch/powerpc/ibm4xx/copyoutstr.c	Mon Sep 12 08:02:44 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: copyoutstr.c,v 1.14 2020/06/19 07:31:59 rin Exp $	*/
+/*	$NetBSD: copyoutstr.c,v 1.15 2022/09/12 08:02:44 rin Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -36,10 +36,11 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: copyoutstr.c,v 1.14 2020/06/19 07:31:59 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: copyoutstr.c,v 1.15 2022/09/12 08:02:44 rin Exp $");
 
 #include 
 #include 
+#include 
 #include 
 
 int
@@ -76,20 +77,23 @@ copyoutstr(const void *kaddr, void *udad
 		"li %1,0x20;"
 		"andc %1,%0,%1; mtmsr %1;"	/* Disable IMMU */
 		"isync;"
-		"mfpid %1;"			/* Save old PID */
+		MFPID(%1)			/* Save old PID */
 
 		"1:"
-		"mtpid %1; isync;"
+		MTPID(%1)
+		"isync;"
 		"lbz %2,0(%6); addi %6,%6,1;"	/* Store kernel byte */
 		"sync;"
-		"mtpid %4; isync;"		/* Load user ctx */
+		MTPID(%4)			/* Load user ctx */
+		"isync;"
 		"stb %2,0(%5); dcbst 0,%5; addi %5,%5,1;"
 		/* Load byte */
 		"or. %2,%2,%2;"
 		"sync;"
 		"bdnzf 2,1b;"			/* while(ctr-- && !zero) */
 
-		"mtpid %1; mtmsr %0;"		/* Restore PID, MSR */
+		MTPID(%1)			/* Restore PID, MSR */
+		

CVS commit: src/sys/uvm/pmap

2022-09-12 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Sep 12 07:38:32 UTC 2022

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

Log Message:
A simplification and some minor whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/uvm/pmap/pmap.c

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



CVS commit: src/sys/uvm/pmap

2022-09-12 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Sep 12 07:38:32 UTC 2022

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

Log Message:
A simplification and some minor whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/uvm/pmap/pmap.c

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

Modified files:

Index: src/sys/uvm/pmap/pmap.c
diff -u src/sys/uvm/pmap/pmap.c:1.65 src/sys/uvm/pmap/pmap.c:1.66
--- src/sys/uvm/pmap/pmap.c:1.65	Sat May  7 06:53:16 2022
+++ src/sys/uvm/pmap/pmap.c	Mon Sep 12 07:38:32 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.65 2022/05/07 06:53:16 rin Exp $	*/
+/*	$NetBSD: pmap.c,v 1.66 2022/09/12 07:38:32 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.65 2022/05/07 06:53:16 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.66 2022/09/12 07:38:32 skrll Exp $");
 
 /*
  *	Manages physical address maps.
@@ -984,14 +984,14 @@ pmap_update(struct pmap *pmap)
 
 static bool
 pmap_pte_remove(pmap_t pmap, vaddr_t sva, vaddr_t eva, pt_entry_t *ptep,
-	uintptr_t flags)
+uintptr_t flags)
 {
 	const pt_entry_t npte = flags;
 	const bool is_kernel_pmap_p = (pmap == pmap_kernel());
 
 	UVMHIST_FUNC(__func__);
 	UVMHIST_CALLARGS(pmaphist, "(pmap=%#jx kernel=%jd va=%#jx..%#jx)",
-	(uintptr_t)pmap, (pmap == pmap_kernel() ? 1 : 0), sva, eva);
+	(uintptr_t)pmap, (is_kernel_pmap_p ? 1 : 0), sva, eva);
 	UVMHIST_LOG(pmaphist, "ptep=%#jx, flags(npte)=%#jx)",
 	(uintptr_t)ptep, flags, 0, 0);
 
@@ -1626,7 +1626,7 @@ pmap_unwire(pmap_t pmap, vaddr_t va)
 	pmap, va);
 	pt_entry_t pte = *ptep;
 	KASSERTMSG(pte_valid_p(pte),
-	"pmap %p va %#"PRIxVADDR" invalid PTE %#"PRIxPTE" @ %p",
+	"pmap %p va %#" PRIxVADDR " invalid PTE %#" PRIxPTE " @ %p",
 	pmap, va, pte_value(pte), ptep);
 
 	if (pte_wired_p(pte)) {



CVS commit: src/sys/dev/pci

2022-09-12 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Mon Sep 12 07:26:04 UTC 2022

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

Log Message:
Uniform vioif's link status to if_link_state.  Implemented by yamaguchi@n.o.

Let vioif(4) know LINK_STATE_UNKNOWN.


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/sys/dev/pci/if_vioif.c

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



CVS commit: src/sys/dev/pci

2022-09-12 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Mon Sep 12 07:26:04 UTC 2022

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

Log Message:
Uniform vioif's link status to if_link_state.  Implemented by yamaguchi@n.o.

Let vioif(4) know LINK_STATE_UNKNOWN.


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/sys/dev/pci/if_vioif.c

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

Modified files:

Index: src/sys/dev/pci/if_vioif.c
diff -u src/sys/dev/pci/if_vioif.c:1.81 src/sys/dev/pci/if_vioif.c:1.82
--- src/sys/dev/pci/if_vioif.c:1.81	Wed May  4 02:38:27 2022
+++ src/sys/dev/pci/if_vioif.c	Mon Sep 12 07:26:04 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vioif.c,v 1.81 2022/05/04 02:38:27 simonb Exp $	*/
+/*	$NetBSD: if_vioif.c,v 1.82 2022/09/12 07:26:04 knakahara Exp $	*/
 
 /*
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.81 2022/05/04 02:38:27 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.82 2022/09/12 07:26:04 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -319,7 +319,7 @@ struct vioif_softc {
 
 	uint8_t			sc_mac[ETHER_ADDR_LEN];
 	struct ethercom		sc_ethercom;
-	bool			sc_link_active;
+	int			sc_link_state;
 
 	struct vioif_txqueue	*sc_txq;
 	struct vioif_rxqueue	*sc_rxq;
@@ -349,6 +349,8 @@ struct vioif_softc {
 #define VIOIF_RX_PROCESS_LIMIT		256
 
 #define VIOIF_WORKQUEUE_PRI		PRI_SOFTNET
+#define VIOIF_IS_LINK_ACTIVE(_sc)	((_sc)->sc_link_state == LINK_STATE_UP ? \
+	true : false)
 
 /* cfattach interface functions */
 static int	vioif_match(device_t, cfdata_t, void *);
@@ -401,7 +403,7 @@ static void	vioif_work_add(struct workqu
 static void	vioif_work_wait(struct workqueue *, struct vioif_work *);
 
 /* other control */
-static bool	vioif_is_link_up(struct vioif_softc *);
+static int	vioif_get_link_status(struct vioif_softc *);
 static void	vioif_update_link_status(struct vioif_softc *);
 static int	vioif_ctrl_rx(struct vioif_softc *, int, bool);
 static int	vioif_set_promisc(struct vioif_softc *, bool);
@@ -830,7 +832,7 @@ vioif_attach(device_t parent, device_t s
 
 	sc->sc_dev = self;
 	sc->sc_virtio = vsc;
-	sc->sc_link_active = false;
+	sc->sc_link_state = LINK_STATE_UNKNOWN;
 
 	sc->sc_max_nvq_pairs = 1;
 	sc->sc_req_nvq_pairs = 1;
@@ -983,7 +985,7 @@ vioif_attach(device_t parent, device_t s
 		nvqs++;
 		txq->txq_vq->vq_intrhand = vioif_tx_intr;
 		txq->txq_vq->vq_intrhand_arg = (void *)txq;
-		txq->txq_link_active = sc->sc_link_active;
+		txq->txq_link_active = VIOIF_IS_LINK_ACTIVE(sc);
 		txq->txq_stopping = false;
 		txq->txq_intrq = pcq_create(txq->txq_vq->vq_num, KM_SLEEP);
 		vioif_work_set(>txq_work, vioif_tx_handle, txq);
@@ -1257,14 +1259,11 @@ vioif_stop(struct ifnet *ifp, int disabl
 	}
 
 	ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
-	sc->sc_link_active = false;
 
 	for (i = 0; i < sc->sc_act_nvq_pairs; i++) {
 		txq = >sc_txq[i];
 		rxq = >sc_rxq[i];
 
-		txq->txq_link_active = false;
-
 		if (disable)
 			vioif_rx_drain(rxq);
 
@@ -2393,8 +2392,8 @@ set_ifflags:
 	return r;
 }
 
-static bool
-vioif_is_link_up(struct vioif_softc *sc)
+static int
+vioif_get_link_status(struct vioif_softc *sc)
 {
 	struct virtio_softc *vsc = sc->sc_virtio;
 	uint16_t status;
@@ -2405,7 +2404,10 @@ vioif_is_link_up(struct vioif_softc *sc)
 	else
 		status = VIRTIO_NET_S_LINK_UP;
 
-	return ((status & VIRTIO_NET_S_LINK_UP) != 0);
+	if ((status & VIRTIO_NET_S_LINK_UP) != 0)
+		return LINK_STATE_UP;
+
+	return LINK_STATE_DOWN;
 }
 
 /* change link status */
@@ -2414,40 +2416,30 @@ vioif_update_link_status(struct vioif_so
 {
 	struct ifnet *ifp = >sc_ethercom.ec_if;
 	struct vioif_txqueue *txq;
-	bool active, changed;
+	bool active;
 	int link, i;
 
 	mutex_enter(>sc_lock);
 
-	active = vioif_is_link_up(sc);
-	changed = false;
+	link = vioif_get_link_status(sc);
 
-	if (active) {
-		if (!sc->sc_link_active)
-			changed = true;
+	if (link == sc->sc_link_state)
+		goto done;
 
-		link = LINK_STATE_UP;
-		sc->sc_link_active = true;
-	} else {
-		if (sc->sc_link_active)
-			changed = true;
-
-		link = LINK_STATE_DOWN;
-		sc->sc_link_active = false;
-	}
+	sc->sc_link_state = link;
 
-	if (changed) {
-		for (i = 0; i < sc->sc_act_nvq_pairs; i++) {
-			txq = >sc_txq[i];
-
-			mutex_enter(txq->txq_lock);
-			txq->txq_link_active = sc->sc_link_active;
-			mutex_exit(txq->txq_lock);
-		}
+	active = VIOIF_IS_LINK_ACTIVE(sc);
+	for (i = 0; i < sc->sc_act_nvq_pairs; i++) {
+		txq = >sc_txq[i];
 
-		if_link_state_change(ifp, link);
+		mutex_enter(txq->txq_lock);
+		txq->txq_link_active = active;
+		mutex_exit(txq->txq_lock);
 	}
 
+	if_link_state_change(ifp, sc->sc_link_state);
+
+done:
 	mutex_exit(>sc_lock);
 }
 



CVS commit: src/usr.bin/make

2022-09-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Sep 12 07:21:10 UTC 2022

Modified Files:
src/usr.bin/make: make.1

Log Message:
make.1: fix style of ellipsis

In most places, '...' is not intended to be entered verbatim, instead it
is a placeholder, so don't use a fixed-width font for it.


To generate a diff of this commit:
cvs rdiff -u -r1.342 -r1.343 src/usr.bin/make/make.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/make/make.1
diff -u src/usr.bin/make/make.1:1.342 src/usr.bin/make/make.1:1.343
--- src/usr.bin/make/make.1:1.342	Mon Sep 12 07:13:02 2022
+++ src/usr.bin/make/make.1	Mon Sep 12 07:21:10 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: make.1,v 1.342 2022/09/12 07:13:02 rillig Exp $
+.\"	$NetBSD: make.1,v 1.343 2022/09/12 07:21:10 rillig Exp $
 .\"
 .\" Copyright (c) 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -50,7 +50,7 @@
 .Op Fl V Ar variable
 .Op Fl v Ar variable
 .Op Ar variable\| Ns Cm \&= Ns Ar value
-.Op Ar target ...
+.Op Ar target No ...
 .Sh DESCRIPTION
 .Nm
 is a program designed to simplify the maintenance of other programs.
@@ -1269,7 +1269,7 @@ instead.
 The general format of a variable expansion is:
 .Pp
 .Sm off
-.D1 Ic \&${ Ar variable\| Oo Ic \&: Ar modifier\| Oo Ic \&: Ar ... Oc Oc Ic \&}
+.D1 Ic \&${ Ar variable\| Oo Ic \&: Ar modifier\| Oo Ic \&: No ... Oc Oc Ic \&}
 .Sm on
 .Pp
 Each modifier begins with a colon.
@@ -1279,9 +1279,9 @@ To escape a colon, precede it with a bac
 A list of indirect modifiers can be specified via a variable, as follows:
 .Pp
 .Bd -literal -offset indent
-.Ar modifier_variable\^ Li \&= Ar modifier Ns Oo Ic \&: Ns Ar ... Oc
+.Ar modifier_variable\^ Li \&= Ar modifier Ns Oo Ic \&: Ns No ... Oc
 .Sm off
-.Ic \&${ Ar variable Ic \&:${ Ar modifier_variable Ic \&} Oo Ic \&: Ar ... Oc Ic \&}
+.Ic \&${ Ar variable Ic \&:${ Ar modifier_variable Ic \&} Oo Ic \&: No ... Oc Ic \&}
 .Sm on
 .Ed
 .Pp
@@ -1802,7 +1802,7 @@ directories specified using the
 option are searched before the system makefile directory.
 .Pp
 For compatibility with other make variants,
-.Sq Cm include Ar file ...
+.Sq Cm include Ar file No ...
 (without leading dot)
 is also accepted.
 .Pp
@@ -1820,7 +1820,7 @@ but stale dependencies within the includ
 .Ss Exporting variables
 The directives for exporting and unexporting variables are:
 .Bl -tag -width Ds
-.It Ic .export Ar variable ...
+.It Ic .export Ar variable No ...
 Export the specified global variable.
 If no variable list is provided, all globals are exported
 except for internal variables (those that start with
@@ -1835,7 +1835,7 @@ For compatibility with other make progra
 Appending a variable name to
 .Va .MAKE.EXPORTED
 is equivalent to exporting a variable.
-.It Ic .export-env Ar variable ...
+.It Ic .export-env Ar variable No ...
 The same as
 .Ql .export ,
 except that the variable is not appended to
@@ -1844,11 +1844,11 @@ This allows exporting a value to the env
 used by
 .Nm
 internally.
-.It Ic .export-literal Ar variable ...
+.It Ic .export-literal Ar variable No ...
 The same as
 .Ql .export-env ,
 except that variables in the value are not expanded.
-.It Ic .unexport Ar variable ...
+.It Ic .unexport Ar variable No ...
 The opposite of
 .Ql .export .
 The specified global
@@ -1903,39 +1903,39 @@ exits immediately.
 .Ss Conditionals
 The directives for conditionals are:
 .Bl -tag -width Ds
-.It Ic \&.if Oo \&! Oc Ns Ar expression Op Ar operator expression ...
+.It Ic \&.if Oo \&! Oc Ns Ar expression Op Ar operator expression No ...
 Test the value of an expression.
-.It Ic .ifdef Oo \&! Oc Ns Ar variable Op Ar operator variable ...
+.It Ic .ifdef Oo \&! Oc Ns Ar variable Op Ar operator variable No ...
 Test the value of a variable.
-.It Ic .ifndef Oo \&! Oc Ns Ar variable Op Ar operator variable ...
+.It Ic .ifndef Oo \&! Oc Ns Ar variable Op Ar operator variable No ...
 Test the value of a variable.
-.It Ic .ifmake Oo \&! Oc Ns Ar target Op Ar operator target ...
+.It Ic .ifmake Oo \&! Oc Ns Ar target Op Ar operator target No ...
 Test the target being requested.
-.It Ic .ifnmake Oo \&! Ns Oc Ar target Op Ar operator target ...
+.It Ic .ifnmake Oo \&! Ns Oc Ar target Op Ar operator target No ...
 Test the target being requested.
 .It Ic .else
 Reverse the sense of the last conditional.
-.It Ic .elif Oo \&! Ns Oc Ar expression Op Ar operator expression ...
+.It Ic .elif Oo \&! Ns Oc Ar expression Op Ar operator expression No ...
 A combination of
 .Sq Ic .else
 followed by
 .Sq Ic .if .
-.It Ic .elifdef Oo \&! Oc Ns Ar variable Op Ar operator variable ...
+.It Ic .elifdef Oo \&! Oc Ns Ar variable Op Ar operator variable No ...
 A combination of
 .Sq Ic .else
 followed by
 .Sq Ic .ifdef .
-.It Ic .elifndef Oo \&! Oc Ns Ar variable Op Ar operator variable ...
+.It Ic .elifndef Oo \&! Oc Ns Ar variable Op Ar operator variable No ...
 A combination of
 .Sq 

CVS commit: src/usr.bin/make

2022-09-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Sep 12 07:21:10 UTC 2022

Modified Files:
src/usr.bin/make: make.1

Log Message:
make.1: fix style of ellipsis

In most places, '...' is not intended to be entered verbatim, instead it
is a placeholder, so don't use a fixed-width font for it.


To generate a diff of this commit:
cvs rdiff -u -r1.342 -r1.343 src/usr.bin/make/make.1

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



CVS commit: src/usr.bin/make

2022-09-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Sep 12 07:13:02 UTC 2022

Modified Files:
src/usr.bin/make: make.1

Log Message:
make.1: remove extraneous .El, update date


To generate a diff of this commit:
cvs rdiff -u -r1.341 -r1.342 src/usr.bin/make/make.1

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



CVS commit: src/usr.bin/make

2022-09-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Sep 12 07:13:02 UTC 2022

Modified Files:
src/usr.bin/make: make.1

Log Message:
make.1: remove extraneous .El, update date


To generate a diff of this commit:
cvs rdiff -u -r1.341 -r1.342 src/usr.bin/make/make.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/make/make.1
diff -u src/usr.bin/make/make.1:1.341 src/usr.bin/make/make.1:1.342
--- src/usr.bin/make/make.1:1.341	Mon Sep 12 07:10:59 2022
+++ src/usr.bin/make/make.1	Mon Sep 12 07:13:02 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: make.1,v 1.341 2022/09/12 07:10:59 rillig Exp $
+.\"	$NetBSD: make.1,v 1.342 2022/09/12 07:13:02 rillig Exp $
 .\"
 .\" Copyright (c) 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"	from: @(#)make.1	8.4 (Berkeley) 3/19/94
 .\"
-.Dd September 9, 2022
+.Dd September 12, 2022
 .Dt MAKE 1
 .Os
 .Sh NAME
@@ -1817,7 +1817,6 @@ If the include statement is written as
 not only are errors locating and/or opening include files ignored,
 but stale dependencies within the included file are ignored just like in
 .Va .MAKE.DEPENDFILE .
-.El
 .Ss Exporting variables
 The directives for exporting and unexporting variables are:
 .Bl -tag -width Ds



CVS commit: src/usr.bin/make

2022-09-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Sep 12 07:10:59 UTC 2022

Modified Files:
src/usr.bin/make: make.1

Log Message:
make.1: split section on directives into several subsections

Directives such as .error or .undef are not conditionals.  Having these
directives mixed in a single list made it more difficult to see how the
directives relate.


To generate a diff of this commit:
cvs rdiff -u -r1.340 -r1.341 src/usr.bin/make/make.1

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



CVS commit: src/usr.bin/make

2022-09-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Sep 12 07:10:59 UTC 2022

Modified Files:
src/usr.bin/make: make.1

Log Message:
make.1: split section on directives into several subsections

Directives such as .error or .undef are not conditionals.  Having these
directives mixed in a single list made it more difficult to see how the
directives relate.


To generate a diff of this commit:
cvs rdiff -u -r1.340 -r1.341 src/usr.bin/make/make.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/make/make.1
diff -u src/usr.bin/make/make.1:1.340 src/usr.bin/make/make.1:1.341
--- src/usr.bin/make/make.1:1.340	Fri Sep  9 10:57:39 2022
+++ src/usr.bin/make/make.1	Mon Sep 12 07:10:59 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: make.1,v 1.340 2022/09/09 10:57:39 uwe Exp $
+.\"	$NetBSD: make.1,v 1.341 2022/09/12 07:10:59 rillig Exp $
 .\"
 .\" Copyright (c) 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -1777,14 +1777,17 @@ in Bourne shell.
 Returns the number of words in the value.
 .El \" :[range]
 .El
-.Sh INCLUDE STATEMENTS, CONDITIONALS AND FOR LOOPS
-.\" TODO: Split into multiple subsections.
+.Sh DIRECTIVES
 Makefile inclusion, conditional structures and for loops are provided in
 .Nm .
 All such structures are identified by a line beginning with a single
 dot
 .Pq Ql \&.
-character.
+character, followed by the keyword of the directive, such as
+.Cm include
+or
+.Cm if .
+.Ss File inclusion
 Files are included with either
 .Cm \&.include \&< Ns Ar file Ns Cm \&>
 or
@@ -1797,8 +1800,9 @@ If double quotes are used, the including
 directories specified using the
 .Fl I
 option are searched before the system makefile directory.
+.Pp
 For compatibility with other make variants,
-.Ql include file ...
+.Sq Cm include Ar file ...
 (without leading dot)
 is also accepted.
 .Pp
@@ -1813,16 +1817,10 @@ If the include statement is written as
 not only are errors locating and/or opening include files ignored,
 but stale dependencies within the included file are ignored just like in
 .Va .MAKE.DEPENDFILE .
-.Pp
-Conditional expressions are also preceded by a single dot as the first
-character of a line.
-The possible conditionals are:
+.El
+.Ss Exporting variables
+The directives for exporting and unexporting variables are:
 .Bl -tag -width Ds
-.\" FIXME: .error is not a conditional directive.
-.It Ic .error Ar message
-The message is printed along with the name of the makefile and line number,
-.Nm
-exits immediately.
 .It Ic .export Ar variable ...
 Export the specified global variable.
 If no variable list is provided, all globals are exported
@@ -1851,11 +1849,6 @@ internally.
 The same as
 .Ql .export-env ,
 except that variables in the value are not expanded.
-.It Ic .info Ar message
-The message is printed along with the name of the makefile and line number.
-.It Ic .undef Ar variable ...
-Un-define the specified global variables.
-Only global variables can be un-defined.
 .It Ic .unexport Ar variable ...
 The opposite of
 .Ql .export .
@@ -1893,10 +1886,24 @@ which is the minimal useful environment.
 Actually
 .Sq Va .MAKE.LEVEL
 is also pushed into the new environment.
+.El
+.Ss Messages
+The directives for printing messages to the output are:
+.Bl -tag -width Ds
+.It Ic .info Ar message
+The message is printed along with the name of the makefile and line number.
 .It Ic .warning Ar message
 The message prefixed by
 .Sq Li warning:
 is printed along with the name of the makefile and line number.
+.It Ic .error Ar message
+The message is printed along with the name of the makefile and line number,
+.Nm
+exits immediately.
+.El
+.Ss Conditionals
+The directives for conditionals are:
+.Bl -tag -width Ds
 .It Ic \&.if Oo \&! Oc Ns Ar expression Op Ar operator expression ...
 Test the value of an expression.
 .It Ic .ifdef Oo \&! Oc Ns Ar variable Op Ar operator variable ...
@@ -2046,7 +2053,7 @@ In both cases, this continues until the 
 or
 .Sq Ic .endif
 is found.
-.Pp
+.Ss For loops
 For loops are typically used to apply a set of rules to a list of files.
 The syntax of a for loop is:
 .Pp
@@ -2076,6 +2083,12 @@ is encountered within a
 .Cm \&.for
 loop, it causes early termination of the loop, otherwise a parse error.
 .\" TODO: Describe limitations with defined/empty.
+.Ss Other directives
+.Bl -tag -width Ds
+.It Ic .undef Ar variable ...
+Un-define the specified global variables.
+Only global variables can be un-defined.
+.El
 .Sh COMMENTS
 Comments begin with a hash
 .Pq Ql 

CVS commit: src/sys/arch/powerpc/ibm4xx

2022-09-12 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Sep 12 06:23:29 UTC 2022

Modified Files:
src/sys/arch/powerpc/ibm4xx: trap.c

Log Message:
copy{in,out}(): Minor clean up:
- No need to supply count (== 0).
- %r0 can be used as %[ctx] and %[len].


To generate a diff of this commit:
cvs rdiff -u -r1.96 -r1.97 src/sys/arch/powerpc/ibm4xx/trap.c

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

Modified files:

Index: src/sys/arch/powerpc/ibm4xx/trap.c
diff -u src/sys/arch/powerpc/ibm4xx/trap.c:1.96 src/sys/arch/powerpc/ibm4xx/trap.c:1.97
--- src/sys/arch/powerpc/ibm4xx/trap.c:1.96	Mon Sep 12 06:19:14 2022
+++ src/sys/arch/powerpc/ibm4xx/trap.c	Mon Sep 12 06:23:29 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.96 2022/09/12 06:19:14 rin Exp $	*/
+/*	$NetBSD: trap.c,v 1.97 2022/09/12 06:23:29 rin Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -69,7 +69,7 @@
 #define	__UFETCHSTORE_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.96 2022/09/12 06:19:14 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.97 2022/09/12 06:23:29 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -431,7 +431,7 @@ int
 copyin(const void *uaddr, void *kaddr, size_t len)
 {
 	struct pmap *pm = curproc->p_vmspace->vm_map.pmap;
-	int rv, msr, pid, tmp, ctx, count = 0;
+	int rv, msr, pid, tmp, ctx;
 	struct faultbuf env;
 
 	/* For bigger buffers use the faster copy */
@@ -457,9 +457,9 @@ copyin(const void *uaddr, void *kaddr, s
 		"isync;"
 		"mfpid	%[pid];"		/* Save old PID */
 
-		"srwi.	%[count],%[len],0x2;"	/* How many words? */
+		"srwi.	%[tmp],%[len],0x2;"	/* How many words? */
 		"beq-	2f;"			/* No words. Go do bytes */
-		"mtctr	%[count];"
+		"mtctr	%[tmp];"
 
 	"1:"	"mtpid	%[ctx];"
 		"isync;"
@@ -483,9 +483,9 @@ copyin(const void *uaddr, void *kaddr, s
 		"sync;"
 		"bdnz	1b;"			/* repeat */
 
-	"2:"	"andi.	%[count],%[len],0x3;"	/* How many remaining bytes? */
+	"2:"	"andi.	%[tmp],%[len],0x3;"	/* How many remaining bytes? */
 		"beq	10f;"
-		"mtxer	%[count];"
+		"mtxer	%[tmp];"
 
 		"mtpid	%[ctx];"
 		"isync;"
@@ -502,8 +502,8 @@ copyin(const void *uaddr, void *kaddr, s
 		"isync;"
 
 		: [msr] "=" (msr), [pid] "=" (pid), [tmp] "=" (tmp)
-		: [uaddr] "b" (uaddr), [ctx] "b" (ctx), [kaddr] "b" (kaddr),
-		  [len] "b" (len), [count] "b" (count)
+		: [uaddr] "b" (uaddr), [kaddr] "b" (kaddr),
+		  [ctx] "r" (ctx), [len] "r" (len)
 		: "cr0", "ctr", "xer");
 
 	curpcb->pcb_onfault = NULL;
@@ -546,7 +546,7 @@ int
 copyout(const void *kaddr, void *uaddr, size_t len)
 {
 	struct pmap *pm = curproc->p_vmspace->vm_map.pmap;
-	int rv, msr, pid, tmp, ctx, count = 0;
+	int rv, msr, pid, tmp, ctx;
 	struct faultbuf env;
 
 	/* For big copies use more efficient routine */
@@ -572,9 +572,9 @@ copyout(const void *kaddr, void *uaddr, 
 		"isync;"
 		"mfpid	%[pid];"		/* Save old PID */
 
-		"srwi.	%[count],%[len],0x2;"	/* How many words? */
+		"srwi.	%[tmp],%[len],0x2;"	/* How many words? */
 		"beq-	2f;"			/* No words. Go do bytes */
-		"mtctr	%[count];"
+		"mtctr	%[tmp];"
 
 	"1:"
 #ifdef PPC_IBM403
@@ -600,9 +600,9 @@ copyout(const void *kaddr, void *uaddr, 
 		"isync;"
 		"bdnz	1b;"			/* repeat */
 
-	"2:"	"andi.	%[count],%[len],0x3;"	/* How many remaining bytes? */
+	"2:"	"andi.	%[tmp],%[len],0x3;"	/* How many remaining bytes? */
 		"beq	10f;"
-		"mtxer	%[count];"
+		"mtxer	%[tmp];"
 
 		"lswx	%[tmp],0,%[kaddr];"	/* Load kernel bytes */
 		"sync;"
@@ -618,8 +618,8 @@ copyout(const void *kaddr, void *uaddr, 
 		"isync;"
 
 		: [msr] "=" (msr), [pid] "=" (pid), [tmp] "=" (tmp)
-		: [uaddr] "b" (uaddr), [ctx] "b" (ctx), [kaddr] "b" (kaddr),
-		  [len] "b" (len), [count] "b" (count)
+		: [uaddr] "b" (uaddr), [kaddr] "b" (kaddr),
+		  [ctx] "r" (ctx), [len] "r" (len)
 		: "cr0", "ctr", "xer");
 
 	curpcb->pcb_onfault = NULL;



CVS commit: src/sys/arch/powerpc/ibm4xx

2022-09-12 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Sep 12 06:23:29 UTC 2022

Modified Files:
src/sys/arch/powerpc/ibm4xx: trap.c

Log Message:
copy{in,out}(): Minor clean up:
- No need to supply count (== 0).
- %r0 can be used as %[ctx] and %[len].


To generate a diff of this commit:
cvs rdiff -u -r1.96 -r1.97 src/sys/arch/powerpc/ibm4xx/trap.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/powerpc/ibm4xx

2022-09-12 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Sep 12 06:19:14 UTC 2022

Modified Files:
src/sys/arch/powerpc/ibm4xx: trap.c

Log Message:
copyin(): Remove one more needless mtpid. No regression for full ATF.


To generate a diff of this commit:
cvs rdiff -u -r1.95 -r1.96 src/sys/arch/powerpc/ibm4xx/trap.c

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

Modified files:

Index: src/sys/arch/powerpc/ibm4xx/trap.c
diff -u src/sys/arch/powerpc/ibm4xx/trap.c:1.95 src/sys/arch/powerpc/ibm4xx/trap.c:1.96
--- src/sys/arch/powerpc/ibm4xx/trap.c:1.95	Sun Sep 11 09:27:18 2022
+++ src/sys/arch/powerpc/ibm4xx/trap.c	Mon Sep 12 06:19:14 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.95 2022/09/11 09:27:18 rin Exp $	*/
+/*	$NetBSD: trap.c,v 1.96 2022/09/12 06:19:14 rin Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -69,7 +69,7 @@
 #define	__UFETCHSTORE_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.95 2022/09/11 09:27:18 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.96 2022/09/12 06:19:14 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -498,8 +498,7 @@ copyin(const void *uaddr, void *kaddr, s
 		"dcbst	0,%[kaddr];"		/* flush cache */
 		"sync;"
 
-	"10:"	"mtpid	%[pid];"		/* Restore PID and MSR */
-		"mtmsr	%[msr];"
+	"10:"	"mtmsr	%[msr];"		/* Restore MSR */
 		"isync;"
 
 		: [msr] "=" (msr), [pid] "=" (pid), [tmp] "=" (tmp)



CVS commit: src/sys/arch/powerpc/ibm4xx

2022-09-12 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Sep 12 06:19:14 UTC 2022

Modified Files:
src/sys/arch/powerpc/ibm4xx: trap.c

Log Message:
copyin(): Remove one more needless mtpid. No regression for full ATF.


To generate a diff of this commit:
cvs rdiff -u -r1.95 -r1.96 src/sys/arch/powerpc/ibm4xx/trap.c

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