CVS commit: src/sys/netinet

2018-04-10 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed Apr 11 05:38:47 UTC 2018

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

Log Message:
Add XXX.


To generate a diff of this commit:
cvs rdiff -u -r1.272 -r1.273 src/sys/netinet/if_arp.c

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

Modified files:

Index: src/sys/netinet/if_arp.c
diff -u src/sys/netinet/if_arp.c:1.272 src/sys/netinet/if_arp.c:1.273
--- src/sys/netinet/if_arp.c:1.272	Tue Apr 10 08:41:14 2018
+++ src/sys/netinet/if_arp.c	Wed Apr 11 05:38:47 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_arp.c,v 1.272 2018/04/10 08:41:14 maxv Exp $	*/
+/*	$NetBSD: if_arp.c,v 1.273 2018/04/11 05:38:47 maxv Exp $	*/
 
 /*
  * Copyright (c) 1998, 2000, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.272 2018/04/10 08:41:14 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.273 2018/04/11 05:38:47 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -1358,6 +1358,15 @@ reply:
 	}
 	ia4_release(ia, _ia);
 
+	/*
+	 * XXX XXX: Here we're recycling the mbuf. But the mbuf could have
+	 * other mbufs in its chain, and just overwriting m->m_pkthdr.len
+	 * would be wrong in this case (the length becomes smaller than the
+	 * real chain size).
+	 *
+	 * This can theoretically cause bugs in the lower layers (drivers,
+	 * and L2encap), in some corner cases.
+	 */
 	memcpy(ar_tpa(ah), ar_spa(ah), ah->ar_pln);
 	memcpy(ar_spa(ah), , ah->ar_pln);
 	ah->ar_op = htons(ARPOP_REPLY);



CVS commit: src/sys/netinet

2018-04-10 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed Apr 11 05:38:47 UTC 2018

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

Log Message:
Add XXX.


To generate a diff of this commit:
cvs rdiff -u -r1.272 -r1.273 src/sys/netinet/if_arp.c

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



CVS commit: src

2018-04-10 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Apr 11 03:25:25 UTC 2018

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/usr.bin/c++: Makefile
src/tests/usr.bin/cc: Makefile
Added Files:
src/tests/usr.bin/c++: t_asan_poison.sh
src/tests/usr.bin/cc: t_asan_poison.sh

Log Message:
Import new C and C++ ATF tests for ASan

Add new tests:
 - tests/usr.bin/cc/t_asan_poison.sh
 - tests/usr.bin/c++/t_asan_poison.sh

These tests verify the following build options:
 - regular
 - profile
 - pic
 - pie
 - compat32
 - (static unsupported)

These tests verify whether ASan code can include compiler and sanitizer
specific header: . The testing code checks
the ASAN_POISON_MEMORY_REGION() functionality, poisoning valid memory and
asserting that it triggers expected failure.

Patch submitted by 


To generate a diff of this commit:
cvs rdiff -u -r1.780 -r1.781 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.7 -r1.8 src/tests/usr.bin/c++/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/c++/t_asan_poison.sh
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/cc/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/cc/t_asan_poison.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.780 src/distrib/sets/lists/tests/mi:1.781
--- src/distrib/sets/lists/tests/mi:1.780	Wed Apr  4 23:51:35 2018
+++ src/distrib/sets/lists/tests/mi	Wed Apr 11 03:25:25 2018
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.780 2018/04/04 23:51:35 kamil Exp $
+# $NetBSD: mi,v 1.781 2018/04/11 03:25:25 kamil Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -3639,6 +3639,7 @@
 ./usr/tests/usr.bin/c++/t_asan_global_buffer_overflow	tests-usr.bin-tests	compattestfile,atf,cxx
 ./usr/tests/usr.bin/c++/t_asan_heap_overflow	tests-usr.bin-tests	compattestfile,atf,cxx
 ./usr/tests/usr.bin/c++/t_asan_off_by_one	tests-usr.bin-tests	compattestfile,atf,cxx
+./usr/tests/usr.bin/c++/t_asan_poison		tests-usr.bin-tests	compattestfile,atf,cxx
 ./usr/tests/usr.bin/c++/t_asan_uaf		tests-usr.bin-tests	compattestfile,atf,cxx
 ./usr/tests/usr.bin/c++/t_call_once		tests-usr.bin-tests	compattestfile,atf,cxx
 ./usr/tests/usr.bin/c++/t_call_once2		tests-usr.bin-tests	compattestfile,atf,cxx
@@ -3654,6 +3655,7 @@
 ./usr/tests/usr.bin/cc/t_asan_global_buffer_overflow	tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/cc/t_asan_heap_overflow	tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/cc/t_asan_off_by_one	tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/cc/t_asan_poison		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/cc/t_asan_uaf		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/cmptests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/cmp/Atffile			tests-usr.bin-tests	compattestfile,atf

Index: src/tests/usr.bin/c++/Makefile
diff -u src/tests/usr.bin/c++/Makefile:1.7 src/tests/usr.bin/c++/Makefile:1.8
--- src/tests/usr.bin/c++/Makefile:1.7	Wed Apr  4 23:53:26 2018
+++ src/tests/usr.bin/c++/Makefile	Wed Apr 11 03:25:25 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.7 2018/04/04 23:53:26 kamil Exp $
+# $NetBSD: Makefile,v 1.8 2018/04/11 03:25:25 kamil Exp $
 
 .include 
 
@@ -9,6 +9,7 @@ TESTS_SH+=	t_asan_double_free
 TESTS_SH+=	t_asan_global_buffer_overflow
 TESTS_SH+=	t_asan_heap_overflow
 TESTS_SH+=	t_asan_off_by_one
+TESTS_SH+=	t_asan_poison
 TESTS_SH+=	t_asan_uaf
 TESTS_SH+=	t_call_once
 TESTS_SH+=	t_call_once2

Index: src/tests/usr.bin/cc/Makefile
diff -u src/tests/usr.bin/cc/Makefile:1.2 src/tests/usr.bin/cc/Makefile:1.3
--- src/tests/usr.bin/cc/Makefile:1.2	Wed Apr  4 23:51:35 2018
+++ src/tests/usr.bin/cc/Makefile	Wed Apr 11 03:25:25 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.2 2018/04/04 23:51:35 kamil Exp $
+# $NetBSD: Makefile,v 1.3 2018/04/11 03:25:25 kamil Exp $
 
 .include 
 
@@ -9,6 +9,7 @@ TESTS_SH+=	t_asan_double_free
 TESTS_SH+=	t_asan_global_buffer_overflow
 TESTS_SH+=	t_asan_heap_overflow
 TESTS_SH+=	t_asan_off_by_one
+TESTS_SH+=	t_asan_poison
 TESTS_SH+=	t_asan_uaf
 TESTS_SH+=	t_hello
 

Added files:

Index: src/tests/usr.bin/c++/t_asan_poison.sh
diff -u /dev/null src/tests/usr.bin/c++/t_asan_poison.sh:1.1
--- /dev/null	Wed Apr 11 03:25:25 2018
+++ src/tests/usr.bin/c++/t_asan_poison.sh	Wed Apr 11 03:25:25 2018
@@ -0,0 +1,277 @@
+#	$NetBSD: t_asan_poison.sh,v 1.1 2018/04/11 03:25:25 kamil Exp $
+#
+# Copyright (c) 2018 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Siddharth Muralee.
+#
+# 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 

CVS commit: src

2018-04-10 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Apr 11 03:25:25 UTC 2018

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/usr.bin/c++: Makefile
src/tests/usr.bin/cc: Makefile
Added Files:
src/tests/usr.bin/c++: t_asan_poison.sh
src/tests/usr.bin/cc: t_asan_poison.sh

Log Message:
Import new C and C++ ATF tests for ASan

Add new tests:
 - tests/usr.bin/cc/t_asan_poison.sh
 - tests/usr.bin/c++/t_asan_poison.sh

These tests verify the following build options:
 - regular
 - profile
 - pic
 - pie
 - compat32
 - (static unsupported)

These tests verify whether ASan code can include compiler and sanitizer
specific header: . The testing code checks
the ASAN_POISON_MEMORY_REGION() functionality, poisoning valid memory and
asserting that it triggers expected failure.

Patch submitted by 


To generate a diff of this commit:
cvs rdiff -u -r1.780 -r1.781 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.7 -r1.8 src/tests/usr.bin/c++/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/c++/t_asan_poison.sh
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/cc/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/cc/t_asan_poison.sh

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

2018-04-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Apr 11 03:00:03 UTC 2018

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

Log Message:
ticket #729


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

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

Modified files:

Index: src/doc/CHANGES-8.0
diff -u src/doc/CHANGES-8.0:1.1.2.176 src/doc/CHANGES-8.0:1.1.2.177
--- src/doc/CHANGES-8.0:1.1.2.176	Tue Apr 10 11:49:39 2018
+++ src/doc/CHANGES-8.0	Wed Apr 11 03:00:03 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.0,v 1.1.2.176 2018/04/10 11:49:39 martin Exp $
+# $NetBSD: CHANGES-8.0,v 1.1.2.177 2018/04/11 03:00:03 msaitoh Exp $
 
 A complete list of changes from the initial NetBSD 8.0 branch on 2017-06-04
 until the 8.0 release:
