CVS commit: src/sys/dev/tprof

2022-11-09 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Thu Nov 10 07:54:20 UTC 2022

Modified Files:
src/sys/dev/tprof: tprof_armv8.c

Log Message:
revert my previous commit.

since armv8_pmu_init is only called when it is reliably worked by ACPI or fdt,
there is no need for dynamic checks.

pointed out by jmcneill@, thanks


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/tprof/tprof_armv8.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/tprof

2022-11-09 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Thu Nov 10 07:54:20 UTC 2022

Modified Files:
src/sys/dev/tprof: tprof_armv8.c

Log Message:
revert my previous commit.

since armv8_pmu_init is only called when it is reliably worked by ACPI or fdt,
there is no need for dynamic checks.

pointed out by jmcneill@, thanks


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/tprof/tprof_armv8.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/tprof/tprof_armv8.c
diff -u src/sys/dev/tprof/tprof_armv8.c:1.15 src/sys/dev/tprof/tprof_armv8.c:1.16
--- src/sys/dev/tprof/tprof_armv8.c:1.15	Wed Nov  9 19:06:46 2022
+++ src/sys/dev/tprof/tprof_armv8.c	Thu Nov 10 07:54:20 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: tprof_armv8.c,v 1.15 2022/11/09 19:06:46 ryo Exp $ */
+/* $NetBSD: tprof_armv8.c,v 1.16 2022/11/10 07:54:20 ryo Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tprof_armv8.c,v 1.15 2022/11/09 19:06:46 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tprof_armv8.c,v 1.16 2022/11/10 07:54:20 ryo Exp $");
 
 #include 
 #include 
@@ -233,8 +233,7 @@ armv8_pmu_detect(void)
 int
 armv8_pmu_init(void)
 {
-	if (!armv8_pmu_detect())
-		return ENOTSUP;
+	KASSERT(armv8_pmu_detect());
 
 	uint64_t xc = xc_broadcast(0, armv8_pmu_init_cpu, NULL, NULL);
 	xc_wait(xc);



CVS commit: src/distrib/sets/lists/tests

2022-11-09 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Thu Nov 10 06:13:58 UTC 2022

Modified Files:
src/distrib/sets/lists/tests: mi

Log Message:
Added new libcurses test checkfile.


To generate a diff of this commit:
cvs rdiff -u -r1.1229 -r1.1230 src/distrib/sets/lists/tests/mi

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

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.1229 src/distrib/sets/lists/tests/mi:1.1230
--- src/distrib/sets/lists/tests/mi:1.1229	Wed Nov  9 08:21:20 2022
+++ src/distrib/sets/lists/tests/mi	Thu Nov 10 06:13:58 2022
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1229 2022/11/09 08:21:20 knakahara Exp $
+# $NetBSD: mi,v 1.1230 2022/11/10 06:13:58 blymn Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -3523,6 +3523,7 @@
 ./usr/tests/lib/libcurses/check_files/waddnwstr1.chk		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/check_files/waddnwstr2.chk		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/check_files/waddstr.chk		tests-lib-tests		compattestfile,atf
+./usr/tests/lib/libcurses/check_files/waddstr2.chk		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/check_files/waddwstr1.chk		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/check_files/waddwstr2.chk		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libcurses/check_files/waddwstr3.chk		tests-lib-tests		compattestfile,atf



CVS commit: src/distrib/sets/lists/tests

2022-11-09 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Thu Nov 10 06:13:58 UTC 2022

Modified Files:
src/distrib/sets/lists/tests: mi

Log Message:
Added new libcurses test checkfile.


To generate a diff of this commit:
cvs rdiff -u -r1.1229 -r1.1230 src/distrib/sets/lists/tests/mi

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



CVS commit: src/tests/lib/libcurses

2022-11-09 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Thu Nov 10 06:13:29 UTC 2022

Modified Files:
src/tests/lib/libcurses/check_files: Makefile waddstr.chk
src/tests/lib/libcurses/tests: waddstr
Added Files:
src/tests/lib/libcurses/check_files: waddstr2.chk

Log Message:
Uncomment the waddstr call that was returning ERR, this is actually
correct so make the expected return ERR then repeat the call with
scrollok set to true to validate.

Do refreshes on the window instead of stdscr so we get the window
contents reported and update the check files with the expected
output.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/tests/lib/libcurses/check_files/Makefile
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/check_files/waddstr.chk
cvs rdiff -u -r0 -r1.1 src/tests/lib/libcurses/check_files/waddstr2.chk
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/tests/waddstr

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

Modified files:

Index: src/tests/lib/libcurses/check_files/Makefile
diff -u src/tests/lib/libcurses/check_files/Makefile:1.11 src/tests/lib/libcurses/check_files/Makefile:1.12
--- src/tests/lib/libcurses/check_files/Makefile:1.11	Tue Nov  8 06:06:54 2022
+++ src/tests/lib/libcurses/check_files/Makefile	Thu Nov 10 06:13:29 2022
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.11 2022/11/08 06:06:54 blymn Exp $
+# $NetBSD: Makefile,v 1.12 2022/11/10 06:13:29 blymn Exp $
 
 NOMAN=		# defined
 
@@ -241,6 +241,7 @@ FILES+=		waddchstr.chk
 FILES+=		waddnwstr1.chk
 FILES+=		waddnwstr2.chk
 FILES+=		waddstr.chk
+FILES+=		waddstr2.chk
 FILES+=		waddwstr1.chk
 FILES+=		waddwstr2.chk
 FILES+=		waddwstr3.chk

Index: src/tests/lib/libcurses/check_files/waddstr.chk
diff -u src/tests/lib/libcurses/check_files/waddstr.chk:1.1 src/tests/lib/libcurses/check_files/waddstr.chk:1.2
--- src/tests/lib/libcurses/check_files/waddstr.chk:1.1	Sun Feb  7 01:53:54 2021
+++ src/tests/lib/libcurses/check_files/waddstr.chk	Thu Nov 10 06:13:29 2022
@@ -1 +1,3 @@
-home
\ No newline at end of file
+abcdecup6;8X8
+ 012345
+ 68 
\ No newline at end of file

Index: src/tests/lib/libcurses/tests/waddstr
diff -u src/tests/lib/libcurses/tests/waddstr:1.2 src/tests/lib/libcurses/tests/waddstr:1.3
--- src/tests/lib/libcurses/tests/waddstr:1.2	Sun Feb  7 01:53:54 2021
+++ src/tests/lib/libcurses/tests/waddstr	Thu Nov 10 06:13:29 2022
@@ -2,8 +2,12 @@ include window
 call OK waddstr $win1 "abcde\n"
 call OK waddstr $win1 "\n"
 call OK waddstr $win1 "\t8\n"
-# XXX: The following line causes an unexpected "ERR Resource temporarily
-# unavailable" on NetBSD/amd64 9.99.80.
-#call OK waddstr $win1 "0123456\t8\n"
-call OK refresh
+# The following should ERR because it will try to scroll but
+# scrollok is false
+call ERR waddstr $win1 "0123456\t8\n"
+call OK wrefresh $win1
 compare waddstr.chk
+call OK scrollok $win1 $TRUE
+call OK waddstr $win1 "0123456\t8\n"
+call OK wrefresh $win1
+compare waddstr2.chk

Added files:

Index: src/tests/lib/libcurses/check_files/waddstr2.chk
diff -u /dev/null src/tests/lib/libcurses/check_files/waddstr2.chk:1.1
--- /dev/null	Thu Nov 10 06:13:29 2022
+++ src/tests/lib/libcurses/check_files/waddstr2.chk	Thu Nov 10 06:13:29 2022
@@ -0,0 +1,3 @@
+012345cup5;6X6cup6;8Xel
+   8el
+ el
\ No newline at end of file



CVS commit: src/tests/lib/libcurses

2022-11-09 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Thu Nov 10 06:13:29 UTC 2022

Modified Files:
src/tests/lib/libcurses/check_files: Makefile waddstr.chk
src/tests/lib/libcurses/tests: waddstr
Added Files:
src/tests/lib/libcurses/check_files: waddstr2.chk

Log Message:
Uncomment the waddstr call that was returning ERR, this is actually
correct so make the expected return ERR then repeat the call with
scrollok set to true to validate.

Do refreshes on the window instead of stdscr so we get the window
contents reported and update the check files with the expected
output.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/tests/lib/libcurses/check_files/Makefile
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/check_files/waddstr.chk
cvs rdiff -u -r0 -r1.1 src/tests/lib/libcurses/check_files/waddstr2.chk
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/tests/waddstr

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



Re: CVS commit: src/sys/dev/tprof

2022-11-09 Thread Jared McNeill
I think this is a bug in your device tree because the KASSERT was 
intentional:


 - In the ACPI case, we probe for CPU PMU support before calling
   armv8_pmu_init.
 - In the FDT case, the PMU attaches to a node described in the device
   tree.

So if you hit this KASSERT, AFAICT it means your device tree is describing 
a device that is not there. Unless I'm missing something here.


Take care,
Jared

On Wed, 9 Nov 2022, Ryo Shimizu wrote:


Module Name:src
Committed By:   ryo
Date:   Wed Nov  9 19:06:46 UTC 2022

Modified Files:
src/sys/dev/tprof: tprof_armv8.c

Log Message:
If the hardware does not support PMU, return an error instead of KASSERT.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/tprof/tprof_armv8.c

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




CVS commit: src/lib/libc/gen

2022-11-09 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Thu Nov 10 00:47:01 UTC 2022

Modified Files:
src/lib/libc/gen: closefrom.3

Log Message:
closefrom.3: add a history section


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libc/gen/closefrom.3

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

Modified files:

Index: src/lib/libc/gen/closefrom.3
diff -u src/lib/libc/gen/closefrom.3:1.5 src/lib/libc/gen/closefrom.3:1.6
--- src/lib/libc/gen/closefrom.3:1.5	Tue Jun  1 16:12:51 2004
+++ src/lib/libc/gen/closefrom.3	Thu Nov 10 00:47:01 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: closefrom.3,v 1.5 2004/06/01 16:12:51 kleink Exp $
+.\"	$NetBSD: closefrom.3,v 1.6 2022/11/10 00:47:01 gutteridge Exp $
 .\"	$OpenBSD: closefrom.2,v 1.2 2004/01/12 20:52:09 jmc Exp $
 .\"
 .\" Copyright (c) 2004 Ted Unangst.  All rights reserved.
@@ -23,7 +23,7 @@
 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
-.Dd June 1, 2004
+.Dd November 9, 2022
 .Dt CLOSEFROM 3
 .Os
 .Sh NAME
@@ -59,3 +59,6 @@ An interrupt was received.
 .El
 .Sh SEE ALSO
 .Xr close 2
+.Sh HISTORY
+This function first appeared in
+.Nx 3 .



CVS commit: src/lib/libc/gen

2022-11-09 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Thu Nov 10 00:47:01 UTC 2022

Modified Files:
src/lib/libc/gen: closefrom.3

Log Message:
closefrom.3: add a history section


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libc/gen/closefrom.3

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



CVS commit: src/sys/dev/tprof

2022-11-09 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Wed Nov  9 19:06:46 UTC 2022

Modified Files:
src/sys/dev/tprof: tprof_armv8.c

Log Message:
If the hardware does not support PMU, return an error instead of KASSERT.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/tprof/tprof_armv8.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/tprof

2022-11-09 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Wed Nov  9 19:06:46 UTC 2022

Modified Files:
src/sys/dev/tprof: tprof_armv8.c

Log Message:
If the hardware does not support PMU, return an error instead of KASSERT.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/tprof/tprof_armv8.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/tprof/tprof_armv8.c
diff -u src/sys/dev/tprof/tprof_armv8.c:1.14 src/sys/dev/tprof/tprof_armv8.c:1.15
--- src/sys/dev/tprof/tprof_armv8.c:1.14	Mon May 16 09:42:32 2022
+++ src/sys/dev/tprof/tprof_armv8.c	Wed Nov  9 19:06:46 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: tprof_armv8.c,v 1.14 2022/05/16 09:42:32 jmcneill Exp $ */
+/* $NetBSD: tprof_armv8.c,v 1.15 2022/11/09 19:06:46 ryo Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tprof_armv8.c,v 1.14 2022/05/16 09:42:32 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tprof_armv8.c,v 1.15 2022/11/09 19:06:46 ryo Exp $");
 
 #include 
 #include 
@@ -233,7 +233,8 @@ armv8_pmu_detect(void)
 int
 armv8_pmu_init(void)
 {
-	KASSERT(armv8_pmu_detect());
+	if (!armv8_pmu_detect())
+		return ENOTSUP;
 
 	uint64_t xc = xc_broadcast(0, armv8_pmu_init_cpu, NULL, NULL);
 	xc_wait(xc);



CVS commit: src/sys/arch/arm/fdt

2022-11-09 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Wed Nov  9 19:03:38 UTC 2022

Modified Files:
src/sys/arch/arm/fdt: pmu_fdt.c

Log Message:
fdt/pmu was not working. do return only if there is an error.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/fdt/pmu_fdt.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/arm/fdt/pmu_fdt.c
diff -u src/sys/arch/arm/fdt/pmu_fdt.c:1.10 src/sys/arch/arm/fdt/pmu_fdt.c:1.11
--- src/sys/arch/arm/fdt/pmu_fdt.c:1.10	Thu Nov 25 09:36:20 2021
+++ src/sys/arch/arm/fdt/pmu_fdt.c	Wed Nov  9 19:03:38 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: pmu_fdt.c,v 1.10 2021/11/25 09:36:20 skrll Exp $ */
+/* $NetBSD: pmu_fdt.c,v 1.11 2022/11/09 19:03:38 ryo Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmu_fdt.c,v 1.10 2021/11/25 09:36:20 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmu_fdt.c,v 1.11 2022/11/09 19:03:38 ryo Exp $");
 
 #include 
 #include 
@@ -137,8 +137,8 @@ pmu_fdt_init(device_t self)
 		if (error) {
 			aprint_error_dev(self,
 			"couldn't initialise PMU event counter");
+			return;
 		}
-		return;
 	}
 
 	ih = kmem_zalloc(sizeof(void *) * ncpu, KM_SLEEP);



CVS commit: src/sys/arch/arm/fdt

2022-11-09 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Wed Nov  9 19:03:38 UTC 2022

Modified Files:
src/sys/arch/arm/fdt: pmu_fdt.c

Log Message:
fdt/pmu was not working. do return only if there is an error.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/fdt/pmu_fdt.c

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



CVS commit: src/doc

2022-11-09 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Nov  9 14:43:20 UTC 2022

Modified Files:
src/doc: 3RDPARTY

Log Message:
texinfo 7.0 out


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

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



CVS commit: src/doc

2022-11-09 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Nov  9 14:43:20 UTC 2022

Modified Files:
src/doc: 3RDPARTY

Log Message:
texinfo 7.0 out


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

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1899 src/doc/3RDPARTY:1.1900
--- src/doc/3RDPARTY:1.1899	Sat Nov  5 18:38:08 2022
+++ src/doc/3RDPARTY	Wed Nov  9 14:43:20 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1899 2022/11/05 18:38:08 wiz Exp $
+#	$NetBSD: 3RDPARTY,v 1.1900 2022/11/09 14:43:20 wiz Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -2172,7 +2172,7 @@ Old versions are available from Purdue (
 
 Package:	texinfo
 Version:	4.8a (Last GPLv2+ version)
-Current Vers:	6.5
+Current Vers:	7.0
 Maintainer:	FSF
 Archive Site:	ftp://ftp.gnu.org/gnu/texinfo/
 Home Page:	http://www.gnu.org/software/texinfo/



CVS commit: src

2022-11-09 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Wed Nov  9 08:21:20 UTC 2022

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/net/ipsec: Makefile
Added Files:
src/tests/net/ipsec: t_ipsec_forwarding.sh

Log Message:
Add test for sys/netipsec/ipsec.c:r1.176.


To generate a diff of this commit:
cvs rdiff -u -r1.1228 -r1.1229 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.11 -r1.12 src/tests/net/ipsec/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/net/ipsec/t_ipsec_forwarding.sh

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

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.1228 src/distrib/sets/lists/tests/mi:1.1229
--- src/distrib/sets/lists/tests/mi:1.1228	Tue Nov  8 06:08:33 2022
+++ src/distrib/sets/lists/tests/mi	Wed Nov  9 08:21:20 2022
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1228 2022/11/08 06:08:33 blymn Exp $
+# $NetBSD: mi,v 1.1229 2022/11/09 08:21:20 knakahara Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -4214,6 +4214,7 @@
 ./usr/tests/net/ipsec/natt_terminator			tests-net-tests		atf,rump
 ./usr/tests/net/ipsec/t_ipsec_ah_keys			tests-net-tests		atf,rump
 ./usr/tests/net/ipsec/t_ipsec_esp_keys			tests-net-tests		atf,rump
+./usr/tests/net/ipsec/t_ipsec_forwarding		tests-net-tests		atf,rump
 ./usr/tests/net/ipsec/t_ipsec_gif			tests-net-tests		atf,rump
 ./usr/tests/net/ipsec/t_ipsec_l2tp			tests-net-tests		atf,rump
 ./usr/tests/net/ipsec/t_ipsec_misc			tests-net-tests		atf,rump

Index: src/tests/net/ipsec/Makefile
diff -u src/tests/net/ipsec/Makefile:1.11 src/tests/net/ipsec/Makefile:1.12
--- src/tests/net/ipsec/Makefile:1.11	Tue Oct 11 09:55:21 2022
+++ src/tests/net/ipsec/Makefile	Wed Nov  9 08:21:20 2022
@@ -1,13 +1,13 @@
-# $NetBSD: Makefile,v 1.11 2022/10/11 09:55:21 knakahara Exp $
+# $NetBSD: Makefile,v 1.12 2022/11/09 08:21:20 knakahara Exp $
 #
 
 .include 
 
 TESTSDIR=	${TESTSBASE}/net/ipsec
 
-.for name in ipsec_ah_keys ipsec_esp_keys ipsec_gif ipsec_l2tp ipsec_misc \
-ipsec_natt ipsec_sockopt ipsec_spflags ipsec_sysctl ipsec_tcp \
-ipsec_transport ipsec_tunnel ipsec_tunnel_ipcomp ipsec_tunnel_odd
+.for name in ipsec_ah_keys ipsec_esp_keys ipsec_forwarding ipsec_gif \
+ipsec_l2tp ipsec_misc ipsec_natt ipsec_sockopt ipsec_spflags ipsec_sysctl \
+ipsec_tcp ipsec_transport ipsec_tunnel ipsec_tunnel_ipcomp ipsec_tunnel_odd
 TESTS_SH+=		t_${name}
 TESTS_SH_SRC_t_${name}=	../net_common.sh ./common.sh ./algorithms.sh \
 t_${name}.sh

Added files:

Index: src/tests/net/ipsec/t_ipsec_forwarding.sh
diff -u /dev/null src/tests/net/ipsec/t_ipsec_forwarding.sh:1.1
--- /dev/null	Wed Nov  9 08:21:20 2022
+++ src/tests/net/ipsec/t_ipsec_forwarding.sh	Wed Nov  9 08:21:20 2022
@@ -0,0 +1,525 @@
+#   $NetBSD: t_ipsec_forwarding.sh,v 1.1 2022/11/09 08:21:20 knakahara Exp $
+#
+# Copyright (c) 2022 Internet Initiative Japan Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#notice, this list of conditions and the following disclaimer in the
+#documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+SOCK_LOCAL=unix://ipsec_local
+SOCK_FORWARD=unix://ipsec_forward
+SOCK_REMOTE=unix://ipsec_remote
+BUS_LOCAL_I=./bus_ipsec_local
+BUS_LOCAL_F=./bus_ipsec_local_forward
+BUS_REMOTE_F=./bus_ipsec_remote_forward
+BUS_REMOTE_I=./bus_ipsec_remote
+
+DEBUG=${DEBUG:-false}
+
+setup_servers_ipv4()
+{
+
+	rump_server_crypto_start $SOCK_LOCAL netipsec
+	rump_server_crypto_start $SOCK_FORWARD netipsec
+	rump_server_crypto_start $SOCK_REMOTE netipsec
+	rump_server_add_iface $SOCK_LOCAL shmif0 $BUS_LOCAL_F
+	rump_server_add_iface $SOCK_LOCAL shmif1 $BUS_LOCAL_I
+	rump_server_add_iface $SOCK_FORWARD shmif0 $BUS_LOCAL_F
+	rump_server_add_iface $SOCK_FORWARD shmif1 

CVS commit: src

2022-11-09 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Wed Nov  9 08:21:20 UTC 2022

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/net/ipsec: Makefile
Added Files:
src/tests/net/ipsec: t_ipsec_forwarding.sh

Log Message:
Add test for sys/netipsec/ipsec.c:r1.176.


To generate a diff of this commit:
cvs rdiff -u -r1.1228 -r1.1229 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.11 -r1.12 src/tests/net/ipsec/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/net/ipsec/t_ipsec_forwarding.sh

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



CVS commit: src/sys/netipsec

2022-11-09 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Wed Nov  9 08:18:53 UTC 2022

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

Log Message:
Fix IPv4 security policy with port number does not work for forwarding packets.


To generate a diff of this commit:
cvs rdiff -u -r1.175 -r1.176 src/sys/netipsec/ipsec.c

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

Modified files:

Index: src/sys/netipsec/ipsec.c
diff -u src/sys/netipsec/ipsec.c:1.175 src/sys/netipsec/ipsec.c:1.176
--- src/sys/netipsec/ipsec.c:1.175	Fri Nov  4 09:00:58 2022
+++ src/sys/netipsec/ipsec.c	Wed Nov  9 08:18:52 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: ipsec.c,v 1.175 2022/11/04 09:00:58 ozaki-r Exp $ */
+/* $NetBSD: ipsec.c,v 1.176 2022/11/09 08:18:52 knakahara Exp $ */
 /* $FreeBSD: ipsec.c,v 1.2.2.2 2003/07/01 01:38:13 sam Exp $ */
 /* $KAME: ipsec.c,v 1.103 2001/05/24 07:14:18 sakane Exp $ */
 
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ipsec.c,v 1.175 2022/11/04 09:00:58 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipsec.c,v 1.176 2022/11/09 08:18:52 knakahara Exp $");
 
 /*
  * IPsec controller part.
@@ -543,7 +543,7 @@ ipsec_getpolicybyaddr(struct mbuf *m, u_
 	sp = NULL;
 
 	/* Make an index to look for a policy. */
-	*error = ipsec_setspidx(m, , dir, (flag & IP_FORWARDING) ? 0 : 1);
+	*error = ipsec_setspidx(m, , dir, 1);
 	if (*error != 0) {
 		IPSECLOG(LOG_DEBUG, "setpidx failed, dir %u flag %u\n", dir, flag);
 		memset(, 0, sizeof(spidx));



CVS commit: src/sys/netipsec

2022-11-09 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Wed Nov  9 08:18:53 UTC 2022

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

Log Message:
Fix IPv4 security policy with port number does not work for forwarding packets.


To generate a diff of this commit:
cvs rdiff -u -r1.175 -r1.176 src/sys/netipsec/ipsec.c

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