@@ -11207,3 +11207,338 @@ tests/net/if_bridge/t_rtable.sh			1.2
 	Fix bridge_rtdelete and add a test case for it.
 	[ozaki-r, ticket #727]
 
+doc/3RDPARTY	1.1512
+external/bsd/ntp/bin/ntpd/Makefile  up to 1.22
+external/bsd/ntp/dist/ChangeLog up to 1.1.1.13
+external/bsd/ntp/dist/Makefile.am   up to 1.1.1.9
+external/bsd/ntp/dist/Makefile.in   up to 1.1.1.11
+external/bsd/ntp/dist/NEWS  up to 1.1.1.13
+external/bsd/ntp/dist/aclocal.m4up to 1.1.1.11
+external/bsd/ntp/dist/adjtimed/Makefile.in  up to 1.1.1.11
+external/bsd/ntp/dist/clockstuff/Makefile.inup to 1.1.1.11
+external/bsd/ntp/dist/configure up to 1.1.1.13
+external/bsd/ntp/dist/configure.ac  up to 1.1.1.11
+external/bsd/ntp/dist/html/access.html  up to 1.1.1.3
+external/bsd/ntp/dist/html/accopt.html  up to 1.1.1.4
+external/bsd/ntp/dist/html/authentic.html   up to 1.1.1.4
+external/bsd/ntp/dist/html/drivers/driver18.html up to 1.1.1.4
+external/bsd/ntp/dist/html/drivers/driver40-ja.html up to 1.1.1.3
+external/bsd/ntp/dist/html/drivers/driver40.html up to 1.1.1.6
+external/bsd/ntp/dist/html/keygen.html  up to 1.1.1.5
+external/bsd/ntp/dist/html/miscopt.html up to 1.1.1.11
+external/bsd/ntp/dist/html/monopt.html  up to 1.1.1.5
+external/bsd/ntp/dist/html/ntpq.htmlup to 1.1.1.5
+external/bsd/ntp/dist/include/Makefile.in   up to 1.1.1.12
+external/bsd/ntp/dist/include/isc/Makefile.in   up to 1.1.1.11
+external/bsd/ntp/dist/include/ntp.h up to 1.9
+external/bsd/ntp/dist/include/ntp_calendar.hup to 1.7
+external/bsd/ntp/dist/include/ntp_config.h  up to 1.11
+external/bsd/ntp/dist/include/ntp_fp.h  up to 1.10
+external/bsd/ntp/dist/include/ntp_keyacc.h  up to 1.2
+external/bsd/ntp/dist/include/ntp_request.h up to 1.8
+external/bsd/ntp/dist/include/ntp_stdlib.h  up to 1.15
+external/bsd/ntp/dist/include/ntpd.hup to 1.11
+external/bsd/ntp/dist/include/recvbuff.hup to 1.6
+external/bsd/ntp/dist/include/ssl_applink.c up to 1.6
+external/bsd/ntp/dist/kernel/Makefile.inup to 1.1.1.11
+external/bsd/ntp/dist/kernel/sys/Makefile.inup to 1.1.1.11
+external/bsd/ntp/dist/libntp/Makefile.inup to 1.1.1.12
+external/bsd/ntp/dist/libntp/a_md5encrypt.c up to 1.9
+external/bsd/ntp/dist/libntp/adjtime.c  up to 1.5
+external/bsd/ntp/dist/libntp/authkeys.c up to 1.12
+external/bsd/ntp/dist/libntp/authreadkeys.c up to 1.10
+external/bsd/ntp/dist/libntp/libssl_compat.cup to 1.2
+external/bsd/ntp/dist/libntp/ntp_calendar.c up to 1.10
+external/bsd/ntp/dist/libntp/ssl_init.c up to 1.11
+external/bsd/ntp/dist/libntp/statestr.c up to 1.7
+external/bsd/ntp/dist/libntp/systime.c  up to 1.6
+external/bsd/ntp/dist/libntp/work_thread.c  up to 1.6
+external/bsd/ntp/dist/libparse/Makefile.in  up to 1.1.1.11
+external/bsd/ntp/dist/ntpd/Makefile.in  up to 1.1.1.11
+external/bsd/ntp/dist/ntpd/complete.conf.in up to 1.1.1.6
+external/bsd/ntp/dist/ntpd/invoke-ntp.conf.texi up to 1.1.1.11
+external/bsd/ntp/dist/ntpd/invoke-ntp.keys.texi up to 1.1.1.11
+external/bsd/ntp/dist/ntpd/invoke-ntpd.texi up to 1.1.1.11
+external/bsd/ntp/dist/ntpd/keyword-gen-utd  up to 1.1.1.8
+external/bsd/ntp/dist/ntpd/keyword-gen.cup to 1.12
+external/bsd/ntp/dist/ntpd/ntp.conf.5manup to 1.1.1.11
+external/bsd/ntp/dist/ntpd/ntp.conf.5mdoc   up to 1.1.1.11
+external/bsd/ntp/dist/ntpd/ntp.conf.def up to 1.1.1.9
+external/bsd/ntp/dist/ntpd/ntp.conf.htmlup to 1.1.1.11
+external/bsd/ntp/dist/ntpd/ntp.conf.man.in  up to 1.1.1.11
+external/bsd/ntp/dist/ntpd/ntp.conf.mdoc.in up to 1.1.1.11
+external/bsd/ntp/dist/ntpd/ntp.keys.5manup to 1.1.1.11
+external/bsd/ntp/dist/ntpd/ntp.keys.5mdoc   up to 1.1.1.11
+external/bsd/ntp/dist/ntpd/ntp.keys.def up to 1.1.1.4
+external/bsd/ntp/dist/ntpd/ntp.keys.htmlup to 1.1.1.11
+external/bsd/ntp/dist/ntpd/ntp.keys.man.in  up 

CVS commit: [netbsd-8] src/doc

2018-04-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Apr 11 03:00:03 UTC 2018

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

Log Message:
ticket #729


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

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



CVS commit: [netbsd-8] src/external/bsd/ntp

2018-04-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Apr 11 02:58:47 UTC 2018

Modified Files:
src/external/bsd/ntp [netbsd-8]: importdate ntp2netbsd
src/external/bsd/ntp/bin/ntpd [netbsd-8]: Makefile
src/external/bsd/ntp/dist [netbsd-8]: ChangeLog Makefile.am Makefile.in
NEWS aclocal.m4 configure configure.ac packageinfo.sh
src/external/bsd/ntp/dist/adjtimed [netbsd-8]: Makefile.in
src/external/bsd/ntp/dist/clockstuff [netbsd-8]: Makefile.in
src/external/bsd/ntp/dist/html [netbsd-8]: access.html accopt.html
authentic.html keygen.html miscopt.html monopt.html ntpq.html
src/external/bsd/ntp/dist/html/drivers [netbsd-8]: driver18.html
driver40-ja.html driver40.html
src/external/bsd/ntp/dist/include [netbsd-8]: Makefile.in ntp.h
ntp_calendar.h ntp_config.h ntp_fp.h ntp_keyacc.h ntp_request.h
ntp_stdlib.h ntpd.h recvbuff.h ssl_applink.c
src/external/bsd/ntp/dist/include/isc [netbsd-8]: Makefile.in
src/external/bsd/ntp/dist/kernel [netbsd-8]: Makefile.in
src/external/bsd/ntp/dist/kernel/sys [netbsd-8]: Makefile.in
src/external/bsd/ntp/dist/libntp [netbsd-8]: Makefile.in a_md5encrypt.c
adjtime.c authkeys.c authreadkeys.c libssl_compat.c ntp_calendar.c
ssl_init.c statestr.c systime.c work_thread.c
src/external/bsd/ntp/dist/libparse [netbsd-8]: Makefile.in
src/external/bsd/ntp/dist/ntpd [netbsd-8]: Makefile.in complete.conf.in
invoke-ntp.conf.texi invoke-ntp.keys.texi invoke-ntpd.texi
keyword-gen-utd keyword-gen.c ntp.conf.5man ntp.conf.5mdoc
ntp.conf.def ntp.conf.html ntp.conf.man.in ntp.conf.mdoc.in
ntp.keys.5man ntp.keys.5mdoc ntp.keys.def ntp.keys.html
ntp.keys.man.in ntp.keys.mdoc.in ntp_config.c ntp_control.c
ntp_crypto.c ntp_io.c ntp_keyword.h ntp_leapsec.c ntp_parser.y
ntp_peer.c ntp_proto.c ntp_refclock.c ntp_request.c ntp_restrict.c
ntp_scanner.c ntp_util.c ntpd-opts.c ntpd-opts.h ntpd.1ntpdman
ntpd.1ntpdmdoc ntpd.c ntpd.html ntpd.man.in ntpd.mdoc.in ntpsim.c
refclock_gpsdjson.c refclock_jjy.c refclock_oncore.c
refclock_palisade.c refclock_parse.c
src/external/bsd/ntp/dist/ntpdate [netbsd-8]: Makefile.in
src/external/bsd/ntp/dist/ntpdc [netbsd-8]: Makefile.in
invoke-ntpdc.texi layout.std ntpdc-opts.c ntpdc-opts.h
ntpdc.1ntpdcman ntpdc.1ntpdcmdoc ntpdc.c ntpdc.html ntpdc.man.in
ntpdc.mdoc.in ntpdc_ops.c
src/external/bsd/ntp/dist/ntpq [netbsd-8]: Makefile.am Makefile.in
invoke-ntpq.texi ntpq-opts.c ntpq-opts.def ntpq-opts.h ntpq-subs.c
ntpq.1ntpqman ntpq.1ntpqmdoc ntpq.c ntpq.html ntpq.man.in
ntpq.mdoc.in ntpq.texi
src/external/bsd/ntp/dist/ntpsnmpd [netbsd-8]: Makefile.in
invoke-ntpsnmpd.texi netsnmp_daemonize.c ntpsnmpd-opts.c
ntpsnmpd-opts.h ntpsnmpd.1ntpsnmpdman ntpsnmpd.1ntpsnmpdmdoc
ntpsnmpd.html ntpsnmpd.man.in ntpsnmpd.mdoc.in
src/external/bsd/ntp/dist/parseutil [netbsd-8]: Makefile.in
src/external/bsd/ntp/dist/scripts [netbsd-8]: Makefile.in
invoke-plot_summary.texi invoke-summary.texi plot_summary-opts
plot_summary.1plot_summaryman plot_summary.1plot_summarymdoc
plot_summary.html plot_summary.man.in plot_summary.mdoc.in
summary-opts summary.1summaryman summary.1summarymdoc summary.html
summary.man.in summary.mdoc.in
src/external/bsd/ntp/dist/scripts/build [netbsd-8]: Makefile.in
UpdatePoint
src/external/bsd/ntp/dist/scripts/calc_tickadj [netbsd-8]: Makefile.in
calc_tickadj.1calc_tickadjman calc_tickadj.1calc_tickadjmdoc
calc_tickadj.html calc_tickadj.man.in calc_tickadj.mdoc.in
invoke-calc_tickadj.texi
src/external/bsd/ntp/dist/scripts/lib [netbsd-8]: Makefile.in
src/external/bsd/ntp/dist/scripts/ntp-wait [netbsd-8]: Makefile.in
invoke-ntp-wait.texi ntp-wait-opts ntp-wait.1ntp-waitman
ntp-wait.1ntp-waitmdoc ntp-wait.html ntp-wait.man.in
ntp-wait.mdoc.in
src/external/bsd/ntp/dist/scripts/ntpsweep [netbsd-8]: Makefile.in
invoke-ntpsweep.texi ntpsweep-opts ntpsweep.1ntpsweepman
ntpsweep.1ntpsweepmdoc ntpsweep.html ntpsweep.man.in
ntpsweep.mdoc.in
src/external/bsd/ntp/dist/scripts/ntptrace [netbsd-8]: Makefile.in
invoke-ntptrace.texi ntptrace-opts ntptrace.1ntptraceman
ntptrace.1ntptracemdoc ntptrace.html ntptrace.man.in
ntptrace.mdoc.in
src/external/bsd/ntp/dist/scripts/update-leap [netbsd-8]: Makefile.in
invoke-update-leap.texi update-leap-opts
update-leap.1update-leapman update-leap.1update-leapmdoc

CVS commit: [netbsd-8] src/external/bsd/ntp

2018-04-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Apr 11 02:58:47 UTC 2018

Modified Files:
src/external/bsd/ntp [netbsd-8]: importdate ntp2netbsd
src/external/bsd/ntp/bin/ntpd [netbsd-8]: Makefile
src/external/bsd/ntp/dist [netbsd-8]: ChangeLog Makefile.am Makefile.in
NEWS aclocal.m4 configure configure.ac packageinfo.sh
src/external/bsd/ntp/dist/adjtimed [netbsd-8]: Makefile.in
src/external/bsd/ntp/dist/clockstuff [netbsd-8]: Makefile.in
src/external/bsd/ntp/dist/html [netbsd-8]: access.html accopt.html
authentic.html keygen.html miscopt.html monopt.html ntpq.html
src/external/bsd/ntp/dist/html/drivers [netbsd-8]: driver18.html
driver40-ja.html driver40.html
src/external/bsd/ntp/dist/include [netbsd-8]: Makefile.in ntp.h
ntp_calendar.h ntp_config.h ntp_fp.h ntp_keyacc.h ntp_request.h
ntp_stdlib.h ntpd.h recvbuff.h ssl_applink.c
src/external/bsd/ntp/dist/include/isc [netbsd-8]: Makefile.in
src/external/bsd/ntp/dist/kernel [netbsd-8]: Makefile.in
src/external/bsd/ntp/dist/kernel/sys [netbsd-8]: Makefile.in
src/external/bsd/ntp/dist/libntp [netbsd-8]: Makefile.in a_md5encrypt.c
adjtime.c authkeys.c authreadkeys.c libssl_compat.c ntp_calendar.c
ssl_init.c statestr.c systime.c work_thread.c
src/external/bsd/ntp/dist/libparse [netbsd-8]: Makefile.in
src/external/bsd/ntp/dist/ntpd [netbsd-8]: Makefile.in complete.conf.in
invoke-ntp.conf.texi invoke-ntp.keys.texi invoke-ntpd.texi
keyword-gen-utd keyword-gen.c ntp.conf.5man ntp.conf.5mdoc
ntp.conf.def ntp.conf.html ntp.conf.man.in ntp.conf.mdoc.in
ntp.keys.5man ntp.keys.5mdoc ntp.keys.def ntp.keys.html
ntp.keys.man.in ntp.keys.mdoc.in ntp_config.c ntp_control.c
ntp_crypto.c ntp_io.c ntp_keyword.h ntp_leapsec.c ntp_parser.y
ntp_peer.c ntp_proto.c ntp_refclock.c ntp_request.c ntp_restrict.c
ntp_scanner.c ntp_util.c ntpd-opts.c ntpd-opts.h ntpd.1ntpdman
ntpd.1ntpdmdoc ntpd.c ntpd.html ntpd.man.in ntpd.mdoc.in ntpsim.c
refclock_gpsdjson.c refclock_jjy.c refclock_oncore.c
refclock_palisade.c refclock_parse.c
src/external/bsd/ntp/dist/ntpdate [netbsd-8]: Makefile.in
src/external/bsd/ntp/dist/ntpdc [netbsd-8]: Makefile.in
invoke-ntpdc.texi layout.std ntpdc-opts.c ntpdc-opts.h
ntpdc.1ntpdcman ntpdc.1ntpdcmdoc ntpdc.c ntpdc.html ntpdc.man.in
ntpdc.mdoc.in ntpdc_ops.c
src/external/bsd/ntp/dist/ntpq [netbsd-8]: Makefile.am Makefile.in
invoke-ntpq.texi ntpq-opts.c ntpq-opts.def ntpq-opts.h ntpq-subs.c
ntpq.1ntpqman ntpq.1ntpqmdoc ntpq.c ntpq.html ntpq.man.in
ntpq.mdoc.in ntpq.texi
src/external/bsd/ntp/dist/ntpsnmpd [netbsd-8]: Makefile.in
invoke-ntpsnmpd.texi netsnmp_daemonize.c ntpsnmpd-opts.c
ntpsnmpd-opts.h ntpsnmpd.1ntpsnmpdman ntpsnmpd.1ntpsnmpdmdoc
ntpsnmpd.html ntpsnmpd.man.in ntpsnmpd.mdoc.in
src/external/bsd/ntp/dist/parseutil [netbsd-8]: Makefile.in
src/external/bsd/ntp/dist/scripts [netbsd-8]: Makefile.in
invoke-plot_summary.texi invoke-summary.texi plot_summary-opts
plot_summary.1plot_summaryman plot_summary.1plot_summarymdoc
plot_summary.html plot_summary.man.in plot_summary.mdoc.in
summary-opts summary.1summaryman summary.1summarymdoc summary.html
summary.man.in summary.mdoc.in
src/external/bsd/ntp/dist/scripts/build [netbsd-8]: Makefile.in
UpdatePoint
src/external/bsd/ntp/dist/scripts/calc_tickadj [netbsd-8]: Makefile.in
calc_tickadj.1calc_tickadjman calc_tickadj.1calc_tickadjmdoc
calc_tickadj.html calc_tickadj.man.in calc_tickadj.mdoc.in
invoke-calc_tickadj.texi
src/external/bsd/ntp/dist/scripts/lib [netbsd-8]: Makefile.in
src/external/bsd/ntp/dist/scripts/ntp-wait [netbsd-8]: Makefile.in
invoke-ntp-wait.texi ntp-wait-opts ntp-wait.1ntp-waitman
ntp-wait.1ntp-waitmdoc ntp-wait.html ntp-wait.man.in
ntp-wait.mdoc.in
src/external/bsd/ntp/dist/scripts/ntpsweep [netbsd-8]: Makefile.in
invoke-ntpsweep.texi ntpsweep-opts ntpsweep.1ntpsweepman
ntpsweep.1ntpsweepmdoc ntpsweep.html ntpsweep.man.in
ntpsweep.mdoc.in
src/external/bsd/ntp/dist/scripts/ntptrace [netbsd-8]: Makefile.in
invoke-ntptrace.texi ntptrace-opts ntptrace.1ntptraceman
ntptrace.1ntptracemdoc ntptrace.html ntptrace.man.in
ntptrace.mdoc.in
src/external/bsd/ntp/dist/scripts/update-leap [netbsd-8]: Makefile.in
invoke-update-leap.texi update-leap-opts
update-leap.1update-leapman update-leap.1update-leapmdoc

CVS commit: src/tests/lib/libc/sys

2018-04-10 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Apr 11 01:52:59 UTC 2018

Modified Files:
src/tests/lib/libc/sys: t_ptrace_wait.c

Log Message:
Cover more fork/vfork/vforkdone scenarios in ATF ptrace(2) tests

Use a shared common body for all the tests: fork1..fork8, vfork1..vfork8.

Merge vforkdone1 and vforkdone2 into vfork* tests.

All the (v?)fork[1-8] tests cover:
 - calling either fork(2) or vfork(2)
 - tracking either enabled or disabled FORK, VFORK or VFORK_DONE

All the PTRACE_VFORK tests are marked as expected failure.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/tests/lib/libc/sys/t_ptrace_wait.c

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

Modified files:

Index: src/tests/lib/libc/sys/t_ptrace_wait.c
diff -u src/tests/lib/libc/sys/t_ptrace_wait.c:1.30 src/tests/lib/libc/sys/t_ptrace_wait.c:1.31
--- src/tests/lib/libc/sys/t_ptrace_wait.c:1.30	Tue Apr 10 22:45:39 2018
+++ src/tests/lib/libc/sys/t_ptrace_wait.c	Wed Apr 11 01:52:59 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_wait.c,v 1.30 2018/04/10 22:45:39 kamil Exp $	*/
+/*	$NetBSD: t_ptrace_wait.c,v 1.31 2018/04/11 01:52:59 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_ptrace_wait.c,v 1.30 2018/04/10 22:45:39 kamil Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.31 2018/04/11 01:52:59 kamil Exp $");
 
 #include 
 #include 
@@ -1328,7 +1328,7 @@ fork_test(pid_t (*fn)(void), bool trackf
 	const int exitval = 5;
 	const int exitval2 = 15;
 	const int sigval = SIGSTOP;
-	pid_t child, child2, wpid;
+	pid_t child, child2 = 0, wpid;
 #if defined(TWAIT_HAVE_STATUS)
 	int status;
 #endif
@@ -1388,7 +1388,7 @@ fork_test(pid_t (*fn)(void), bool trackf
 	SYSCALL_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
 
 #if defined(TWAIT_HAVE_PID)
-	if (trackfork || trackvfork) {
+	if ((trackfork && fn == fork) || (trackvfork && fn == vfork)) {
 		DPRINTF("Before calling %s() for the child %d\n", TWAIT_FNAME,
 		child);
 		TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, , 0),
@@ -1398,11 +1398,11 @@ fork_test(pid_t (*fn)(void), bool trackf
 
 		SYSCALL_REQUIRE(ptrace(PT_GET_PROCESS_STATE, child, ,
 		   slen) != -1);
-		if (trackfork) {
+		if (trackfork && fn == fork) {
 			ATF_REQUIRE_EQ(state.pe_report_event & PTRACE_FORK,
 			   PTRACE_FORK);
 		}
-		if (trackvfork) {
+		if (trackvfork && fn == vfork) {
 			ATF_REQUIRE_EQ(state.pe_report_event & PTRACE_VFORK,
 			   PTRACE_VFORK);
 		}
@@ -1419,11 +1419,11 @@ fork_test(pid_t (*fn)(void), bool trackf
 
 		SYSCALL_REQUIRE(ptrace(PT_GET_PROCESS_STATE, child2, ,
 		   slen) != -1);
-		if (trackfork) {
+		if (trackfork && fn == fork) {
 			ATF_REQUIRE_EQ(state.pe_report_event & PTRACE_FORK,
 			   PTRACE_FORK);
 		}
-		if (trackvfork) {
+		if (trackvfork && fn == vfork) {
 			ATF_REQUIRE_EQ(state.pe_report_event & PTRACE_VFORK,
 			   PTRACE_VFORK);
 		}
@@ -1441,7 +1441,7 @@ fork_test(pid_t (*fn)(void), bool trackf
 	}
 #endif
 
-	if (trackvforkdone) {
+	if (trackvforkdone && fn == vfork) {
 		DPRINTF("Before calling %s() for the child %d\n", TWAIT_FNAME,
 		child);
 		TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, , 0),
@@ -1463,7 +1463,7 @@ fork_test(pid_t (*fn)(void), bool trackf
 	}
 
 #if defined(TWAIT_HAVE_PID)
-	if (trackfork || trackvfork) {
+	if ((trackfork && fn == fork) || (trackvfork && fn == vfork)) {
 		DPRINTF("Before calling %s() for the forkee - expected exited"
 		"\n", TWAIT_FNAME);
 		TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child2, , 0),
@@ -1499,93 +1499,254 @@ fork_test(pid_t (*fn)(void), bool trackf
 	TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, , 0));
 }
 
-#if defined(TWAIT_HAVE_PID)
 ATF_TC(fork1);
 ATF_TC_HEAD(fork1, tc)
 {
 	atf_tc_set_md_var(tc, "descr",
-	"Verify that fork(2) is intercepted by ptrace(2) with EVENT_MASK "
-	"set to PTRACE_FORK");
+	"Verify that fork(2) is not intercepted by ptrace(2) with empty "
+	"EVENT_MASK");
 }
 
 ATF_TC_BODY(fork1, tc)
 {
 
-	fork_test(fork, true, false, false);
+	fork_test(fork, false, false, false);
 }
-#endif
 
+#if defined(TWAIT_HAVE_PID)
 ATF_TC(fork2);
 ATF_TC_HEAD(fork2, tc)
 {
 	atf_tc_set_md_var(tc, "descr",
-	"Verify that fork(2) is not intercepted by ptrace(2) with empty "
-	"EVENT_MASK");
+	"Verify that fork(2) is intercepted by ptrace(2) with EVENT_MASK "
+	"set to PTRACE_FORK");
 }
 
 ATF_TC_BODY(fork2, tc)
 {
 
-	fork_test(fork, false, false, false);
+	fork_test(fork, true, false, false);
 }
+#endif
+
+#if defined(TWAIT_HAVE_PID)
+ATF_TC(fork3);
+ATF_TC_HEAD(fork3, tc)
+{
+	atf_tc_set_md_var(tc, "descr",
+	"Verify that fork(2) is not intercepted by ptrace(2) with "
+	"EVENT_MASK set to PTRACE_VFORK");
+}
+
+ATF_TC_BODY(fork3, tc)
+{
+
+	fork_test(fork, false, true, false);
+}

CVS commit: src/tests/lib/libc/sys

2018-04-10 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Apr 11 01:52:59 UTC 2018

Modified Files:
src/tests/lib/libc/sys: t_ptrace_wait.c

Log Message:
Cover more fork/vfork/vforkdone scenarios in ATF ptrace(2) tests

Use a shared common body for all the tests: fork1..fork8, vfork1..vfork8.

Merge vforkdone1 and vforkdone2 into vfork* tests.

All the (v?)fork[1-8] tests cover:
 - calling either fork(2) or vfork(2)
 - tracking either enabled or disabled FORK, VFORK or VFORK_DONE

All the PTRACE_VFORK tests are marked as expected failure.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/tests/lib/libc/sys/t_ptrace_wait.c

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



CVS commit: src/external/bsd/ntp/scripts

2018-04-10 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Apr 11 00:35:14 UTC 2018

Modified Files:
src/external/bsd/ntp/scripts: mkver

Log Message:
fix ntp version some more


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/external/bsd/ntp/scripts/mkver

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



CVS commit: src/external/bsd/ntp/scripts

2018-04-10 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Apr 11 00:35:14 UTC 2018

Modified Files:
src/external/bsd/ntp/scripts: mkver

Log Message:
fix ntp version some more


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/external/bsd/ntp/scripts/mkver

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

Modified files:

Index: src/external/bsd/ntp/scripts/mkver
diff -u src/external/bsd/ntp/scripts/mkver:1.13 src/external/bsd/ntp/scripts/mkver:1.14
--- src/external/bsd/ntp/scripts/mkver:1.13	Thu Apr 13 20:17:43 2017
+++ src/external/bsd/ntp/scripts/mkver	Wed Apr 11 00:35:14 2018
@@ -3,7 +3,7 @@ PROG=${1-UNKNOWN}
 
 ConfStr="$PROG"
 
-ConfStr="$ConfStr 4.2.8p10"
+ConfStr="$ConfStr 4.2.8p11"
 
 case "$CSET" in
  '') ;;



CVS commit: src

2018-04-10 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Apr 11 00:26:38 UTC 2018

Modified Files:
src/distrib/sets/lists/base: rescue.mi
src/rescue: list

Log Message:
Add progress(1) into /rescue.

No objection when proposed on tech-userlevel@.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/distrib/sets/lists/base/rescue.mi
cvs rdiff -u -r1.48 -r1.49 src/rescue/list

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



CVS commit: src

2018-04-10 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Apr 11 00:26:38 UTC 2018

Modified Files:
src/distrib/sets/lists/base: rescue.mi
src/rescue: list

Log Message:
Add progress(1) into /rescue.

No objection when proposed on tech-userlevel@.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/distrib/sets/lists/base/rescue.mi
cvs rdiff -u -r1.48 -r1.49 src/rescue/list

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

Modified files:

Index: src/distrib/sets/lists/base/rescue.mi
diff -u src/distrib/sets/lists/base/rescue.mi:1.40 src/distrib/sets/lists/base/rescue.mi:1.41
--- src/distrib/sets/lists/base/rescue.mi:1.40	Sun May 21 15:28:37 2017
+++ src/distrib/sets/lists/base/rescue.mi	Wed Apr 11 00:26:38 2018
@@ -1,4 +1,4 @@
-# $NetBSD: rescue.mi,v 1.40 2017/05/21 15:28:37 riastradh Exp $
+# $NetBSD: rescue.mi,v 1.41 2018/04/11 00:26:38 rin Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -111,6 +111,7 @@
 ./rescue/ping	base-rescue-root
 ./rescue/ping6	base-rescue-root	use_inet6
 ./rescue/pppoectlbase-rescue-root
+./rescue/progressbase-rescue-root
 ./rescue/ps	base-rescue-root
 ./rescue/pwd	base-rescue-root
 ./rescue/raidctlbase-rescue-root

Index: src/rescue/list
diff -u src/rescue/list:1.48 src/rescue/list:1.49
--- src/rescue/list:1.48	Thu Aug  4 03:50:55 2016
+++ src/rescue/list	Wed Apr 11 00:26:38 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: list,v 1.48 2016/08/04 03:50:55 pgoyette Exp $
+#	$NetBSD: list,v 1.49 2018/04/11 00:26:38 rin Exp $
 
 SRCDIRS	bin
 
@@ -128,6 +128,7 @@ PROG	gzip		gunzip gzcat zcat 
 PROG	kdump
 PROG	ktrace
 PROG	ktruss
+PROG	progress
 
 PROG	ekermit
 SPECIAL	ekermit		srcdir	external/bsd/ekermit/bin/ekermit



CVS commit: src/doc

2018-04-10 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Apr 10 22:58:54 UTC 2018

Modified Files:
src/doc: CHANGES

Log Message:
fix ntp version


To generate a diff of this commit:
cvs rdiff -u -r1.2377 -r1.2378 src/doc/CHANGES

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2377 src/doc/CHANGES:1.2378
--- src/doc/CHANGES:1.2377	Sun Apr  8 10:56:05 2018
+++ src/doc/CHANGES	Tue Apr 10 22:58:54 2018
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2377 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2378 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -135,7 +135,7 @@ Changes from NetBSD 8.0 to NetBSD 9.0:
 	dhcpcd: Import 7.0.3. [roy 20180406]
 	OpenSSH: Imported 7.7. [christos 20180406]
 	OpenSSL: Imported 1.1.0h. [christos 20180406]
-	ntp: Import ntp 4.2.8p10. [christos 20180406]
+	ntp: Import ntp 4.2.8p11. [christos 20180406]
 	acpi(4): Updated ACPICA to 20180313. [christos 20180407]
 	dhcp: Import version 4.4.1 (move to MPL). [christos 20180407]
 	bind: Import version 9.10.7. [christos 20180407]



CVS commit: src/doc

2018-04-10 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Apr 10 22:58:54 UTC 2018

Modified Files:
src/doc: CHANGES

Log Message:
fix ntp version


To generate a diff of this commit:
cvs rdiff -u -r1.2377 -r1.2378 src/doc/CHANGES

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



CVS commit: src/tests/lib/libc/sys

2018-04-10 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Tue Apr 10 22:45:39 UTC 2018

Modified Files:
src/tests/lib/libc/sys: t_ptrace_wait.c

Log Message:
ATF t_ptrace_wait* refactoring: vforkdone1 and vforkdone2

Merge vforkdone1 and vforkdone2 into other fork tests and reuse the same
function body fork_test().

There is an implicit enhancement in vforkdone2 that it was skipping
PTRACE_VFORK check. This test is now marked as expected failure.

PR kern/51630

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/tests/lib/libc/sys/t_ptrace_wait.c

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



CVS commit: src/tests/lib/libc/sys

2018-04-10 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Tue Apr 10 22:45:39 UTC 2018

Modified Files:
src/tests/lib/libc/sys: t_ptrace_wait.c

Log Message:
ATF t_ptrace_wait* refactoring: vforkdone1 and vforkdone2

Merge vforkdone1 and vforkdone2 into other fork tests and reuse the same
function body fork_test().

There is an implicit enhancement in vforkdone2 that it was skipping
PTRACE_VFORK check. This test is now marked as expected failure.

PR kern/51630

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/tests/lib/libc/sys/t_ptrace_wait.c

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

Modified files:

Index: src/tests/lib/libc/sys/t_ptrace_wait.c
diff -u src/tests/lib/libc/sys/t_ptrace_wait.c:1.29 src/tests/lib/libc/sys/t_ptrace_wait.c:1.30
--- src/tests/lib/libc/sys/t_ptrace_wait.c:1.29	Tue Apr 10 00:40:35 2018
+++ src/tests/lib/libc/sys/t_ptrace_wait.c	Tue Apr 10 22:45:39 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_wait.c,v 1.29 2018/04/10 00:40:35 kamil Exp $	*/
+/*	$NetBSD: t_ptrace_wait.c,v 1.30 2018/04/10 22:45:39 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_ptrace_wait.c,v 1.29 2018/04/10 00:40:35 kamil Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.30 2018/04/10 22:45:39 kamil Exp $");
 
 #include 
 #include 
@@ -1322,7 +1322,8 @@ ATF_TC_BODY(eventmask6, tc)
 }
 
 static void
-fork_test(bool regular, bool track_event)
+fork_test(pid_t (*fn)(void), bool trackfork, bool trackvfork,
+  bool trackvforkdone)
 {
 	const int exitval = 5;
 	const int exitval2 = 15;
@@ -1331,14 +1332,12 @@ fork_test(bool regular, bool track_event
 #if defined(TWAIT_HAVE_STATUS)
 	int status;
 #endif
-#if defined(TWAIT_HAVE_PID)
 	ptrace_state_t state;
 	const int slen = sizeof(state);
-#endif
 	ptrace_event_t event;
 	const int elen = sizeof(event);
 
-	if (!regular && track_event) {
+	if (trackvfork) {
 		atf_tc_expect_fail("PR kern/51630");
 	}
 
@@ -1351,7 +1350,7 @@ fork_test(bool regular, bool track_event
 		DPRINTF("Before raising %s from child\n", strsignal(sigval));
 		FORKEE_ASSERT(raise(sigval) == 0);
 
-		FORKEE_ASSERT((child2 = (regular ? fork() : vfork())) != -1);
+		FORKEE_ASSERT((child2 = (fn)()) != -1);
 
 		if (child2 == 0)
 			_exit(exitval2);
@@ -1371,25 +1370,25 @@ fork_test(bool regular, bool track_event
 
 	validate_status_stopped(status, sigval);
 
-	DPRINTF("%s PTRACE_%sFORK in EVENT_MASK for the child %d\n",
-	track_event ? "Enable" : "Disable", regular ? "" : "V", child);
-	event.pe_set_event = track_event ? (regular ? PTRACE_FORK : PTRACE_VFORK) : 0;
+	DPRINTF("Set 0%s%s%s in EVENT_MASK for the child %d\n",
+	trackfork ? "|PTRACE_FORK" : "",
+	trackvfork ? "|PTRACE_VFORK" : "",
+	trackvforkdone ? "|PTRACE_VFORK_DONE" : "", child);
+	event.pe_set_event = 0;
+	if (trackfork)
+		event.pe_set_event |= PTRACE_FORK;
+	if (trackvfork)
+		event.pe_set_event |= PTRACE_VFORK;
+	if (trackvforkdone)
+		event.pe_set_event |= PTRACE_VFORK_DONE;
 	SYSCALL_REQUIRE(ptrace(PT_SET_EVENT_MASK, child, , elen) != -1);
 
 	DPRINTF("Before resuming the child process where it left off and "
 	"without signal to be sent\n");
-	if (track_event) {
-	DPRINTF("We expect two SIGTRAP events, for child %d "
-	"(TRAP_CHLD, pe_report_event=PTRACE_%sFORK, "
-		"state.pe_other_pid=child2) and for child2 "
-	"(TRAP_CHLD, pe_report_event=PTRACE_%sFORK, "
-	"state.pe_other_pid=child)\n", child,
-		regular ? "" : "V", regular ? "" : "V");
-	}
 	SYSCALL_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
 
 #if defined(TWAIT_HAVE_PID)
-	if (track_event) {
+	if (trackfork || trackvfork) {
 		DPRINTF("Before calling %s() for the child %d\n", TWAIT_FNAME,
 		child);
 		TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, , 0),
@@ -1399,12 +1398,17 @@ fork_test(bool regular, bool track_event
 
 		SYSCALL_REQUIRE(ptrace(PT_GET_PROCESS_STATE, child, ,
 		   slen) != -1);
-		ATF_REQUIRE_EQ(state.pe_report_event,
-		   regular ? PTRACE_FORK : PTRACE_VFORK);
+		if (trackfork) {
+			ATF_REQUIRE_EQ(state.pe_report_event & PTRACE_FORK,
+			   PTRACE_FORK);
+		}
+		if (trackvfork) {
+			ATF_REQUIRE_EQ(state.pe_report_event & PTRACE_VFORK,
+			   PTRACE_VFORK);
+		}
 
 		child2 = state.pe_other_pid;
-		DPRINTF("Reported PTRACE_%sFORK event with forkee %d\n",
-		regular ? "" : "V", child2);
+		DPRINTF("Reported ptrace event with forkee %d\n", child2);
 
 		DPRINTF("Before calling %s() for the forkee %d of the child "
 		"%d\n", TWAIT_FNAME, child2, child);
@@ -1415,8 +1419,15 @@ fork_test(bool regular, bool track_event
 
 		SYSCALL_REQUIRE(ptrace(PT_GET_PROCESS_STATE, child2, ,
 		   slen) != -1);
-		ATF_REQUIRE_EQ(state.pe_report_event,
-		   

CVS commit: src/sbin/dmesg

2018-04-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr 10 22:21:52 UTC 2018

Modified Files:
src/sbin/dmesg: dmesg.8 dmesg.c

Log Message:
match the linux dmesg flags.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sbin/dmesg/dmesg.8
cvs rdiff -u -r1.30 -r1.31 src/sbin/dmesg/dmesg.c

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



CVS commit: src/sbin/dmesg

2018-04-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr 10 22:21:52 UTC 2018

Modified Files:
src/sbin/dmesg: dmesg.8 dmesg.c

Log Message:
match the linux dmesg flags.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sbin/dmesg/dmesg.8
cvs rdiff -u -r1.30 -r1.31 src/sbin/dmesg/dmesg.c

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

Modified files:

Index: src/sbin/dmesg/dmesg.8
diff -u src/sbin/dmesg/dmesg.8:1.18 src/sbin/dmesg/dmesg.8:1.19
--- src/sbin/dmesg/dmesg.8:1.18	Sun Apr  1 15:31:16 2018
+++ src/sbin/dmesg/dmesg.8	Tue Apr 10 18:21:52 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: dmesg.8,v 1.18 2018/04/01 19:31:16 christos Exp $
+.\"	$NetBSD: dmesg.8,v 1.19 2018/04/10 22:21:52 christos Exp $
 .\"
 .\" Copyright (c) 1980, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\" @(#)dmesg.8	8.1 (Berkeley) 6/5/93
 .\"
-.Dd March 31, 2018
+.Dd April 10, 2018
 .Dt DMESG 8
 .Os
 .Sh NAME
@@ -37,7 +37,7 @@
 .Nd "display the system message buffer"
 .Sh SYNOPSIS
 .Nm
-.Op Fl qt
+.Op Fl dtT
 .Op Fl M Ar core
 .Op Fl N Ar system
 .Sh DESCRIPTION
@@ -46,16 +46,22 @@ displays the contents of the system mess
 .Pp
 The options are as follows:
 .Bl -tag -width Ds
+.It Fl d
+Show just the timestamp deltas.
+Used together with
+.Fl t
+only the deltas are shown.
 .It Fl M
 Extract values associated with the name list from the specified core
 instead of the default ``/dev/mem''.
 .It Fl N
 Extract the name list from the specified system instead of the default
 ``/netbsd''.
-.It Fl q
-Quiet printing, don't print timestamps.
+.It Fl T
+Format uptime timestamps in a human readable form (using
+.Xr ctime 3 ).
 .It Fl t
-Format uptime timestamps in a human readable form.
+Quiet printing, don't print timestamps.
 .El
 .Pp
 The system message buffer is a circular buffer of a fixed size.

Index: src/sbin/dmesg/dmesg.c
diff -u src/sbin/dmesg/dmesg.c:1.30 src/sbin/dmesg/dmesg.c:1.31
--- src/sbin/dmesg/dmesg.c:1.30	Sun Apr  1 21:15:31 2018
+++ src/sbin/dmesg/dmesg.c	Tue Apr 10 18:21:52 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: dmesg.c,v 1.30 2018/04/02 01:15:31 christos Exp $	*/
+/*	$NetBSD: dmesg.c,v 1.31 2018/04/10 22:21:52 christos Exp $	*/
 /*-
  * Copyright (c) 1991, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -38,7 +38,7 @@ __COPYRIGHT("@(#) Copyright (c) 1991, 19
 #if 0
 static char sccsid[] = "@(#)dmesg.c	8.1 (Berkeley) 6/5/93";
 #else
-__RCSID("$NetBSD: dmesg.c,v 1.30 2018/04/02 01:15:31 christos Exp $");
+__RCSID("$NetBSD: dmesg.c,v 1.31 2018/04/10 22:21:52 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -82,31 +82,39 @@ main(int argc, char *argv[])
 	char tbuf[64];
 	char *memf, *nlistf;
 	struct timeval boottime;
-	int ptime = 0;
+	struct timespec lasttime;
+	intmax_t sec;
+	long nsec;
+	int deltas, quiet, humantime;
 	
 	static const int bmib[] = { CTL_KERN, KERN_BOOTTIME };
 	size = sizeof(boottime);
 
 	boottime.tv_sec = 0;
 	boottime.tv_usec = 0;
-	ptime = 0;
+	lasttime.tv_sec = 0;
+	lasttime.tv_nsec = 0;
+	deltas = quiet = humantime = 0;
 
 (void)sysctl(bmib, 2, , , NULL, 0);
 
 	memf = nlistf = NULL;
-	while ((ch = getopt(argc, argv, "M:N:qt")) != -1)
+	while ((ch = getopt(argc, argv, "dM:N:tT")) != -1)
 		switch(ch) {
+		case 'd':
+			deltas = 1;
+			break;
 		case 'M':
 			memf = optarg;
 			break;
 		case 'N':
 			nlistf = optarg;
 			break;
-		case 'q':
-			ptime = -1;
-			break;
 		case 't':
-			ptime = 1;
+			quiet = 1;
+			break;
+		case 'T':
+			humantime = 1;
 			break;
 		case '?':
 		default:
@@ -114,6 +122,8 @@ main(int argc, char *argv[])
 		}
 	argc -= optind;
 	argv += optind;
+	if (quiet && humantime)
+		err(EXIT_FAILURE, "-t cannot be used with -T");
 
 	if (memf == NULL) {
 #endif
@@ -207,23 +217,35 @@ main(int argc, char *argv[])
 ADDC('\0');
 tstamp = 0;
 #ifndef SMALL
-if (ptime == 1) {
-	intmax_t sec;
+sscanf(tbuf, "[%jd.%ld]", , );
+if (!quiet || deltas)
+	printf("[");
+if (humantime) {
 	time_t t;
-	long nsec;
 	struct tm tm;
-
-	sscanf(tbuf, "[%jd.%ld]", , );
 	t = boottime.tv_sec + sec;
 	if (localtime_r(, ) != NULL) {
 		strftime(tbuf, sizeof(tbuf),
-		"[%a %b %e %H:%M:%S %Z %Y]",
+		"%a %b %e %H:%M:%S %Z %Y",
 		 );
-		printf("%s ", tbuf);
+		printf("%s", tbuf);
 	}
-	continue;
-} else if (ptime != -1)
-	printf("%s ", tbuf);
+} else if (!quiet) {
+	printf("% 9jd.%06ld",
+	sec, nsec / 1000);
+}
+if (deltas) {
+	struct timespec nt = { sec, nsec };
+	struct timespec dt;
+	timespecsub(, , );
+	if (humantime || !quiet)
+		printf(" ");
+	printf("<% 4jd.%06ld>", (intmax_t)
+	dt.tv_sec, dt.tv_nsec / 1000);
+	lasttime = nt;
+}
+if (!quiet || deltas)
+	printf("] ");
 #endif
 continue;
 			case ' ':



CVS commit: [netbsd-6] src/doc

2018-04-10 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Apr 10 17:45:27 UTC 2018

Modified Files:
src/doc [netbsd-6]: CHANGES-6.2

Log Message:
1528


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.333 -r1.1.2.334 src/doc/CHANGES-6.2

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-6.2
diff -u src/doc/CHANGES-6.2:1.1.2.333 src/doc/CHANGES-6.2:1.1.2.334
--- src/doc/CHANGES-6.2:1.1.2.333	Tue Apr 10 11:28:34 2018
+++ src/doc/CHANGES-6.2	Tue Apr 10 17:45:27 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.2,v 1.1.2.333 2018/04/10 11:28:34 martin Exp $
+# $NetBSD: CHANGES-6.2,v 1.1.2.334 2018/04/10 17:45:27 snj Exp $
 
 A complete list of changes from the 6.1 release until the 6.2 release:
 
@@ -21222,3 +21222,9 @@ sys/arch/amiga/amiga/cc.c			1.27 (patch)
 	Fix a spl(9) leak.
 	[msaitoh, ticket #1544]
 
+usr.sbin/ypserv/ypserv/ypserv_proc.c		1.18 via patch
+
+	PR/47615: Always zero out the result structs in the svc
+	procs to avoid returning stale request data to the client.
+	[christos, ticket #1528]
+



CVS commit: [netbsd-6-1] src/doc

2018-04-10 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Apr 10 17:45:17 UTC 2018

Modified Files:
src/doc [netbsd-6-1]: CHANGES-6.1.6

Log Message:
1528


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.137 -r1.1.2.138 src/doc/CHANGES-6.1.6

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



CVS commit: [netbsd-6] src/doc

2018-04-10 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Apr 10 17:45:27 UTC 2018

Modified Files:
src/doc [netbsd-6]: CHANGES-6.2

Log Message:
1528


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.333 -r1.1.2.334 src/doc/CHANGES-6.2

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



CVS commit: [netbsd-6-0] src/doc

2018-04-10 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Apr 10 17:44:58 UTC 2018

Modified Files:
src/doc [netbsd-6-0]: CHANGES-6.0.7

Log Message:
1528


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.140 -r1.1.2.141 src/doc/CHANGES-6.0.7

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-6.0.7
diff -u src/doc/CHANGES-6.0.7:1.1.2.140 src/doc/CHANGES-6.0.7:1.1.2.141
--- src/doc/CHANGES-6.0.7:1.1.2.140	Tue Apr 10 11:31:14 2018
+++ src/doc/CHANGES-6.0.7	Tue Apr 10 17:44:58 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.0.7,v 1.1.2.140 2018/04/10 11:31:14 martin Exp $
+# $NetBSD: CHANGES-6.0.7,v 1.1.2.141 2018/04/10 17:44:58 snj Exp $
 
 A complete list of changes from the NetBSD 6.0.6 release to the NetBSD 6.0.7
 release:
@@ -15448,3 +15448,9 @@ sys/arch/amiga/amiga/cc.c			1.27 (patch)
 	Fix a spl(9) leak.
 	[msaitoh, ticket #1544]
 
+usr.sbin/ypserv/ypserv/ypserv_proc.c		1.18 via patch
+
+	PR/47615: Always zero out the result structs in the svc
+	procs to avoid returning stale request data to the client.
+	[christos, ticket #1528]
+



CVS commit: [netbsd-6-1] src/doc

2018-04-10 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Apr 10 17:45:17 UTC 2018

Modified Files:
src/doc [netbsd-6-1]: CHANGES-6.1.6

Log Message:
1528


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.137 -r1.1.2.138 src/doc/CHANGES-6.1.6

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-6.1.6
diff -u src/doc/CHANGES-6.1.6:1.1.2.137 src/doc/CHANGES-6.1.6:1.1.2.138
--- src/doc/CHANGES-6.1.6:1.1.2.137	Tue Apr 10 11:29:28 2018
+++ src/doc/CHANGES-6.1.6	Tue Apr 10 17:45:17 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.1.6,v 1.1.2.137 2018/04/10 11:29:28 martin Exp $
+# $NetBSD: CHANGES-6.1.6,v 1.1.2.138 2018/04/10 17:45:17 snj Exp $
 
 A complete list of changes from the NetBSD 6.1.5 release to the NetBSD 6.1.6
 release:
@@ -15117,3 +15117,9 @@ sys/arch/amiga/amiga/cc.c			1.27 (patch)
 	Fix a spl(9) leak.
 	[msaitoh, ticket #1544]
 
+usr.sbin/ypserv/ypserv/ypserv_proc.c		1.18 via patch
+
+	PR/47615: Always zero out the result structs in the svc
+	procs to avoid returning stale request data to the client.
+	[christos, ticket #1528]
+



CVS commit: [netbsd-6-0] src/doc

2018-04-10 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Apr 10 17:44:58 UTC 2018

Modified Files:
src/doc [netbsd-6-0]: CHANGES-6.0.7

Log Message:
1528


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.140 -r1.1.2.141 src/doc/CHANGES-6.0.7

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



CVS commit: [netbsd-6-0] src/usr.sbin/ypserv/ypserv

2018-04-10 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Apr 10 17:44:15 UTC 2018

Modified Files:
src/usr.sbin/ypserv/ypserv [netbsd-6-0]: ypserv_proc.c

Log Message:
Pull up following revision(s) (requested by christos in ticket #1528):
usr.sbin/ypserv/ypserv/ypserv_proc.c: 1.18 via patch
PR/47615: Dr. W. Stukenbrock: Always zero out the result structs in the
svc procs to avoid returning stale request data to the client.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.16.10.1 src/usr.sbin/ypserv/ypserv/ypserv_proc.c

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



CVS commit: [netbsd-6-1] src/usr.sbin/ypserv/ypserv

2018-04-10 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Apr 10 17:44:17 UTC 2018

Modified Files:
src/usr.sbin/ypserv/ypserv [netbsd-6-1]: ypserv_proc.c

Log Message:
Pull up following revision(s) (requested by christos in ticket #1528):
usr.sbin/ypserv/ypserv/ypserv_proc.c: 1.18 via patch
PR/47615: Dr. W. Stukenbrock: Always zero out the result structs in the
svc procs to avoid returning stale request data to the client.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.16.16.1 src/usr.sbin/ypserv/ypserv/ypserv_proc.c

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

Modified files:

Index: src/usr.sbin/ypserv/ypserv/ypserv_proc.c
diff -u src/usr.sbin/ypserv/ypserv/ypserv_proc.c:1.16 src/usr.sbin/ypserv/ypserv/ypserv_proc.c:1.16.16.1
--- src/usr.sbin/ypserv/ypserv/ypserv_proc.c:1.16	Tue Aug 30 17:06:22 2011
+++ src/usr.sbin/ypserv/ypserv/ypserv_proc.c	Tue Apr 10 17:44:16 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ypserv_proc.c,v 1.16 2011/08/30 17:06:22 plunky Exp $	*/
+/*	$NetBSD: ypserv_proc.c,v 1.16.16.1 2018/04/10 17:44:16 snj Exp $	*/
 
 /*
  * Copyright (c) 1994 Mats O Jansson 
@@ -28,7 +28,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: ypserv_proc.c,v 1.16 2011/08/30 17:06:22 plunky Exp $");
+__RCSID("$NetBSD: ypserv_proc.c,v 1.16.16.1 2018/04/10 17:44:16 snj Exp $");
 #endif
 
 #include 
@@ -163,10 +163,11 @@ ypproc_match_2_svc(void *argp, struct sv
 	"key %.*s", clientstr, TORF(secure), k->domain, k->map,
 	k->keydat.dsize, k->keydat.dptr));
 
-	if (secure && securecheck(caller))
+	if (secure && securecheck(caller)) {
+		memset(, 0, sizeof(res));
 		res.status = YP_YPERR;
-	else
-		res = ypdb_get_record(k->domain, k->map, k->keydat, FALSE);
+	} else
+		res = ypdb_get_record(k->domain, k->map, k->keydat, secure);
 
 	return ((void *));
 }
@@ -190,9 +191,10 @@ ypproc_first_2_svc(void *argp, struct sv
 	"first_2: request from %.500s, secure %s, domain %s, map %s",
 	clientstr, TORF(secure), k->domain, k->map));
 
-	if (secure && securecheck(caller))
+	if (secure && securecheck(caller)) {
+		memset(, 0, sizeof(res));
 		res.status = YP_YPERR;
-	else
+	} else
 		res = ypdb_get_first(k->domain, k->map, FALSE);
 
 	return ((void *));
@@ -218,9 +220,10 @@ ypproc_next_2_svc(void *argp, struct svc
 	"key %.*s", clientstr, TORF(secure), k->domain, k->map,
 	k->keydat.dsize, k->keydat.dptr));
 
-	if (secure && securecheck(caller))
+	if (secure && securecheck(caller)) {
+		memset(, 0, sizeof(res));
 		res.status = YP_YPERR;
-	else
+	} else
 		res = ypdb_get_next(k->domain, k->map, k->keydat, FALSE);
 
 	return ((void *));
@@ -326,6 +329,7 @@ ypproc_all_2_svc(void *argp, struct svc_
 	(void)memset(, 0, sizeof(res));
 
 	if (secure && securecheck(caller)) {
+		memset(, 0, sizeof(res));
 		res.ypresp_all_u.val.status = YP_YPERR;
 		return ();
 	}
@@ -368,9 +372,10 @@ ypproc_master_2_svc(void *argp, struct s
 	"master_2: request from %.500s, secure %s, domain %s, map %s",
 	clientstr, TORF(secure), k->domain, k->map));
 
-	if (secure && securecheck(caller))
+	if (secure && securecheck(caller)) {
+		memset(, 0, sizeof(res));
 		res.status = YP_YPERR;
-	else
+	} else
 		res = ypdb_get_master(k->domain, k->map);
 
 	/*
@@ -409,12 +414,15 @@ ypproc_order_2_svc(void *argp, struct sv
 	"order_2: request from %.500s, secure %s, domain %s, map %s",
 	clientstr, TORF(secure), k->domain, k->map));
 
-	if (secure && securecheck(caller))
+	if (secure && securecheck(caller)) {
+		memset(, 0, sizeof(res));
 		res.status = YP_YPERR;
-	else if (_yp_invalid_map(k->map))
+	} else if (_yp_invalid_map(k->map)) {
+		memset(, 0, sizeof(res));
 		res.status = YP_NOMAP;
-	else
+	} else {
 		res = ypdb_get_order(k->domain, k->map);
+	}
 
 	return ((void *));
 }
@@ -446,7 +454,7 @@ ypproc_maplist_2_svc(void *argp, struct 
 	(void)snprintf(domain_path, sizeof(domain_path), "%s/%s", YP_DB_PATH,
 	domain);
 
-	res.list = NULL;
+	memset(, 0, sizeof(res));
 	status = YP_TRUE;
 
 	if ((stat(domain_path, ) != 0) || !S_ISDIR(finfo.st_mode)) {



CVS commit: [netbsd-6-0] src/usr.sbin/ypserv/ypserv

2018-04-10 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Apr 10 17:44:15 UTC 2018

Modified Files:
src/usr.sbin/ypserv/ypserv [netbsd-6-0]: ypserv_proc.c

Log Message:
Pull up following revision(s) (requested by christos in ticket #1528):
usr.sbin/ypserv/ypserv/ypserv_proc.c: 1.18 via patch
PR/47615: Dr. W. Stukenbrock: Always zero out the result structs in the
svc procs to avoid returning stale request data to the client.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.16.10.1 src/usr.sbin/ypserv/ypserv/ypserv_proc.c

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

Modified files:

Index: src/usr.sbin/ypserv/ypserv/ypserv_proc.c
diff -u src/usr.sbin/ypserv/ypserv/ypserv_proc.c:1.16 src/usr.sbin/ypserv/ypserv/ypserv_proc.c:1.16.10.1
--- src/usr.sbin/ypserv/ypserv/ypserv_proc.c:1.16	Tue Aug 30 17:06:22 2011
+++ src/usr.sbin/ypserv/ypserv/ypserv_proc.c	Tue Apr 10 17:44:15 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ypserv_proc.c,v 1.16 2011/08/30 17:06:22 plunky Exp $	*/
+/*	$NetBSD: ypserv_proc.c,v 1.16.10.1 2018/04/10 17:44:15 snj Exp $	*/
 
 /*
  * Copyright (c) 1994 Mats O Jansson 
@@ -28,7 +28,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: ypserv_proc.c,v 1.16 2011/08/30 17:06:22 plunky Exp $");
+__RCSID("$NetBSD: ypserv_proc.c,v 1.16.10.1 2018/04/10 17:44:15 snj Exp $");
 #endif
 
 #include 
@@ -163,10 +163,11 @@ ypproc_match_2_svc(void *argp, struct sv
 	"key %.*s", clientstr, TORF(secure), k->domain, k->map,
 	k->keydat.dsize, k->keydat.dptr));
 
-	if (secure && securecheck(caller))
+	if (secure && securecheck(caller)) {
+		memset(, 0, sizeof(res));
 		res.status = YP_YPERR;
-	else
-		res = ypdb_get_record(k->domain, k->map, k->keydat, FALSE);
+	} else
+		res = ypdb_get_record(k->domain, k->map, k->keydat, secure);
 
 	return ((void *));
 }
@@ -190,9 +191,10 @@ ypproc_first_2_svc(void *argp, struct sv
 	"first_2: request from %.500s, secure %s, domain %s, map %s",
 	clientstr, TORF(secure), k->domain, k->map));
 
-	if (secure && securecheck(caller))
+	if (secure && securecheck(caller)) {
+		memset(, 0, sizeof(res));
 		res.status = YP_YPERR;
-	else
+	} else
 		res = ypdb_get_first(k->domain, k->map, FALSE);
 
 	return ((void *));
@@ -218,9 +220,10 @@ ypproc_next_2_svc(void *argp, struct svc
 	"key %.*s", clientstr, TORF(secure), k->domain, k->map,
 	k->keydat.dsize, k->keydat.dptr));
 
-	if (secure && securecheck(caller))
+	if (secure && securecheck(caller)) {
+		memset(, 0, sizeof(res));
 		res.status = YP_YPERR;
-	else
+	} else
 		res = ypdb_get_next(k->domain, k->map, k->keydat, FALSE);
 
 	return ((void *));
@@ -326,6 +329,7 @@ ypproc_all_2_svc(void *argp, struct svc_
 	(void)memset(, 0, sizeof(res));
 
 	if (secure && securecheck(caller)) {
+		memset(, 0, sizeof(res));
 		res.ypresp_all_u.val.status = YP_YPERR;
 		return ();
 	}
@@ -368,9 +372,10 @@ ypproc_master_2_svc(void *argp, struct s
 	"master_2: request from %.500s, secure %s, domain %s, map %s",
 	clientstr, TORF(secure), k->domain, k->map));
 
-	if (secure && securecheck(caller))
+	if (secure && securecheck(caller)) {
+		memset(, 0, sizeof(res));
 		res.status = YP_YPERR;
-	else
+	} else
 		res = ypdb_get_master(k->domain, k->map);
 
 	/*
@@ -409,12 +414,15 @@ ypproc_order_2_svc(void *argp, struct sv
 	"order_2: request from %.500s, secure %s, domain %s, map %s",
 	clientstr, TORF(secure), k->domain, k->map));
 
-	if (secure && securecheck(caller))
+	if (secure && securecheck(caller)) {
+		memset(, 0, sizeof(res));
 		res.status = YP_YPERR;
-	else if (_yp_invalid_map(k->map))
+	} else if (_yp_invalid_map(k->map)) {
+		memset(, 0, sizeof(res));
 		res.status = YP_NOMAP;
-	else
+	} else {
 		res = ypdb_get_order(k->domain, k->map);
+	}
 
 	return ((void *));
 }
@@ -446,7 +454,7 @@ ypproc_maplist_2_svc(void *argp, struct 
 	(void)snprintf(domain_path, sizeof(domain_path), "%s/%s", YP_DB_PATH,
 	domain);
 
-	res.list = NULL;
+	memset(, 0, sizeof(res));
 	status = YP_TRUE;
 
 	if ((stat(domain_path, ) != 0) || !S_ISDIR(finfo.st_mode)) {



CVS commit: [netbsd-6-1] src/usr.sbin/ypserv/ypserv

2018-04-10 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Apr 10 17:44:17 UTC 2018

Modified Files:
src/usr.sbin/ypserv/ypserv [netbsd-6-1]: ypserv_proc.c

Log Message:
Pull up following revision(s) (requested by christos in ticket #1528):
usr.sbin/ypserv/ypserv/ypserv_proc.c: 1.18 via patch
PR/47615: Dr. W. Stukenbrock: Always zero out the result structs in the
svc procs to avoid returning stale request data to the client.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.16.16.1 src/usr.sbin/ypserv/ypserv/ypserv_proc.c

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



CVS commit: [netbsd-6] src/usr.sbin/ypserv/ypserv

2018-04-10 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Apr 10 17:44:19 UTC 2018

Modified Files:
src/usr.sbin/ypserv/ypserv [netbsd-6]: ypserv_proc.c

Log Message:
Pull up following revision(s) (requested by christos in ticket #1528):
usr.sbin/ypserv/ypserv/ypserv_proc.c: 1.18 via patch
PR/47615: Dr. W. Stukenbrock: Always zero out the result structs in the
svc procs to avoid returning stale request data to the client.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.16.4.1 src/usr.sbin/ypserv/ypserv/ypserv_proc.c

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

Modified files:

Index: src/usr.sbin/ypserv/ypserv/ypserv_proc.c
diff -u src/usr.sbin/ypserv/ypserv/ypserv_proc.c:1.16 src/usr.sbin/ypserv/ypserv/ypserv_proc.c:1.16.4.1
--- src/usr.sbin/ypserv/ypserv/ypserv_proc.c:1.16	Tue Aug 30 17:06:22 2011
+++ src/usr.sbin/ypserv/ypserv/ypserv_proc.c	Tue Apr 10 17:44:18 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ypserv_proc.c,v 1.16 2011/08/30 17:06:22 plunky Exp $	*/
+/*	$NetBSD: ypserv_proc.c,v 1.16.4.1 2018/04/10 17:44:18 snj Exp $	*/
 
 /*
  * Copyright (c) 1994 Mats O Jansson 
@@ -28,7 +28,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: ypserv_proc.c,v 1.16 2011/08/30 17:06:22 plunky Exp $");
+__RCSID("$NetBSD: ypserv_proc.c,v 1.16.4.1 2018/04/10 17:44:18 snj Exp $");
 #endif
 
 #include 
@@ -163,10 +163,11 @@ ypproc_match_2_svc(void *argp, struct sv
 	"key %.*s", clientstr, TORF(secure), k->domain, k->map,
 	k->keydat.dsize, k->keydat.dptr));
 
-	if (secure && securecheck(caller))
+	if (secure && securecheck(caller)) {
+		memset(, 0, sizeof(res));
 		res.status = YP_YPERR;
-	else
-		res = ypdb_get_record(k->domain, k->map, k->keydat, FALSE);
+	} else
+		res = ypdb_get_record(k->domain, k->map, k->keydat, secure);
 
 	return ((void *));
 }
@@ -190,9 +191,10 @@ ypproc_first_2_svc(void *argp, struct sv
 	"first_2: request from %.500s, secure %s, domain %s, map %s",
 	clientstr, TORF(secure), k->domain, k->map));
 
-	if (secure && securecheck(caller))
+	if (secure && securecheck(caller)) {
+		memset(, 0, sizeof(res));
 		res.status = YP_YPERR;
-	else
+	} else
 		res = ypdb_get_first(k->domain, k->map, FALSE);
 
 	return ((void *));
@@ -218,9 +220,10 @@ ypproc_next_2_svc(void *argp, struct svc
 	"key %.*s", clientstr, TORF(secure), k->domain, k->map,
 	k->keydat.dsize, k->keydat.dptr));
 
-	if (secure && securecheck(caller))
+	if (secure && securecheck(caller)) {
+		memset(, 0, sizeof(res));
 		res.status = YP_YPERR;
-	else
+	} else
 		res = ypdb_get_next(k->domain, k->map, k->keydat, FALSE);
 
 	return ((void *));
@@ -326,6 +329,7 @@ ypproc_all_2_svc(void *argp, struct svc_
 	(void)memset(, 0, sizeof(res));
 
 	if (secure && securecheck(caller)) {
+		memset(, 0, sizeof(res));
 		res.ypresp_all_u.val.status = YP_YPERR;
 		return ();
 	}
@@ -368,9 +372,10 @@ ypproc_master_2_svc(void *argp, struct s
 	"master_2: request from %.500s, secure %s, domain %s, map %s",
 	clientstr, TORF(secure), k->domain, k->map));
 
-	if (secure && securecheck(caller))
+	if (secure && securecheck(caller)) {
+		memset(, 0, sizeof(res));
 		res.status = YP_YPERR;
-	else
+	} else
 		res = ypdb_get_master(k->domain, k->map);
 
 	/*
@@ -409,12 +414,15 @@ ypproc_order_2_svc(void *argp, struct sv
 	"order_2: request from %.500s, secure %s, domain %s, map %s",
 	clientstr, TORF(secure), k->domain, k->map));
 
-	if (secure && securecheck(caller))
+	if (secure && securecheck(caller)) {
+		memset(, 0, sizeof(res));
 		res.status = YP_YPERR;
-	else if (_yp_invalid_map(k->map))
+	} else if (_yp_invalid_map(k->map)) {
+		memset(, 0, sizeof(res));
 		res.status = YP_NOMAP;
-	else
+	} else {
 		res = ypdb_get_order(k->domain, k->map);
+	}
 
 	return ((void *));
 }
@@ -446,7 +454,7 @@ ypproc_maplist_2_svc(void *argp, struct 
 	(void)snprintf(domain_path, sizeof(domain_path), "%s/%s", YP_DB_PATH,
 	domain);
 
-	res.list = NULL;
+	memset(, 0, sizeof(res));
 	status = YP_TRUE;
 
 	if ((stat(domain_path, ) != 0) || !S_ISDIR(finfo.st_mode)) {



CVS commit: [netbsd-6] src/usr.sbin/ypserv/ypserv

2018-04-10 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Apr 10 17:44:19 UTC 2018

Modified Files:
src/usr.sbin/ypserv/ypserv [netbsd-6]: ypserv_proc.c

Log Message:
Pull up following revision(s) (requested by christos in ticket #1528):
usr.sbin/ypserv/ypserv/ypserv_proc.c: 1.18 via patch
PR/47615: Dr. W. Stukenbrock: Always zero out the result structs in the
svc procs to avoid returning stale request data to the client.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.16.4.1 src/usr.sbin/ypserv/ypserv/ypserv_proc.c

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



CVS commit: src

2018-04-10 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Apr 10 16:12:30 UTC 2018

Modified Files:
src/distrib/sets/lists/comp: mi
src/share/man/man9: Makefile mbuf.9
src/sys/kern: uipc_mbuf.c
src/sys/sys: mbuf.h

Log Message:
Remove m_getclr. It is unused, confusing (vs m_clget), and is a weak
implementation (eg you can't request a zeroed pkthdr mbuf).


To generate a diff of this commit:
cvs rdiff -u -r1.2186 -r1.2187 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.418 -r1.419 src/share/man/man9/Makefile
cvs rdiff -u -r1.56 -r1.57 src/share/man/man9/mbuf.9
cvs rdiff -u -r1.186 -r1.187 src/sys/kern/uipc_mbuf.c
cvs rdiff -u -r1.181 -r1.182 src/sys/sys/mbuf.h

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

Modified files:

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.2186 src/distrib/sets/lists/comp/mi:1.2187
--- src/distrib/sets/lists/comp/mi:1.2186	Wed Apr  4 04:43:46 2018
+++ src/distrib/sets/lists/comp/mi	Tue Apr 10 16:12:29 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.2186 2018/04/04 04:43:46 kre Exp $
+#	$NetBSD: mi,v 1.2187 2018/04/10 16:12:29 maxv Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.compcomp-sys-root
@@ -11059,7 +11059,7 @@
 ./usr/share/man/cat9/m_free.0			comp-sys-catman		.cat
 ./usr/share/man/cat9/m_freem.0			comp-sys-catman		.cat
 ./usr/share/man/cat9/m_get.0			comp-sys-catman		.cat
-./usr/share/man/cat9/m_getclr.0			comp-sys-catman		.cat
+./usr/share/man/cat9/m_getclr.0			comp-obsolete		obsolete
 ./usr/share/man/cat9/m_gethdr.0			comp-sys-catman		.cat
 ./usr/share/man/cat9/m_makewritable.0		comp-sys-catman		.cat
 ./usr/share/man/cat9/m_prepend.0		comp-sys-catman		.cat
@@ -18738,7 +18738,7 @@
 ./usr/share/man/html9/m_free.html		comp-sys-htmlman	html
 ./usr/share/man/html9/m_freem.html		comp-sys-htmlman	html
 ./usr/share/man/html9/m_get.html		comp-sys-htmlman	html
-./usr/share/man/html9/m_getclr.html		comp-sys-htmlman	html
+./usr/share/man/html9/m_getclr.html		comp-obsolete	obsolete
 ./usr/share/man/html9/m_gethdr.html		comp-sys-htmlman	html
 ./usr/share/man/html9/m_makewritable.html	comp-sys-htmlman	html
 ./usr/share/man/html9/m_prepend.html		comp-sys-htmlman	html
@@ -26571,7 +26571,7 @@
 ./usr/share/man/man9/m_free.9			comp-sys-man		.man
 ./usr/share/man/man9/m_freem.9			comp-sys-man		.man
 ./usr/share/man/man9/m_get.9			comp-sys-man		.man
-./usr/share/man/man9/m_getclr.9			comp-sys-man		.man
+./usr/share/man/man9/m_getclr.9			comp-obsolete		obsolete
 ./usr/share/man/man9/m_gethdr.9			comp-sys-man		.man
 ./usr/share/man/man9/m_makewritable.9		comp-sys-man		.man
 ./usr/share/man/man9/m_prepend.9		comp-sys-man		.man

Index: src/share/man/man9/Makefile
diff -u src/share/man/man9/Makefile:1.418 src/share/man/man9/Makefile:1.419
--- src/share/man/man9/Makefile:1.418	Wed Jan 17 02:45:38 2018
+++ src/share/man/man9/Makefile	Tue Apr 10 16:12:29 2018
@@ -1,4 +1,4 @@
-#   $NetBSD: Makefile,v 1.418 2018/01/17 02:45:38 maya Exp $
+#   $NetBSD: Makefile,v 1.419 2018/04/10 16:12:29 maxv Exp $
 
 #	Makefile for section 9 (kernel function and variable) manual pages.
 
@@ -489,7 +489,7 @@ MLINKS+=malloc.9 malloc_type_detach.9
 MLINKS+=malloc.9 MALLOC_DEFINE.9
 MLINKS+=malloc.9 MALLOC_DECLARE.9
 MLINKS+=mb.9 mb_memory.9 mb.9 mb_read.9 mb.9 mb_write.9
-MLINKS+=mbuf.9 m_get.9 mbuf.9 m_getclr.9 mbuf.9 m_gethdr.9 mbuf.9 m_devget.9 \
+MLINKS+=mbuf.9 m_get.9 mbuf.9 m_gethdr.9 mbuf.9 m_devget.9 \
 	mbuf.9 m_copym.9 mbuf.9 m_copypacket.9 mbuf.9 m_copydata.9 \
 	mbuf.9 m_copyback.9 mbuf.9 m_cat.9 mbuf.9 m_dup.9 mbuf.9 m_prepend.9 \
 	mbuf.9 m_copyback_cow.9 \

Index: src/share/man/man9/mbuf.9
diff -u src/share/man/man9/mbuf.9:1.56 src/share/man/man9/mbuf.9:1.57
--- src/share/man/man9/mbuf.9:1.56	Thu Jan 25 09:33:21 2018
+++ src/share/man/man9/mbuf.9	Tue Apr 10 16:12:29 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: mbuf.9,v 1.56 2018/01/25 09:33:21 maxv Exp $
+.\"	$NetBSD: mbuf.9,v 1.57 2018/04/10 16:12:29 maxv Exp $
 .\"
 .\" Copyright (c) 1997 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,13 +27,12 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd January 25, 2018
+.Dd April 10, 2018
 .Dt MBUF 9
 .Os
 .Sh NAME
 .Nm mbuf ,
 .Nm m_get ,
-.Nm m_getclr ,
 .Nm m_gethdr ,
 .Nm m_devget ,
 .Nm m_copym ,
@@ -73,8 +72,6 @@
 .Ft struct mbuf *
 .Fn m_get "int nowait" "int type"
 .Ft struct mbuf *
-.Fn m_getclr "int nowait" "int type"
-.Ft struct mbuf *
 .Fn m_gethdr "int nowait" "int type"
 .Ft struct mbuf *
 .Fn m_devget "char *buf" "int totlen" "int off0" "struct ifnet *ifp" "void (*copy)(const void *, void *, size_t)"
@@ -251,17 +248,6 @@ means the call cannot fail, but may take
 The
 .Fa type
 parameter is an mbuf type.
-.It Fn m_getclr "int nowait" "int type"
-Allocates an mbuf and initializes it to contain internal data, then
-zeros the data 

CVS commit: src

2018-04-10 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Apr 10 16:12:30 UTC 2018

Modified Files:
src/distrib/sets/lists/comp: mi
src/share/man/man9: Makefile mbuf.9
src/sys/kern: uipc_mbuf.c
src/sys/sys: mbuf.h

Log Message:
Remove m_getclr. It is unused, confusing (vs m_clget), and is a weak
implementation (eg you can't request a zeroed pkthdr mbuf).


To generate a diff of this commit:
cvs rdiff -u -r1.2186 -r1.2187 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.418 -r1.419 src/share/man/man9/Makefile
cvs rdiff -u -r1.56 -r1.57 src/share/man/man9/mbuf.9
cvs rdiff -u -r1.186 -r1.187 src/sys/kern/uipc_mbuf.c
cvs rdiff -u -r1.181 -r1.182 src/sys/sys/mbuf.h

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



CVS commit: src/sys/kern

2018-04-10 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Apr 10 15:29:46 UTC 2018

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

Log Message:
Put the "free" functions close to one another. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.185 -r1.186 src/sys/kern/uipc_mbuf.c

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

Modified files:

Index: src/sys/kern/uipc_mbuf.c
diff -u src/sys/kern/uipc_mbuf.c:1.185 src/sys/kern/uipc_mbuf.c:1.186
--- src/sys/kern/uipc_mbuf.c:1.185	Tue Apr 10 15:27:35 2018
+++ src/sys/kern/uipc_mbuf.c	Tue Apr 10 15:29:46 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_mbuf.c,v 1.185 2018/04/10 15:27:35 maxv Exp $	*/
+/*	$NetBSD: uipc_mbuf.c,v 1.186 2018/04/10 15:29:46 maxv Exp $	*/
 
 /*
  * Copyright (c) 1999, 2001 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.185 2018/04/10 15:27:35 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.186 2018/04/10 15:29:46 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_mbuftrace.h"
@@ -1716,75 +1716,6 @@ m_getptr(struct mbuf *m, int loc, int *o
 	return NULL;
 }
 
-/*
- * Release a reference to the mbuf external storage.
- *
- * => free the mbuf m itself as well.
- */
-static void
-m_ext_free(struct mbuf *m)
-{
-	const bool embedded = MEXT_ISEMBEDDED(m);
-	bool dofree = true;
-	u_int refcnt;
-
-	KASSERT((m->m_flags & M_EXT) != 0);
-	KASSERT(MEXT_ISEMBEDDED(m->m_ext_ref));
-	KASSERT((m->m_ext_ref->m_flags & M_EXT) != 0);
-	KASSERT((m->m_flags & M_EXT_CLUSTER) ==
-	(m->m_ext_ref->m_flags & M_EXT_CLUSTER));
-
-	if (__predict_false(m->m_type == MT_FREE)) {
-		panic("mbuf %p already freed", m);
-	}
-
-	if (__predict_true(m->m_ext.ext_refcnt == 1)) {
-		refcnt = m->m_ext.ext_refcnt = 0;
-	} else {
-		refcnt = atomic_dec_uint_nv(>m_ext.ext_refcnt);
-	}
-
-	if (refcnt > 0) {
-		if (embedded) {
-			/*
-			 * other mbuf's m_ext_ref still points to us.
-			 */
-			dofree = false;
-		} else {
-			m->m_ext_ref = m;
-		}
-	} else {
-		/*
-		 * dropping the last reference
-		 */
-		if (!embedded) {
-			m->m_ext.ext_refcnt++; /* XXX */
-			m_ext_free(m->m_ext_ref);
-			m->m_ext_ref = m;
-		} else if ((m->m_flags & M_EXT_CLUSTER) != 0) {
-			pool_cache_put_paddr((struct pool_cache *)
-			m->m_ext.ext_arg,
-			m->m_ext.ext_buf, m->m_ext.ext_paddr);
-		} else if (m->m_ext.ext_free) {
-			(*m->m_ext.ext_free)(m,
-			m->m_ext.ext_buf, m->m_ext.ext_size,
-			m->m_ext.ext_arg);
-			/*
-			 * 'm' is already freed by the ext_free callback.
-			 */
-			dofree = false;
-		} else {
-			free(m->m_ext.ext_buf, m->m_ext.ext_type);
-		}
-	}
-
-	if (dofree) {
-		m->m_type = MT_FREE;
-		m->m_data = NULL;
-		pool_cache_put(mb_cache, m);
-	}
-}
-
 #if defined(DDB)
 void
 m_print(const struct mbuf *m, const char *modif, void (*pr)(const char *, ...))
@@ -1970,6 +1901,75 @@ m_claim(struct mbuf *m, struct mowner *m
 #endif /* defined(MBUFTRACE) */
 
 /*
+ * Release a reference to the mbuf external storage.
+ *
+ * => free the mbuf m itself as well.
+ */
+static void
+m_ext_free(struct mbuf *m)
+{
+	const bool embedded = MEXT_ISEMBEDDED(m);
+	bool dofree = true;
+	u_int refcnt;
+
+	KASSERT((m->m_flags & M_EXT) != 0);
+	KASSERT(MEXT_ISEMBEDDED(m->m_ext_ref));
+	KASSERT((m->m_ext_ref->m_flags & M_EXT) != 0);
+	KASSERT((m->m_flags & M_EXT_CLUSTER) ==
+	(m->m_ext_ref->m_flags & M_EXT_CLUSTER));
+
+	if (__predict_false(m->m_type == MT_FREE)) {
+		panic("mbuf %p already freed", m);
+	}
+
+	if (__predict_true(m->m_ext.ext_refcnt == 1)) {
+		refcnt = m->m_ext.ext_refcnt = 0;
+	} else {
+		refcnt = atomic_dec_uint_nv(>m_ext.ext_refcnt);
+	}
+
+	if (refcnt > 0) {
+		if (embedded) {
+			/*
+			 * other mbuf's m_ext_ref still points to us.
+			 */
+			dofree = false;
+		} else {
+			m->m_ext_ref = m;
+		}
+	} else {
+		/*
+		 * dropping the last reference
+		 */
+		if (!embedded) {
+			m->m_ext.ext_refcnt++; /* XXX */
+			m_ext_free(m->m_ext_ref);
+			m->m_ext_ref = m;
+		} else if ((m->m_flags & M_EXT_CLUSTER) != 0) {
+			pool_cache_put_paddr((struct pool_cache *)
+			m->m_ext.ext_arg,
+			m->m_ext.ext_buf, m->m_ext.ext_paddr);
+		} else if (m->m_ext.ext_free) {
+			(*m->m_ext.ext_free)(m,
+			m->m_ext.ext_buf, m->m_ext.ext_size,
+			m->m_ext.ext_arg);
+			/*
+			 * 'm' is already freed by the ext_free callback.
+			 */
+			dofree = false;
+		} else {
+			free(m->m_ext.ext_buf, m->m_ext.ext_type);
+		}
+	}
+
+	if (dofree) {
+		m->m_type = MT_FREE;
+		m->m_data = NULL;
+		pool_cache_put(mb_cache, m);
+	}
+}
+
+/*
  * Free a single mbuf and associated external storage. Return the
  * successor, if any.
  */



CVS commit: src/sys/kern

2018-04-10 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Apr 10 15:29:46 UTC 2018

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

Log Message:
Put the "free" functions close to one another. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.185 -r1.186 src/sys/kern/uipc_mbuf.c

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



CVS commit: src/sys

2018-04-10 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Apr 10 15:27:35 UTC 2018

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

Log Message:
Localify m_ext_free.


To generate a diff of this commit:
cvs rdiff -u -r1.184 -r1.185 src/sys/kern/uipc_mbuf.c
cvs rdiff -u -r1.180 -r1.181 src/sys/sys/mbuf.h

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



CVS commit: src/sys

2018-04-10 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Apr 10 15:27:35 UTC 2018

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

Log Message:
Localify m_ext_free.


To generate a diff of this commit:
cvs rdiff -u -r1.184 -r1.185 src/sys/kern/uipc_mbuf.c
cvs rdiff -u -r1.180 -r1.181 src/sys/sys/mbuf.h

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

Modified files:

Index: src/sys/kern/uipc_mbuf.c
diff -u src/sys/kern/uipc_mbuf.c:1.184 src/sys/kern/uipc_mbuf.c:1.185
--- src/sys/kern/uipc_mbuf.c:1.184	Wed Mar 21 17:03:09 2018
+++ src/sys/kern/uipc_mbuf.c	Tue Apr 10 15:27:35 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_mbuf.c,v 1.184 2018/03/21 17:03:09 maxv Exp $	*/
+/*	$NetBSD: uipc_mbuf.c,v 1.185 2018/04/10 15:27:35 maxv Exp $	*/
 
 /*
  * Copyright (c) 1999, 2001 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.184 2018/03/21 17:03:09 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.185 2018/04/10 15:27:35 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_mbuftrace.h"
@@ -1717,12 +1717,11 @@ m_getptr(struct mbuf *m, int loc, int *o
 }
 
 /*
- * m_ext_free: release a reference to the mbuf external storage.
+ * Release a reference to the mbuf external storage.
  *
  * => free the mbuf m itself as well.
  */
-
-void
+static void
 m_ext_free(struct mbuf *m)
 {
 	const bool embedded = MEXT_ISEMBEDDED(m);

Index: src/sys/sys/mbuf.h
diff -u src/sys/sys/mbuf.h:1.180 src/sys/sys/mbuf.h:1.181
--- src/sys/sys/mbuf.h:1.180	Wed Mar 21 17:03:09 2018
+++ src/sys/sys/mbuf.h	Tue Apr 10 15:27:35 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: mbuf.h,v 1.180 2018/03/21 17:03:09 maxv Exp $	*/
+/*	$NetBSD: mbuf.h,v 1.181 2018/04/10 15:27:35 maxv Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997, 1999, 2001, 2007 The NetBSD Foundation, Inc.
@@ -864,7 +864,6 @@ struct	mbuf *m_free(struct mbuf *);
 void	m_freem(struct mbuf *);
 void	m_reclaim(void *, int);
 void	mbinit(void);
-void	m_ext_free(struct mbuf *);
 void	m_move_pkthdr(struct mbuf *, struct mbuf *);
 
 bool	m_ensure_contig(struct mbuf **, int);



CVS commit: src/external/bsd/nvi/dist/vi

2018-04-10 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Apr 10 12:44:41 UTC 2018

Modified Files:
src/external/bsd/nvi/dist/vi: vs_refresh.c

Log Message:
PR bin/53164: Comment why we abort here.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/nvi/dist/vi/vs_refresh.c

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



CVS commit: src/external/bsd/nvi/dist/vi

2018-04-10 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Apr 10 12:44:41 UTC 2018

Modified Files:
src/external/bsd/nvi/dist/vi: vs_refresh.c

Log Message:
PR bin/53164: Comment why we abort here.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/nvi/dist/vi/vs_refresh.c

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

Modified files:

Index: src/external/bsd/nvi/dist/vi/vs_refresh.c
diff -u src/external/bsd/nvi/dist/vi/vs_refresh.c:1.9 src/external/bsd/nvi/dist/vi/vs_refresh.c:1.10
--- src/external/bsd/nvi/dist/vi/vs_refresh.c:1.9	Sun Feb  4 09:15:45 2018
+++ src/external/bsd/nvi/dist/vi/vs_refresh.c	Tue Apr 10 12:44:41 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: vs_refresh.c,v 1.9 2018/02/04 09:15:45 mrg Exp $ */
+/*	$NetBSD: vs_refresh.c,v 1.10 2018/04/10 12:44:41 rin Exp $ */
 /*-
  * Copyright (c) 1992, 1993, 1994
  *	The Regents of the University of California.  All rights reserved.
@@ -16,7 +16,7 @@
 static const char sccsid[] = "Id: vs_refresh.c,v 10.50 2001/06/25 15:19:37 skimo Exp  (Berkeley) Date: 2001/06/25 15:19:37 ";
 #endif /* not lint */
 #else
-__RCSID("$NetBSD: vs_refresh.c,v 1.9 2018/02/04 09:15:45 mrg Exp $");
+__RCSID("$NetBSD: vs_refresh.c,v 1.10 2018/04/10 12:44:41 rin Exp $");
 #endif
 
 #include 
@@ -723,7 +723,7 @@ done_cursor:
 #else
 	if (vip->sc_smap == NULL) {
 		if (F_ISSET(sp, SC_SCR_REFORMAT))
-			abort(); /* XXX */
+			abort(); /* XXX infinite recursion */
 		F_SET(sp, SC_SCR_REFORMAT);
 		return (vs_paint(sp, flags));
 	}



CVS commit: [netbsd-8] src/doc

2018-04-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Apr 10 11:49:39 UTC 2018

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

Log Message:
Ticket #727


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

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

Modified files:

Index: src/doc/CHANGES-8.0
diff -u src/doc/CHANGES-8.0:1.1.2.175 src/doc/CHANGES-8.0:1.1.2.176
--- src/doc/CHANGES-8.0:1.1.2.175	Tue Apr 10 08:07:48 2018
+++ src/doc/CHANGES-8.0	Tue Apr 10 11:49:39 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.0,v 1.1.2.175 2018/04/10 08:07:48 bouyer Exp $
+# $NetBSD: CHANGES-8.0,v 1.1.2.176 2018/04/10 11:49:39 martin Exp $
 
 A complete list of changes from the initial NetBSD 8.0 branch on 2017-06-04
 until the 8.0 release:
@@ -11201,3 +11201,9 @@ tests/usr.bin/shmif_dumpbus/t_basic.sh		
 	Fixes PR 53150.
 	[martin, ticket #726]
 
+sys/net/if_bridge.c1.149
+tests/net/if_bridge/t_rtable.sh			1.2
+
+	Fix bridge_rtdelete and add a test case for it.
+	[ozaki-r, ticket #727]
+



CVS commit: [netbsd-8] src/doc

2018-04-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Apr 10 11:49:39 UTC 2018

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

Log Message:
Ticket #727


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

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



CVS commit: [netbsd-8] src

2018-04-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Apr 10 11:48:29 UTC 2018

Modified Files:
src/sys/net [netbsd-8]: if_bridge.c
src/tests/net/if_bridge [netbsd-8]: t_rtable.sh

Log Message:
Pull up following revision(s) (requested by ozaki-r in ticket #727):

tests/net/if_bridge/t_rtable.sh: revision 1.2
sys/net/if_bridge.c: revision 1.149

Fix bridge_rtdelete

It removes a rtable entry that belongs to a specified interface, however,
its original behavior was to delete all belonging entries.
Restore the original behavior.

Add a test case for bridge_rtdelete


To generate a diff of this commit:
cvs rdiff -u -r1.134.6.7 -r1.134.6.8 src/sys/net/if_bridge.c
cvs rdiff -u -r1.1 -r1.1.8.1 src/tests/net/if_bridge/t_rtable.sh

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

Modified files:

Index: src/sys/net/if_bridge.c
diff -u src/sys/net/if_bridge.c:1.134.6.7 src/sys/net/if_bridge.c:1.134.6.8
--- src/sys/net/if_bridge.c:1.134.6.7	Mon Feb 26 00:41:13 2018
+++ src/sys/net/if_bridge.c	Tue Apr 10 11:48:29 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bridge.c,v 1.134.6.7 2018/02/26 00:41:13 snj Exp $	*/
+/*	$NetBSD: if_bridge.c,v 1.134.6.8 2018/04/10 11:48:29 martin Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -80,7 +80,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.134.6.7 2018/02/26 00:41:13 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.134.6.8 2018/04/10 11:48:29 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_bridge_ipf.h"
@@ -2299,6 +2299,8 @@ bridge_rtdelete(struct bridge_softc *sc,
 {
 	struct bridge_rtnode *brt;
 
+	/* XXX pserialize_perform for each entry is slow */
+again:
 	BRIDGE_RT_LOCK(sc);
 	LIST_FOREACH(brt, >sc_rtlist, brt_list) {
 		if (brt->brt_ifp == ifp)
@@ -2313,6 +2315,8 @@ bridge_rtdelete(struct bridge_softc *sc,
 	BRIDGE_RT_UNLOCK(sc);
 
 	bridge_rtnode_destroy(brt);
+
+	goto again;
 }
 
 /*

Index: src/tests/net/if_bridge/t_rtable.sh
diff -u src/tests/net/if_bridge/t_rtable.sh:1.1 src/tests/net/if_bridge/t_rtable.sh:1.1.8.1
--- src/tests/net/if_bridge/t_rtable.sh:1.1	Sat Mar 11 04:24:52 2017
+++ src/tests/net/if_bridge/t_rtable.sh	Tue Apr 10 11:48:28 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: t_rtable.sh,v 1.1 2017/03/11 04:24:52 ozaki-r Exp $
+#	$NetBSD: t_rtable.sh,v 1.1.8.1 2018/04/10 11:48:28 martin Exp $
 #
 # Copyright (c) 2017 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -342,6 +342,76 @@ bridge_rtable_maxaddr_cleanup()
 }
 
 
+atf_test_case bridge_rtable_delete_member cleanup
+bridge_rtable_delete_member_head()
+{
+
+	atf_set "descr" "Tests belonging rtable entries are removed on deleting an interface"
+	atf_set "require.progs" "rump_server"
+}
+
+bridge_rtable_delete_member_body()
+{
+	local addr10= addr30= addr11= addr31=
+	local n=
+
+	setup
+	setup_bridge
+
+	# Add extra interfaces and addresses
+	export RUMP_SERVER=$SOCK1
+	rump_server_add_iface $SOCK1 shmif1 bus1
+	atf_check -s exit:0 rump.ifconfig shmif1 10.0.0.11/24
+	atf_check -s exit:0 rump.ifconfig -w 10
+
+	export RUMP_SERVER=$SOCK3
+	rump_server_add_iface $SOCK3 shmif1 bus2
+	atf_check -s exit:0 rump.ifconfig shmif1 10.0.0.12/24
+	atf_check -s exit:0 rump.ifconfig -w 10
+
+	# Get MAC addresses of the endpoints.
+	addr10=$(get_macaddr $SOCK1 shmif0)
+	addr30=$(get_macaddr $SOCK3 shmif0)
+	addr11=$(get_macaddr $SOCK1 shmif1)
+	addr31=$(get_macaddr $SOCK3 shmif1)
+
+	# Make the bridge learn the MAC addresses of the endpoints.
+	export RUMP_SERVER=$SOCK1
+	atf_check -s exit:0 -o ignore rump.ping -n -w $TIMEOUT -c 1 10.0.0.12
+	export RUMP_SERVER=$SOCK3
+	atf_check -s exit:0 -o ignore rump.ping -n -w $TIMEOUT -c 1 10.0.0.11
+
+	export RUMP_SERVER=$SOCK2
+	export LD_PRELOAD=/usr/lib/librumphijack.so
+	$DEBUG && /sbin/brconfig bridge0
+	atf_check -s exit:0 -o match:"$addr10 shmif0" /sbin/brconfig bridge0
+	atf_check -s exit:0 -o match:"$addr11 shmif0" /sbin/brconfig bridge0
+	atf_check -s exit:0 -o match:"$addr30 shmif1" /sbin/brconfig bridge0
+	atf_check -s exit:0 -o match:"$addr31 shmif1" /sbin/brconfig bridge0
+
+	atf_check -s exit:0 -o ignore /sbin/brconfig bridge0 delete shmif0
+	atf_check -s exit:0 -o not-match:"$addr10 shmif0" /sbin/brconfig bridge0
+	atf_check -s exit:0 -o not-match:"$addr11 shmif0" /sbin/brconfig bridge0
+	atf_check -s exit:0 -o match:"$addr30 shmif1" /sbin/brconfig bridge0
+	atf_check -s exit:0 -o match:"$addr31 shmif1" /sbin/brconfig bridge0
+
+	atf_check -s exit:0 -o ignore /sbin/brconfig bridge0 delete shmif1
+	atf_check -s exit:0 -o not-match:"$addr10 shmif0" /sbin/brconfig bridge0
+	atf_check -s exit:0 -o not-match:"$addr11 shmif0" /sbin/brconfig bridge0
+	atf_check -s exit:0 -o not-match:"$addr30 shmif1" /sbin/brconfig bridge0
+	atf_check -s exit:0 -o not-match:"$addr31 shmif1" /sbin/brconfig bridge0
+
+	rump_server_destroy_ifaces
+}
+
+bridge_rtable_delete_member_cleanup()
+{
+
+	$DEBUG && dump
+	cleanup
+}
+
+
 atf_init_test_cases()
 {
 

CVS commit: [netbsd-8] src

2018-04-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Apr 10 11:48:29 UTC 2018

Modified Files:
src/sys/net [netbsd-8]: if_bridge.c
src/tests/net/if_bridge [netbsd-8]: t_rtable.sh

Log Message:
Pull up following revision(s) (requested by ozaki-r in ticket #727):

tests/net/if_bridge/t_rtable.sh: revision 1.2
sys/net/if_bridge.c: revision 1.149

Fix bridge_rtdelete

It removes a rtable entry that belongs to a specified interface, however,
its original behavior was to delete all belonging entries.
Restore the original behavior.

Add a test case for bridge_rtdelete


To generate a diff of this commit:
cvs rdiff -u -r1.134.6.7 -r1.134.6.8 src/sys/net/if_bridge.c
cvs rdiff -u -r1.1 -r1.1.8.1 src/tests/net/if_bridge/t_rtable.sh

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



CVS commit: src/sys/net

2018-04-10 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Tue Apr 10 11:44:13 UTC 2018

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

Log Message:
Fix previous my mistake and odd unaligned case. Pointed out by maxv@n.o, thanks.

It must be rare case to be required this copy routine...


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/net/if_l2tp.c

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

Modified files:

Index: src/sys/net/if_l2tp.c
diff -u src/sys/net/if_l2tp.c:1.22 src/sys/net/if_l2tp.c:1.23
--- src/sys/net/if_l2tp.c:1.22	Mon Apr  9 10:32:32 2018
+++ src/sys/net/if_l2tp.c	Tue Apr 10 11:44:13 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_l2tp.c,v 1.22 2018/04/09 10:32:32 knakahara Exp $	*/
+/*	$NetBSD: if_l2tp.c,v 1.23 2018/04/10 11:44:13 knakahara Exp $	*/
 
 /*
  * Copyright (c) 2017 Internet Initiative Japan Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_l2tp.c,v 1.22 2018/04/09 10:32:32 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_l2tp.c,v 1.23 2018/04/10 11:44:13 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -481,10 +481,12 @@ l2tp_input(struct mbuf *m, struct ifnet 
 	 * If the head of the payload is not aligned, align it.
 	 */
 	addr = mtod(m, vaddr_t);
-	if ((addr & 0x03) == 0) {
+	if ((addr & 0x03) != 0x2) {
 		/* copy and align head of payload */
 		struct mbuf *m_head;
 		int copy_length;
+		u_int pad = roundup(sizeof(struct ether_header), 4)
+			- sizeof(struct ether_header);
 
 #define L2TP_COPY_LENGTH		60
 
@@ -507,7 +509,19 @@ l2tp_input(struct mbuf *m, struct ifnet 
 		}
 		M_COPY_PKTHDR(m_head, m);
 
-		MH_ALIGN(m_head, L2TP_COPY_LENGTH);
+		/*
+		 * m_head should be:
+		 * L2TP_COPY_LENGTH
+		 *  <-  + roundup(pad, 4) - pad ->
+		 *   +---++-+--+-+
+		 *   | m_hdr | pkthdr | ... | ether header |   payload   |
+		 *   +---++-+--+-+
+		 *  ^  ^
+		 *  m_data 4 byte aligned
+		 */
+		MH_ALIGN(m_head, L2TP_COPY_LENGTH + roundup(pad, 4));
+		m_head->m_data += pad;
+
 		memcpy(mtod(m_head, void *), mtod(m, void *), copy_length);
 		m_head->m_len = copy_length;
 		m->m_data += copy_length;



CVS commit: src/sys/net

2018-04-10 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Tue Apr 10 11:44:13 UTC 2018

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

Log Message:
Fix previous my mistake and odd unaligned case. Pointed out by maxv@n.o, thanks.

It must be rare case to be required this copy routine...


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/net/if_l2tp.c

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



CVS commit: [netbsd-6-0] src/doc

2018-04-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Apr 10 11:31:14 UTC 2018

Modified Files:
src/doc [netbsd-6-0]: CHANGES-6.0.7

Log Message:
Ticket #1544


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.139 -r1.1.2.140 src/doc/CHANGES-6.0.7

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



CVS commit: [netbsd-6-0] src/doc

2018-04-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Apr 10 11:31:14 UTC 2018

Modified Files:
src/doc [netbsd-6-0]: CHANGES-6.0.7

Log Message:
Ticket #1544


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.139 -r1.1.2.140 src/doc/CHANGES-6.0.7

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-6.0.7
diff -u src/doc/CHANGES-6.0.7:1.1.2.139 src/doc/CHANGES-6.0.7:1.1.2.140
--- src/doc/CHANGES-6.0.7:1.1.2.139	Mon Apr  9 13:08:59 2018
+++ src/doc/CHANGES-6.0.7	Tue Apr 10 11:31:14 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.0.7,v 1.1.2.139 2018/04/09 13:08:59 martin Exp $
+# $NetBSD: CHANGES-6.0.7,v 1.1.2.140 2018/04/10 11:31:14 martin Exp $
 
 A complete list of changes from the NetBSD 6.0.6 release to the NetBSD 6.0.7
 release:
@@ -15443,3 +15443,8 @@ external/gpl3/binutils/dist/bfd/elflink.
 	indirectness first.
 	[joerg, ticket #1543]
 
+sys/arch/amiga/amiga/cc.c			1.27 (patch)
+
+	Fix a spl(9) leak.
+	[msaitoh, ticket #1544]
+



CVS commit: [netbsd-6-0] src/sys/arch/amiga/amiga

2018-04-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Apr 10 11:29:55 UTC 2018

Modified Files:
src/sys/arch/amiga/amiga [netbsd-6-0]: cc.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1544):

sys/arch/amiga/amiga/cc.c: revision 1.27 (patch)

spl leak, found by mootja


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.22.20.1 src/sys/arch/amiga/amiga/cc.c

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



CVS commit: [netbsd-6-0] src/sys/arch/amiga/amiga

2018-04-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Apr 10 11:29:55 UTC 2018

Modified Files:
src/sys/arch/amiga/amiga [netbsd-6-0]: cc.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1544):

sys/arch/amiga/amiga/cc.c: revision 1.27 (patch)

spl leak, found by mootja


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.22.20.1 src/sys/arch/amiga/amiga/cc.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/amiga/amiga/cc.c
diff -u src/sys/arch/amiga/amiga/cc.c:1.22 src/sys/arch/amiga/amiga/cc.c:1.22.20.1
--- src/sys/arch/amiga/amiga/cc.c:1.22	Mon Dec 20 00:25:25 2010
+++ src/sys/arch/amiga/amiga/cc.c	Tue Apr 10 11:29:55 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: cc.c,v 1.22 2010/12/20 00:25:25 matt Exp $	*/
+/*	$NetBSD: cc.c,v 1.22.20.1 2018/04/10 11:29:55 martin Exp $	*/
 
 /*
  * Copyright (c) 1994 Christian E. Hopps
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cc.c,v 1.22 2010/12/20 00:25:25 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cc.c,v 1.22.20.1 2018/04/10 11:29:55 martin Exp $");
 
 #include 
 #include 
@@ -504,9 +504,10 @@ alloc_chipmem(u_long size)
 	while (size > mn->size && mn != (void *)_list)
 		mn = mn->free_link.cqe_next;
 
-	if (mn == (void *)_list)
+	if (mn == (void *)_list) {
+		splx(s);
 		return(NULL);
-
+	}
 	if ((mn->size - size) <= sizeof (*mn)) {
 		/*
 		 * our allocation would not leave room



CVS commit: [netbsd-6-1] src/doc

2018-04-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Apr 10 11:29:28 UTC 2018

Modified Files:
src/doc [netbsd-6-1]: CHANGES-6.1.6

Log Message:
Ticket #1544


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.136 -r1.1.2.137 src/doc/CHANGES-6.1.6

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-6.1.6
diff -u src/doc/CHANGES-6.1.6:1.1.2.136 src/doc/CHANGES-6.1.6:1.1.2.137
--- src/doc/CHANGES-6.1.6:1.1.2.136	Mon Apr  9 13:08:25 2018
+++ src/doc/CHANGES-6.1.6	Tue Apr 10 11:29:28 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.1.6,v 1.1.2.136 2018/04/09 13:08:25 martin Exp $
+# $NetBSD: CHANGES-6.1.6,v 1.1.2.137 2018/04/10 11:29:28 martin Exp $
 
 A complete list of changes from the NetBSD 6.1.5 release to the NetBSD 6.1.6
 release:
@@ -15112,3 +15112,8 @@ external/gpl3/binutils/dist/bfd/elflink.
 	indirectness first.
 	[joerg, ticket #1543]
 
+sys/arch/amiga/amiga/cc.c			1.27 (patch)
+
+	Fix a spl(9) leak.
+	[msaitoh, ticket #1544]
+



CVS commit: [netbsd-6-1] src/doc

2018-04-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Apr 10 11:29:28 UTC 2018

Modified Files:
src/doc [netbsd-6-1]: CHANGES-6.1.6

Log Message:
Ticket #1544


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.136 -r1.1.2.137 src/doc/CHANGES-6.1.6

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



CVS commit: [netbsd-6-1] src/sys/arch/amiga/amiga

2018-04-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Apr 10 11:28:56 UTC 2018

Modified Files:
src/sys/arch/amiga/amiga [netbsd-6-1]: cc.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1544):

sys/arch/amiga/amiga/cc.c: revision 1.27 (patch)

spl leak, found by mootja


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.22.28.1 src/sys/arch/amiga/amiga/cc.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/amiga/amiga/cc.c
diff -u src/sys/arch/amiga/amiga/cc.c:1.22 src/sys/arch/amiga/amiga/cc.c:1.22.28.1
--- src/sys/arch/amiga/amiga/cc.c:1.22	Mon Dec 20 00:25:25 2010
+++ src/sys/arch/amiga/amiga/cc.c	Tue Apr 10 11:28:56 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: cc.c,v 1.22 2010/12/20 00:25:25 matt Exp $	*/
+/*	$NetBSD: cc.c,v 1.22.28.1 2018/04/10 11:28:56 martin Exp $	*/
 
 /*
  * Copyright (c) 1994 Christian E. Hopps
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cc.c,v 1.22 2010/12/20 00:25:25 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cc.c,v 1.22.28.1 2018/04/10 11:28:56 martin Exp $");
 
 #include 
 #include 
@@ -504,9 +504,10 @@ alloc_chipmem(u_long size)
 	while (size > mn->size && mn != (void *)_list)
 		mn = mn->free_link.cqe_next;
 
-	if (mn == (void *)_list)
+	if (mn == (void *)_list) {
+		splx(s);
 		return(NULL);
-
+	}
 	if ((mn->size - size) <= sizeof (*mn)) {
 		/*
 		 * our allocation would not leave room



CVS commit: [netbsd-6] src/doc

2018-04-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Apr 10 11:28:34 UTC 2018

Modified Files:
src/doc [netbsd-6]: CHANGES-6.2

Log Message:
Ticket #1544


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.332 -r1.1.2.333 src/doc/CHANGES-6.2

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



CVS commit: [netbsd-6] src/doc

2018-04-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Apr 10 11:28:34 UTC 2018

Modified Files:
src/doc [netbsd-6]: CHANGES-6.2

Log Message:
Ticket #1544


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.332 -r1.1.2.333 src/doc/CHANGES-6.2

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-6.2
diff -u src/doc/CHANGES-6.2:1.1.2.332 src/doc/CHANGES-6.2:1.1.2.333
--- src/doc/CHANGES-6.2:1.1.2.332	Mon Apr  9 13:08:06 2018
+++ src/doc/CHANGES-6.2	Tue Apr 10 11:28:34 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.2,v 1.1.2.332 2018/04/09 13:08:06 martin Exp $
+# $NetBSD: CHANGES-6.2,v 1.1.2.333 2018/04/10 11:28:34 martin Exp $
 
 A complete list of changes from the 6.1 release until the 6.2 release:
 
@@ -21217,3 +21217,8 @@ external/gpl3/binutils/dist/bfd/elflink.
 	indirectness first.
 	[joerg, ticket #1543]
 
+sys/arch/amiga/amiga/cc.c			1.27 (patch)
+
+	Fix a spl(9) leak.
+	[msaitoh, ticket #1544]
+



CVS commit: [netbsd-6-1] src/sys/arch/amiga/amiga

2018-04-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Apr 10 11:28:56 UTC 2018

Modified Files:
src/sys/arch/amiga/amiga [netbsd-6-1]: cc.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1544):

sys/arch/amiga/amiga/cc.c: revision 1.27 (patch)

spl leak, found by mootja


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.22.28.1 src/sys/arch/amiga/amiga/cc.c

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



CVS commit: [netbsd-6] src/sys/arch/amiga/amiga

2018-04-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Apr 10 11:27:55 UTC 2018

Modified Files:
src/sys/arch/amiga/amiga [netbsd-6]: cc.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1544):

sys/arch/amiga/amiga/cc.c: revision 1.27 (patch)

spl leak, found by mootja


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.22.14.1 src/sys/arch/amiga/amiga/cc.c

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



CVS commit: [netbsd-6] src/sys/arch/amiga/amiga

2018-04-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Apr 10 11:27:55 UTC 2018

Modified Files:
src/sys/arch/amiga/amiga [netbsd-6]: cc.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1544):

sys/arch/amiga/amiga/cc.c: revision 1.27 (patch)

spl leak, found by mootja


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.22.14.1 src/sys/arch/amiga/amiga/cc.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/amiga/amiga/cc.c
diff -u src/sys/arch/amiga/amiga/cc.c:1.22 src/sys/arch/amiga/amiga/cc.c:1.22.14.1
--- src/sys/arch/amiga/amiga/cc.c:1.22	Mon Dec 20 00:25:25 2010
+++ src/sys/arch/amiga/amiga/cc.c	Tue Apr 10 11:27:55 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: cc.c,v 1.22 2010/12/20 00:25:25 matt Exp $	*/
+/*	$NetBSD: cc.c,v 1.22.14.1 2018/04/10 11:27:55 martin Exp $	*/
 
 /*
  * Copyright (c) 1994 Christian E. Hopps
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cc.c,v 1.22 2010/12/20 00:25:25 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cc.c,v 1.22.14.1 2018/04/10 11:27:55 martin Exp $");
 
 #include 
 #include 
@@ -504,9 +504,10 @@ alloc_chipmem(u_long size)
 	while (size > mn->size && mn != (void *)_list)
 		mn = mn->free_link.cqe_next;
 
-	if (mn == (void *)_list)
+	if (mn == (void *)_list) {
+		splx(s);
 		return(NULL);
-
+	}
 	if ((mn->size - size) <= sizeof (*mn)) {
 		/*
 		 * our allocation would not leave room



CVS commit: [netbsd-7-1] src/sys/arch/amiga/amiga

2018-04-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Apr 10 11:18:02 UTC 2018

Modified Files:
src/sys/arch/amiga/amiga [netbsd-7-1]: cc.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1597):
sys/arch/amiga/amiga/cc.c: revision 1.27
spl leak, found by mootja


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.26.16.1 src/sys/arch/amiga/amiga/cc.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/amiga/amiga/cc.c
diff -u src/sys/arch/amiga/amiga/cc.c:1.26 src/sys/arch/amiga/amiga/cc.c:1.26.16.1
--- src/sys/arch/amiga/amiga/cc.c:1.26	Wed Jan 22 00:25:16 2014
+++ src/sys/arch/amiga/amiga/cc.c	Tue Apr 10 11:18:02 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: cc.c,v 1.26 2014/01/22 00:25:16 christos Exp $	*/
+/*	$NetBSD: cc.c,v 1.26.16.1 2018/04/10 11:18:02 martin Exp $	*/
 
 /*
  * Copyright (c) 1994 Christian E. Hopps
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cc.c,v 1.26 2014/01/22 00:25:16 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cc.c,v 1.26.16.1 2018/04/10 11:18:02 martin Exp $");
 
 #include 
 #include 
@@ -503,8 +503,10 @@ alloc_chipmem(u_long size)
 		if (size <= mn->size)
 			break;
 
-	if (mn == NULL)
+	if (mn == NULL) {
+		splx(s);
 		return NULL;
+	}
 
 	if ((mn->size - size) <= sizeof (*mn)) {
 		/*



CVS commit: [netbsd-7-1] src/sys/arch/amiga/amiga

2018-04-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Apr 10 11:18:02 UTC 2018

Modified Files:
src/sys/arch/amiga/amiga [netbsd-7-1]: cc.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1597):
sys/arch/amiga/amiga/cc.c: revision 1.27
spl leak, found by mootja


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.26.16.1 src/sys/arch/amiga/amiga/cc.c

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



CVS commit: src/sys/netinet

2018-04-10 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Apr 10 08:41:14 UTC 2018

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

Log Message:
Remove unused mbuf argument from arpcreate() and arplookup().


To generate a diff of this commit:
cvs rdiff -u -r1.271 -r1.272 src/sys/netinet/if_arp.c

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

Modified files:

Index: src/sys/netinet/if_arp.c
diff -u src/sys/netinet/if_arp.c:1.271 src/sys/netinet/if_arp.c:1.272
--- src/sys/netinet/if_arp.c:1.271	Thu Mar  8 06:48:23 2018
+++ src/sys/netinet/if_arp.c	Tue Apr 10 08:41:14 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_arp.c,v 1.271 2018/03/08 06:48:23 ozaki-r Exp $	*/
+/*	$NetBSD: if_arp.c,v 1.272 2018/04/10 08:41:14 maxv Exp $	*/
 
 /*
  * Copyright (c) 1998, 2000, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.271 2018/03/08 06:48:23 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.272 2018/04/10 08:41:14 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -163,9 +163,9 @@ static struct sockaddr *arp_setgate(stru
 const struct sockaddr *);
 static void arptimer(void *);
 static void arp_settimer(struct llentry *, int);
-static struct llentry *arplookup(struct ifnet *, struct mbuf *,
+static struct llentry *arplookup(struct ifnet *,
 const struct in_addr *, const struct sockaddr *, int);
-static struct llentry *arpcreate(struct ifnet *, struct mbuf *,
+static struct llentry *arpcreate(struct ifnet *,
 const struct in_addr *, const struct sockaddr *, int);
 static void in_arpinput(struct mbuf *);
 static void in_revarpinput(struct mbuf *);
@@ -733,7 +733,7 @@ arpresolve(struct ifnet *ifp, const stru
 
 	KASSERT(m != NULL);
 
-	la = arplookup(ifp, m, NULL, dst, 0);
+	la = arplookup(ifp, NULL, dst, 0);
 	if (la == NULL)
 		goto notfound;
 
@@ -1193,9 +1193,9 @@ in_arpinput(struct mbuf *m)
 		goto reply;
 
 	if (in_hosteq(itaddr, myaddr))
-		la = arpcreate(ifp, m, , NULL, 1);
+		la = arpcreate(ifp, , NULL, 1);
 	else
-		la = arplookup(ifp, m, , NULL, 1);
+		la = arplookup(ifp, , NULL, 1);
 	if (la == NULL)
 		goto reply;
 
@@ -1400,14 +1400,13 @@ out:
  * Lookup or a new address in arptab.
  */
 static struct llentry *
-arplookup(struct ifnet *ifp, struct mbuf *m, const struct in_addr *addr,
+arplookup(struct ifnet *ifp, const struct in_addr *addr,
 const struct sockaddr *sa, int wlock)
 {
 	struct sockaddr_in sin;
 	struct llentry *la;
 	int flags = wlock ? LLE_EXCLUSIVE : 0;
 
-
 	if (sa == NULL) {
 		KASSERT(addr != NULL);
 		sockaddr_in_init(, addr, 0);
@@ -1422,7 +1421,7 @@ arplookup(struct ifnet *ifp, struct mbuf
 }
 
 static struct llentry *
-arpcreate(struct ifnet *ifp, struct mbuf *m, const struct in_addr *addr,
+arpcreate(struct ifnet *ifp, const struct in_addr *addr,
 const struct sockaddr *sa, int wlock)
 {
 	struct sockaddr_in sin;
@@ -1435,7 +1434,7 @@ arpcreate(struct ifnet *ifp, struct mbuf
 		sa = sintocsa();
 	}
 
-	la = arplookup(ifp, m, addr, sa, wlock);
+	la = arplookup(ifp, addr, sa, wlock);
 
 	if (la == NULL) {
 		struct rtentry *rt;



CVS commit: src/sys/netinet

2018-04-10 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Apr 10 08:41:14 UTC 2018

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

Log Message:
Remove unused mbuf argument from arpcreate() and arplookup().


To generate a diff of this commit:
cvs rdiff -u -r1.271 -r1.272 src/sys/netinet/if_arp.c

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



CVS commit: src/sys/netinet

2018-04-10 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Apr 10 08:22:35 UTC 2018

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

Log Message:
Replace comment by KASSERT.


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

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



CVS commit: src/sys/netinet

2018-04-10 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Apr 10 08:22:35 UTC 2018

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

Log Message:
Replace comment by KASSERT.


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

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

Modified files:

Index: src/sys/netinet/igmp.c
diff -u src/sys/netinet/igmp.c:1.66 src/sys/netinet/igmp.c:1.67
--- src/sys/netinet/igmp.c:1.66	Wed Feb  7 11:42:58 2018
+++ src/sys/netinet/igmp.c	Tue Apr 10 08:22:35 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: igmp.c,v 1.66 2018/02/07 11:42:58 maxv Exp $	*/
+/*	$NetBSD: igmp.c,v 1.67 2018/04/10 08:22:35 maxv Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: igmp.c,v 1.66 2018/02/07 11:42:58 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: igmp.c,v 1.67 2018/04/10 08:22:35 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_mrouting.h"
@@ -602,11 +602,8 @@ igmp_sendpkt(struct in_multi *inm, int t
 	MGETHDR(m, M_DONTWAIT, MT_HEADER);
 	if (m == NULL)
 		return;
+	KASSERT(max_linkhdr + sizeof(struct ip) + IGMP_MINLEN <= MHLEN);
 
-	/*
-	 * Assume max_linkhdr + sizeof(struct ip) + IGMP_MINLEN
-	 * is smaller than mbuf size returned by MGETHDR.
-	 */
 	m->m_data += max_linkhdr;
 	m->m_len = sizeof(struct ip) + IGMP_MINLEN;
 	m->m_pkthdr.len = sizeof(struct ip) + IGMP_MINLEN;



CVS commit: src/sys/dev/pci

2018-04-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Apr 10 08:18:38 UTC 2018

Modified Files:
src/sys/dev/pci: if_wmreg.h

Log Message:
 SW PHY Config Enable bit for ICH8 B0 stepping is not bit 1 but bit 0.


To generate a diff of this commit:
cvs rdiff -u -r1.105 -r1.106 src/sys/dev/pci/if_wmreg.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/dev/pci/if_wmreg.h
diff -u src/sys/dev/pci/if_wmreg.h:1.105 src/sys/dev/pci/if_wmreg.h:1.106
--- src/sys/dev/pci/if_wmreg.h:1.105	Wed Nov 22 02:36:52 2017
+++ src/sys/dev/pci/if_wmreg.h	Tue Apr 10 08:18:38 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wmreg.h,v 1.105 2017/11/22 02:36:52 msaitoh Exp $	*/
+/*	$NetBSD: if_wmreg.h,v 1.106 2018/04/10 08:18:38 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -590,8 +590,8 @@ struct livengood_tcpip_ctxdesc {
 #define	FCAL_CONST	0x00c28001	/* Flow Control MAC addr low */
 
 #define	WMREG_FEXTNVM	0x0028	/* Future Extended NVM register */
-#define	FEXTNVM_SW_CONFIG	__BIT(1)
-#define	FEXTNVM_SW_CONFIG_ICH8M	__BIT(27)
+#define	FEXTNVM_SW_CONFIG	__BIT(0)  /* SW PHY Config En (ICH8 B0) */
+#define	FEXTNVM_SW_CONFIG_ICH8M	__BIT(27) /* SW PHY Config En (>= ICH8 B1) */
 
 #define	WMREG_FCAH	0x002c	/* Flow Control Address High */
 #define	FCAH_CONST	0x0100	/* Flow Control MAC addr high */



CVS commit: src/sys/dev/pci

2018-04-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Apr 10 08:18:38 UTC 2018

Modified Files:
src/sys/dev/pci: if_wmreg.h

Log Message:
 SW PHY Config Enable bit for ICH8 B0 stepping is not bit 1 but bit 0.


To generate a diff of this commit:
cvs rdiff -u -r1.105 -r1.106 src/sys/dev/pci/if_wmreg.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

2018-04-10 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Tue Apr 10 08:07:48 UTC 2018

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

Log Message:
ticket 726


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

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

Modified files:

Index: src/doc/CHANGES-8.0
diff -u src/doc/CHANGES-8.0:1.1.2.174 src/doc/CHANGES-8.0:1.1.2.175
--- src/doc/CHANGES-8.0:1.1.2.174	Tue Apr 10 06:54:58 2018
+++ src/doc/CHANGES-8.0	Tue Apr 10 08:07:48 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.0,v 1.1.2.174 2018/04/10 06:54:58 martin Exp $
+# $NetBSD: CHANGES-8.0,v 1.1.2.175 2018/04/10 08:07:48 bouyer Exp $
 
 A complete list of changes from the initial NetBSD 8.0 branch on 2017-06-04
 until the 8.0 release:
@@ -11191,3 +11191,13 @@ sys/dev/pci/pcidevs_data.h			(regen)
 	- Add Intel Coffee Lake internal graphics devices. From ark.intel.com.
 	[msaitoh, ticket #723]
 
+tests/usr.bin/shmif_dumpbus/d_pcap.out.bz2.uue	1.3
+tests/usr.bin/shmif_dumpbus/t_basic.sh		1.9
+
+	Use tcpdump -n to avoid reverse DNS lookup. There is no point in
+	having different results from running this test in a networked vs.
+	a non-networked environment.
+	Adjust golden output accordingly.
+	Fixes PR 53150.
+	[martin, ticket #726]
+



CVS commit: [netbsd-8] src/doc

2018-04-10 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Tue Apr 10 08:07:48 UTC 2018

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

Log Message:
ticket 726


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

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



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

2018-04-10 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Tue Apr 10 08:06:46 UTC 2018

Modified Files:
src/tests/usr.bin/shmif_dumpbus [netbsd-8]: d_pcap.out.bz2.uue
t_basic.sh

Log Message:
Pull up following revision(s) (requested by martin in ticket #726):
tests/usr.bin/shmif_dumpbus/d_pcap.out.bz2.uue: revision 1.3
tests/usr.bin/shmif_dumpbus/t_basic.sh: revision 1.9
Use tcpdump -n to avoid reverse DNS lookup. There is no point in having
different results from running this test in a networked vs. a non-networked
environment.
Adjust golden output accordingly.
Fixes PR 53150.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.2.36.1 \
src/tests/usr.bin/shmif_dumpbus/d_pcap.out.bz2.uue
cvs rdiff -u -r1.8 -r1.8.20.1 src/tests/usr.bin/shmif_dumpbus/t_basic.sh

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

Modified files:

Index: src/tests/usr.bin/shmif_dumpbus/d_pcap.out.bz2.uue
diff -u src/tests/usr.bin/shmif_dumpbus/d_pcap.out.bz2.uue:1.2 src/tests/usr.bin/shmif_dumpbus/d_pcap.out.bz2.uue:1.2.36.1
--- src/tests/usr.bin/shmif_dumpbus/d_pcap.out.bz2.uue:1.2	Sun Mar 13 15:40:01 2011
+++ src/tests/usr.bin/shmif_dumpbus/d_pcap.out.bz2.uue	Tue Apr 10 08:06:46 2018
@@ -1,104 +1,104 @@
 begin 644 d_pcap.out.bz2
-M0EIH.3%!62936=O8'&4!%NW?@$`00`5_\0@B0``.Y_X@8"=^\@0```!P
-M```![XY0O$\'N'"@P'!M=O2E=5*>#>[0M50X0`Q@V@,$-!@@$%T!A:`P
-MNATWD`,83$T&",0R,)AE/4?O1O52E*@P`$`820U`]4JH-#(#0-`)/5*JFU,:
-MAIDQ--,`("DJ$*>E@!B:9'J>H%0J0>BI0``:`#P[E![R+ZY%2,<
-M46V)*F;;EK75-K*+/K6_NM*C]*2HP@P@TB)E$3A/FJ+(T01D
-MEE3)*^*HLJRIC"2U2*M!2L$O=47PI1'PJ+)#2".()^T@)^44*>9`3@D/Q2`G
-MVD!-(%K\?\`!`DD`
-M`)"```2$
-M0```
+M0EIH.3%!629366U$3Z$!&(O?@$`00`=_\0@B0``.Y?X@8">^\@0X
+M^&4<'SPFY'D+@IX.TN4HJA<%E%4J&$`.,`P65!@N@8+0,%T#!`
+MT[R`#&$Q-!@C$,C"8=3'[T;U2JBJ&``3`!)#4FGM4J4`!HT``D]5*D#]2`!B
+M```I*II,]4*&@`9`::!4*FI--ZJHT`-#30`X\E!]A%ZY%2,=C56U+;$E
+M3-MQ:URIM8V-HU*590V@VBQ9^:W=6E1^%)48080:1$RB)V3XJBR-$$9)94R2
+MOV5%E65,826J15H*5@ERHOA2B.5%DAI!':"?E("?=%"GK("?"0$Z)#2`G]2`
+MTUJJM?S_``0))```
+M```"0@``$A``
+M``$`
 M
 M
 M
 M
-M\]_U>^N]_A_'^7[OYZ?8#!^`0.`X
-M-W=&9F```]]`-/L!@_`)))``*?;[]```
-M#P``!0```'./'CQX\]]/ODW8-=SN^=SF_;]WWM/UWKN][\SQTV<,++9E55"JRD964C
-M*RD964C*RD964C*RD964C*RD969F4C*RF5F:222ZZZ22ZZZ2
-M22215569E5ZA"1F835JZZ222_2ZZ22ZZZ22Z
-MZZ22ZZZ557)NPDA8BUYY[\["YG,W,XZ
-M0ZI3(:35+77/7,ERN5RNJ#J*U!J646HJIJB32D)4$%2$(L$/23K?/G?/O?.[
-MWWI()MWWSN]]Z$D?"0.)(_CSGOG+V]`#ODDD@``!(+:M@MX%L@MX%L%M
-M@MX%L@MX%L%M@MX%L@MX%L%M@MX%L%M@;NZ```=MMJ2#I))T=_.][WO3=W=U
-MX\[[50XD`D),$@##G.6\;VXXX\MC-"@U#LAV@]U!V@Z0Z0\J.DV39-DV39-9
-M-O,<9-DV39-DV3:>9QDT'.R;)LFR;)LFDT','*'=!\0?$'U!V@X@X@X@X@X@
-MX@X@X@X@X@X@X@X@X@Y(.0.(Q$TEJ+46HM1]?9/LT,I35%FD1K8&)PC7A-DV
-M3:U59-DV39%1*@^H/D#X@^H.(/J#B#B#B#B#B#B#B#B#B#B#B#B#B#D#B#B#
-MB#D]/4GJ:,EB*DDTDQ@S1:AW$@(KX(2E50B555WWWO>-Z?'Q^>6QB11WO;[C
-M>GU]?7EL8?S`2H!B2*$>]Z_9QZ?GQ^>6QAY)(H0;0D`"/>]>9MZ?GY^>6QF@
-M$"H$=[VWFGI]?7UY;&)'>]ON:>GU]?7EL9HH\D(H0>]Z]9MZ?GY^>6QFBCP)
-M*A!:$@6"0`520``'O>MXWI^?GYY;&:*/"%0@][UZS;T_/S\\MC#P@*$%`EY]
-M?7UYY\_/S,SY\^?*`/GDDDG0``$@MJV"W@6P6V"W@6R"W@6P6V"W@6R"W@6P
-M6V"W@6R"W@6P6V!N[H``!O;;62#I))T=[WO>]'.
-M$O,X]N../+]JJHT40$`6644]1,S$9F(S,1F8C,Q%
-M$DN9U\@``2"VK8+>!;!;8+>!;(+>!;!=XMW>6EL@MX%L%M@MX%L7=WEMI!;8&[N@`
-M`&[VVLP=&9F7IWO>][WI;;:\[YTAPPYSE\SC\OVJJC11A\D`8(#NAWH>
-M!7B#I#J#B%W1R\,1F8C,Q&9B,S$9F(666"+++!%EE@BB27W./CZ_/SR_:MKV
-MKIX05#ITQ&4BJ15(JD52*I%4BJ16>>>;SKGKKSKSOK;GJVNW3P@J&4BJ15(J
-MD52*I%4BJ15(Z>>>;SKKXXX_/+]JJT80$!0@LH$44"**$S$S$S$S$S$S$Z>G
-MIZ7,Z^../SR_:JM&$!`4(+."2+!%F)F)F)F)F)F)F)F!\\OVJK
-M1A`0%""R@3,3,3,3.1)<$X8F8110!0R27,X]N./SR_:JM$!`4(,));W

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

2018-04-10 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Tue Apr 10 08:06:46 UTC 2018

Modified Files:
src/tests/usr.bin/shmif_dumpbus [netbsd-8]: d_pcap.out.bz2.uue
t_basic.sh

Log Message:
Pull up following revision(s) (requested by martin in ticket #726):
tests/usr.bin/shmif_dumpbus/d_pcap.out.bz2.uue: revision 1.3
tests/usr.bin/shmif_dumpbus/t_basic.sh: revision 1.9
Use tcpdump -n to avoid reverse DNS lookup. There is no point in having
different results from running this test in a networked vs. a non-networked
environment.
Adjust golden output accordingly.
Fixes PR 53150.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.2.36.1 \
src/tests/usr.bin/shmif_dumpbus/d_pcap.out.bz2.uue
cvs rdiff -u -r1.8 -r1.8.20.1 src/tests/usr.bin/shmif_dumpbus/t_basic.sh

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



CVS commit: src/sys/net80211

2018-04-10 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Apr 10 07:53:36 UTC 2018

Modified Files:
src/sys/net80211: ieee80211_crypto.c

Log Message:
Improve an XXX of mine, and fix one stat.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/net80211/ieee80211_crypto.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/net80211/ieee80211_crypto.c
diff -u src/sys/net80211/ieee80211_crypto.c:1.21 src/sys/net80211/ieee80211_crypto.c:1.22
--- src/sys/net80211/ieee80211_crypto.c:1.21	Fri Jan 19 07:52:37 2018
+++ src/sys/net80211/ieee80211_crypto.c	Tue Apr 10 07:53:36 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ieee80211_crypto.c,v 1.21 2018/01/19 07:52:37 maxv Exp $	*/
+/*	$NetBSD: ieee80211_crypto.c,v 1.22 2018/04/10 07:53:36 maxv Exp $	*/
 
 /*
  * Copyright (c) 2001 Atsushi Onoe
@@ -37,7 +37,7 @@
 __FBSDID("$FreeBSD: src/sys/net80211/ieee80211_crypto.c,v 1.12 2005/08/08 18:46:35 sam Exp $");
 #endif
 #ifdef __NetBSD__
-__KERNEL_RCSID(0, "$NetBSD: ieee80211_crypto.c,v 1.21 2018/01/19 07:52:37 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ieee80211_crypto.c,v 1.22 2018/04/10 07:53:36 maxv Exp $");
 #endif
 
 #ifdef _KERNEL_OPT
@@ -529,6 +529,11 @@ ieee80211_crypto_setkey(struct ieee80211
 
 /*
  * Add privacy headers appropriate for the specified key.
+ *
+ * XXX XXX XXX: Here we modify 'm', and potentially reallocate it. We
+ * should pass back to the caller the updated pointer to avoid
+ * use-after-frees. This can be done by changing the argument to be **m,
+ * but many drivers will have to be changed accordingly.
  */
 struct ieee80211_key *
 ieee80211_crypto_encap(struct ieee80211com *ic, struct ieee80211_node *ni,
@@ -581,8 +586,6 @@ ieee80211_crypto_encap(struct ieee80211c
 	hdr = mtod(m, u_int8_t *);
 	memmove(hdr, hdr + cip->ic_header, hdrlen);
 
-	/* XXX pass the updated pointer back to the caller */
-
 	return (cip->ic_encap(k, m, keyid<<6) ? k : NULL);
 }
 
@@ -647,7 +650,7 @@ ieee80211_crypto_decap(struct ieee80211c
 		IEEE80211_DPRINTF(ic, IEEE80211_MSG_CRYPTO,
 		"[%s] unable to pullup %s header\n",
 		ether_sprintf(wh->i_addr2), cip->ic_name);
-		ic->ic_stats.is_rx_wepfail++;	/* XXX */
+		ic->ic_stats.is_rx_tooshort++;
 		return NULL;
 	}
 



CVS commit: src/sys/net80211

2018-04-10 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Apr 10 07:53:36 UTC 2018

Modified Files:
src/sys/net80211: ieee80211_crypto.c

Log Message:
Improve an XXX of mine, and fix one stat.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/net80211/ieee80211_crypto.c

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



CVS commit: src/tests/net/if_bridge

2018-04-10 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue Apr 10 07:09:00 UTC 2018

Modified Files:
src/tests/net/if_bridge: t_rtable.sh

Log Message:
Add a test case for bridge_rtdelete


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/net/if_bridge/t_rtable.sh

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



CVS commit: src/tests/net/if_bridge

2018-04-10 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue Apr 10 07:09:00 UTC 2018

Modified Files:
src/tests/net/if_bridge: t_rtable.sh

Log Message:
Add a test case for bridge_rtdelete


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/net/if_bridge/t_rtable.sh

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

Modified files:

Index: src/tests/net/if_bridge/t_rtable.sh
diff -u src/tests/net/if_bridge/t_rtable.sh:1.1 src/tests/net/if_bridge/t_rtable.sh:1.2
--- src/tests/net/if_bridge/t_rtable.sh:1.1	Sat Mar 11 04:24:52 2017
+++ src/tests/net/if_bridge/t_rtable.sh	Tue Apr 10 07:09:00 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: t_rtable.sh,v 1.1 2017/03/11 04:24:52 ozaki-r Exp $
+#	$NetBSD: t_rtable.sh,v 1.2 2018/04/10 07:09:00 ozaki-r Exp $
 #
 # Copyright (c) 2017 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -342,6 +342,76 @@ bridge_rtable_maxaddr_cleanup()
 }
 
 
+atf_test_case bridge_rtable_delete_member cleanup
+bridge_rtable_delete_member_head()
+{
+
+	atf_set "descr" "Tests belonging rtable entries are removed on deleting an interface"
+	atf_set "require.progs" "rump_server"
+}
+
+bridge_rtable_delete_member_body()
+{
+	local addr10= addr30= addr11= addr31=
+	local n=
+
+	setup
+	setup_bridge
+
+	# Add extra interfaces and addresses
+	export RUMP_SERVER=$SOCK1
+	rump_server_add_iface $SOCK1 shmif1 bus1
+	atf_check -s exit:0 rump.ifconfig shmif1 10.0.0.11/24
+	atf_check -s exit:0 rump.ifconfig -w 10
+
+	export RUMP_SERVER=$SOCK3
+	rump_server_add_iface $SOCK3 shmif1 bus2
+	atf_check -s exit:0 rump.ifconfig shmif1 10.0.0.12/24
+	atf_check -s exit:0 rump.ifconfig -w 10
+
+	# Get MAC addresses of the endpoints.
+	addr10=$(get_macaddr $SOCK1 shmif0)
+	addr30=$(get_macaddr $SOCK3 shmif0)
+	addr11=$(get_macaddr $SOCK1 shmif1)
+	addr31=$(get_macaddr $SOCK3 shmif1)
+
+	# Make the bridge learn the MAC addresses of the endpoints.
+	export RUMP_SERVER=$SOCK1
+	atf_check -s exit:0 -o ignore rump.ping -n -w $TIMEOUT -c 1 10.0.0.12
+	export RUMP_SERVER=$SOCK3
+	atf_check -s exit:0 -o ignore rump.ping -n -w $TIMEOUT -c 1 10.0.0.11
+
+	export RUMP_SERVER=$SOCK2
+	export LD_PRELOAD=/usr/lib/librumphijack.so
+	$DEBUG && /sbin/brconfig bridge0
+	atf_check -s exit:0 -o match:"$addr10 shmif0" /sbin/brconfig bridge0
+	atf_check -s exit:0 -o match:"$addr11 shmif0" /sbin/brconfig bridge0
+	atf_check -s exit:0 -o match:"$addr30 shmif1" /sbin/brconfig bridge0
+	atf_check -s exit:0 -o match:"$addr31 shmif1" /sbin/brconfig bridge0
+
+	atf_check -s exit:0 -o ignore /sbin/brconfig bridge0 delete shmif0
+	atf_check -s exit:0 -o not-match:"$addr10 shmif0" /sbin/brconfig bridge0
+	atf_check -s exit:0 -o not-match:"$addr11 shmif0" /sbin/brconfig bridge0
+	atf_check -s exit:0 -o match:"$addr30 shmif1" /sbin/brconfig bridge0
+	atf_check -s exit:0 -o match:"$addr31 shmif1" /sbin/brconfig bridge0
+
+	atf_check -s exit:0 -o ignore /sbin/brconfig bridge0 delete shmif1
+	atf_check -s exit:0 -o not-match:"$addr10 shmif0" /sbin/brconfig bridge0
+	atf_check -s exit:0 -o not-match:"$addr11 shmif0" /sbin/brconfig bridge0
+	atf_check -s exit:0 -o not-match:"$addr30 shmif1" /sbin/brconfig bridge0
+	atf_check -s exit:0 -o not-match:"$addr31 shmif1" /sbin/brconfig bridge0
+
+	rump_server_destroy_ifaces
+}
+
+bridge_rtable_delete_member_cleanup()
+{
+
+	$DEBUG && dump
+	cleanup
+}
+
+
 atf_init_test_cases()
 {
 
@@ -349,5 +419,6 @@ atf_init_test_cases()
 	atf_add_test_case bridge_rtable_flush
 	atf_add_test_case bridge_rtable_timeout
 	atf_add_test_case bridge_rtable_maxaddr
+	atf_add_test_case bridge_rtable_delete_member
 	# TODO: brconfig static/flushall/discover/learn
 }



CVS commit: src/sys/net

2018-04-10 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue Apr 10 07:05:39 UTC 2018

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

Log Message:
Fix bridge_rtdelete

It removes a rtable entry that belongs to a specified interface, however, its
original behavior was to delete all belonging entries.  Restore the original
behavior.


To generate a diff of this commit:
cvs rdiff -u -r1.148 -r1.149 src/sys/net/if_bridge.c

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

Modified files:

Index: src/sys/net/if_bridge.c
diff -u src/sys/net/if_bridge.c:1.148 src/sys/net/if_bridge.c:1.149
--- src/sys/net/if_bridge.c:1.148	Mon Jan 15 09:49:16 2018
+++ src/sys/net/if_bridge.c	Tue Apr 10 07:05:39 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bridge.c,v 1.148 2018/01/15 09:49:16 maxv Exp $	*/
+/*	$NetBSD: if_bridge.c,v 1.149 2018/04/10 07:05:39 ozaki-r Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -80,7 +80,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.148 2018/01/15 09:49:16 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.149 2018/04/10 07:05:39 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_bridge_ipf.h"
@@ -2299,6 +2299,8 @@ bridge_rtdelete(struct bridge_softc *sc,
 {
 	struct bridge_rtnode *brt;
 
+	/* XXX pserialize_perform for each entry is slow */
+again:
 	BRIDGE_RT_LOCK(sc);
 	LIST_FOREACH(brt, >sc_rtlist, brt_list) {
 		if (brt->brt_ifp == ifp)
@@ -2313,6 +2315,8 @@ bridge_rtdelete(struct bridge_softc *sc,
 	BRIDGE_RT_UNLOCK(sc);
 
 	bridge_rtnode_destroy(brt);
+
+	goto again;
 }
 
 /*



CVS commit: src/sys/net

2018-04-10 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue Apr 10 07:05:39 UTC 2018

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

Log Message:
Fix bridge_rtdelete

It removes a rtable entry that belongs to a specified interface, however, its
original behavior was to delete all belonging entries.  Restore the original
behavior.


To generate a diff of this commit:
cvs rdiff -u -r1.148 -r1.149 src/sys/net/if_bridge.c

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



CVS commit: [netbsd-8] src/doc

2018-04-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Apr 10 06:54:58 UTC 2018

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

Log Message:
Ammend ticket #724


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

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

2018-04-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Apr 10 06:54:58 UTC 2018

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

Log Message:
Ammend ticket #724


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

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

Modified files:

Index: src/doc/CHANGES-8.0
diff -u src/doc/CHANGES-8.0:1.1.2.173 src/doc/CHANGES-8.0:1.1.2.174
--- src/doc/CHANGES-8.0:1.1.2.173	Mon Apr  9 18:23:33 2018
+++ src/doc/CHANGES-8.0	Tue Apr 10 06:54:58 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.0,v 1.1.2.173 2018/04/09 18:23:33 martin Exp $
+# $NetBSD: CHANGES-8.0,v 1.1.2.174 2018/04/10 06:54:58 martin Exp $
 
 A complete list of changes from the initial NetBSD 8.0 branch on 2017-06-04
 until the 8.0 release:
@@ -11052,7 +11052,7 @@ sys/netinet6/udp6_usrreq.c			1.138
 sys/netipsec/keysock.c1.63
 sys/sys/socketvar.h1.151
 tests/lib/libc/sys/t_recvmmsg.c			1.2
-tests/net/icmp/t_ping.c1.18 - 1.20, 1.22, 1.23
+tests/net/icmp/t_ping.c1.18 - 1.23
 
 	socket: report receive buffer overflows
 
@@ -11062,11 +11062,12 @@ tests/net/icmp/t_ping.c1.18 - 1.20, 
 	soroverflow().
 	Add soroverflow() to raw_input().
 
+	Fix a printf(3)-like format in ATF ICMP t_ping.c
+
 	This allows userland to detect route(4) overflows so it can re-sync
 	with the current state.
 
 	rtsock: log dropped messages that we cannot report to userland
-
 	[roy, ticket #724]
 
 sys/net/if_l2tp.c1.21



CVS commit: [netbsd-8] src/tests/net/icmp

2018-04-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Apr 10 06:54:37 UTC 2018

Modified Files:
src/tests/net/icmp [netbsd-8]: t_ping.c

Log Message:
Additionally pull up the following revision for ticket #724:

tests/net/icmp/t_ping.c 1.21

Fix a printf(3)-like format in ATF ICMP t_ping.c


To generate a diff of this commit:
cvs rdiff -u -r1.17.6.1 -r1.17.6.2 src/tests/net/icmp/t_ping.c

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

Modified files:

Index: src/tests/net/icmp/t_ping.c
diff -u src/tests/net/icmp/t_ping.c:1.17.6.1 src/tests/net/icmp/t_ping.c:1.17.6.2
--- src/tests/net/icmp/t_ping.c:1.17.6.1	Mon Apr  9 13:34:10 2018
+++ src/tests/net/icmp/t_ping.c	Tue Apr 10 06:54:37 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ping.c,v 1.17.6.1 2018/04/09 13:34:10 bouyer Exp $	*/
+/*	$NetBSD: t_ping.c,v 1.17.6.2 2018/04/10 06:54:37 martin Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: t_ping.c,v 1.17.6.1 2018/04/09 13:34:10 bouyer Exp $");
+__RCSID("$NetBSD: t_ping.c,v 1.17.6.2 2018/04/10 06:54:37 martin Exp $");
 #endif /* not lint */
 
 #include 
@@ -198,7 +198,7 @@ doping(const char *target, int loops, u_
 		}
 		if (n == -1 && (errno == EAGAIN || errno == ENOBUFS))
 			continue;
-		atf_tc_fail_errno("recv failed (n == %d)", n);
+		atf_tc_fail_errno("recv failed (n == %zd)", n);
 	}
 
 	rump_sys_close(s);



CVS commit: [netbsd-8] src/tests/net/icmp

2018-04-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Apr 10 06:54:37 UTC 2018

Modified Files:
src/tests/net/icmp [netbsd-8]: t_ping.c

Log Message:
Additionally pull up the following revision for ticket #724:

tests/net/icmp/t_ping.c 1.21

Fix a printf(3)-like format in ATF ICMP t_ping.c


To generate a diff of this commit:
cvs rdiff -u -r1.17.6.1 -r1.17.6.2 src/tests/net/icmp/t_ping.c

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



CVS commit: src/doc

2018-04-10 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Apr 10 06:32:23 UTC 2018

Modified Files:
src/doc: TODO.npf

Log Message:
add two entries


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/doc/TODO.npf

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

Modified files:

Index: src/doc/TODO.npf
diff -u src/doc/TODO.npf:1.1 src/doc/TODO.npf:1.2
--- src/doc/TODO.npf:1.1	Sun Apr  8 08:57:37 2018
+++ src/doc/TODO.npf	Tue Apr 10 06:32:23 2018
@@ -45,3 +45,8 @@ Another TODO list is available here:
it so that it can be added in third-party software, like:
https://github.com/squid-cache/squid/blob/5b74111aff8948e869959113241adada0cd488c2/src/ip/Intercept.cc#L263
 
+-- support IPv6 jumbograms
+
+-- support large IPv6 options, as explained here:
+   http://mail-index.netbsd.org/tech-net/2018/04/08/msg006786.html
+   But it's not a big problem - perhaps we don't care at all.



CVS commit: src/doc

2018-04-10 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Apr 10 06:32:23 UTC 2018

Modified Files:
src/doc: TODO.npf

Log Message:
add two entries


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/doc/TODO.npf

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