CVS commit: [pgoyette-compat] src/sys/compat/common

2018-05-03 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri May  4 02:38:46 UTC 2018

Modified Files:
src/sys/compat/common [pgoyette-compat]: uipc_syscalls_43.c

Log Message:
Merge rev 1.49 from HEAD


To generate a diff of this commit:
cvs rdiff -u -r1.47.14.2 -r1.47.14.3 src/sys/compat/common/uipc_syscalls_43.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/compat/common/uipc_syscalls_43.c
diff -u src/sys/compat/common/uipc_syscalls_43.c:1.47.14.2 src/sys/compat/common/uipc_syscalls_43.c:1.47.14.3
--- src/sys/compat/common/uipc_syscalls_43.c:1.47.14.2	Tue Apr 17 00:02:58 2018
+++ src/sys/compat/common/uipc_syscalls_43.c	Fri May  4 02:38:46 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_syscalls_43.c,v 1.47.14.2 2018/04/17 00:02:58 pgoyette Exp $	*/
+/*	$NetBSD: uipc_syscalls_43.c,v 1.47.14.3 2018/05/04 02:38:46 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1990, 1993
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls_43.c,v 1.47.14.2 2018/04/17 00:02:58 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls_43.c,v 1.47.14.3 2018/05/04 02:38:46 pgoyette Exp $");
 
 #include 
 #include 
@@ -233,7 +233,7 @@ compat_43_sys_recvmsg(struct lwp *l, con
 	msg.msg_iov	= omsg.msg_iov;
 	msg.msg_flags	= (SCARG(uap, flags) & MSG_USERFLAGS) | MSG_IOVUSRSPACE;
 
-	error = do_sys_recvmsg(l, SCARG(uap, s), , NULL, 0, ,
+	error = do_sys_recvmsg(l, SCARG(uap, s), , NULL, ,
 	omsg.msg_accrights != NULL ?  : NULL, retval);
 	if (error != 0)
 		return error;
@@ -380,7 +380,7 @@ compat_43_sys_sendmsg(struct lwp *l, con
 		goto bad;
 
 	return do_sys_sendmsg(l, SCARG(uap, s), , SCARG(uap, flags),
-	NULL, 0, retval);
+	retval);
 
 bad:
 	if (nam != NULL)



CVS commit: [pgoyette-compat] src/sys/compat/common

2018-05-03 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri May  4 02:38:46 UTC 2018

Modified Files:
src/sys/compat/common [pgoyette-compat]: uipc_syscalls_43.c

Log Message:
Merge rev 1.49 from HEAD


To generate a diff of this commit:
cvs rdiff -u -r1.47.14.2 -r1.47.14.3 src/sys/compat/common/uipc_syscalls_43.c

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



CVS commit: src/sys/arch/atari/stand/keymaps

2018-05-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri May  4 00:36:16 UTC 2018

Modified Files:
src/sys/arch/atari/stand/keymaps/de: Makefile
src/sys/arch/atari/stand/keymaps/fr: Makefile
src/sys/arch/atari/stand/keymaps/uk: Makefile
src/sys/arch/atari/stand/keymaps/us: Makefile

Log Message:
remove bsd.hostinit.mk


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/atari/stand/keymaps/de/Makefile
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/atari/stand/keymaps/fr/Makefile
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/atari/stand/keymaps/uk/Makefile
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/atari/stand/keymaps/us/Makefile

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/atari/stand/keymaps/de/Makefile
diff -u src/sys/arch/atari/stand/keymaps/de/Makefile:1.3 src/sys/arch/atari/stand/keymaps/de/Makefile:1.4
--- src/sys/arch/atari/stand/keymaps/de/Makefile:1.3	Tue May  1 15:59:45 2018
+++ src/sys/arch/atari/stand/keymaps/de/Makefile	Thu May  3 20:36:16 2018
@@ -1,10 +1,6 @@
-# $NetBSD: Makefile,v 1.3 2018/05/01 19:59:45 christos Exp $
-
-.include 
+# $NetBSD: Makefile,v 1.4 2018/05/04 00:36:16 christos Exp $
 
 HOSTPROG=de-kbdmap
 MAP=de.map
-MAN=
 
 .include 
-

Index: src/sys/arch/atari/stand/keymaps/fr/Makefile
diff -u src/sys/arch/atari/stand/keymaps/fr/Makefile:1.3 src/sys/arch/atari/stand/keymaps/fr/Makefile:1.4
--- src/sys/arch/atari/stand/keymaps/fr/Makefile:1.3	Tue May  1 15:59:45 2018
+++ src/sys/arch/atari/stand/keymaps/fr/Makefile	Thu May  3 20:36:16 2018
@@ -1,10 +1,6 @@
-# $NetBSD: Makefile,v 1.3 2018/05/01 19:59:45 christos Exp $
-
-.include 
+# $NetBSD: Makefile,v 1.4 2018/05/04 00:36:16 christos Exp $
 
 HOSTPROG=fr-kbdmap
 MAP=fr.map
-MAN=
 
 .include 
-

Index: src/sys/arch/atari/stand/keymaps/uk/Makefile
diff -u src/sys/arch/atari/stand/keymaps/uk/Makefile:1.3 src/sys/arch/atari/stand/keymaps/uk/Makefile:1.4
--- src/sys/arch/atari/stand/keymaps/uk/Makefile:1.3	Tue May  1 15:59:45 2018
+++ src/sys/arch/atari/stand/keymaps/uk/Makefile	Thu May  3 20:36:16 2018
@@ -1,10 +1,6 @@
-# $NetBSD: Makefile,v 1.3 2018/05/01 19:59:45 christos Exp $
-
-.include 
+# $NetBSD: Makefile,v 1.4 2018/05/04 00:36:16 christos Exp $
 
 HOSTPROG=uk-kbdmap
 MAP=uk.map
-MAN=
 
 .include 
-

Index: src/sys/arch/atari/stand/keymaps/us/Makefile
diff -u src/sys/arch/atari/stand/keymaps/us/Makefile:1.3 src/sys/arch/atari/stand/keymaps/us/Makefile:1.4
--- src/sys/arch/atari/stand/keymaps/us/Makefile:1.3	Tue May  1 15:59:45 2018
+++ src/sys/arch/atari/stand/keymaps/us/Makefile	Thu May  3 20:36:16 2018
@@ -1,10 +1,6 @@
-# $NetBSD: Makefile,v 1.3 2018/05/01 19:59:45 christos Exp $
-
-.include 
+# $NetBSD: Makefile,v 1.4 2018/05/04 00:36:16 christos Exp $
 
 HOSTPROG=us-kbdmap
 MAP=us.map
-MAN=
 
 .include 
-



CVS commit: src/sys/arch/atari/stand/keymaps

2018-05-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri May  4 00:36:16 UTC 2018

Modified Files:
src/sys/arch/atari/stand/keymaps/de: Makefile
src/sys/arch/atari/stand/keymaps/fr: Makefile
src/sys/arch/atari/stand/keymaps/uk: Makefile
src/sys/arch/atari/stand/keymaps/us: Makefile

Log Message:
remove bsd.hostinit.mk


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/atari/stand/keymaps/de/Makefile
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/atari/stand/keymaps/fr/Makefile
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/atari/stand/keymaps/uk/Makefile
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/atari/stand/keymaps/us/Makefile

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



CVS commit: src/sys/arch/amiga/stand/loadkmap

2018-05-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri May  4 00:33:48 UTC 2018

Modified Files:
src/sys/arch/amiga/stand/loadkmap/din: Makefile
src/sys/arch/amiga/stand/loadkmap/es: Makefile
src/sys/arch/amiga/stand/loadkmap/fr: Makefile
src/sys/arch/amiga/stand/loadkmap/pl_din: Makefile
src/sys/arch/amiga/stand/loadkmap/pl_us: Makefile
src/sys/arch/amiga/stand/loadkmap/sw: Makefile
src/sys/arch/amiga/stand/loadkmap/us: Makefile

Log Message:
remove bsd.hostinit.mk; it breaks install.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/amiga/stand/loadkmap/din/Makefile
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/amiga/stand/loadkmap/es/Makefile
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/amiga/stand/loadkmap/fr/Makefile
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/amiga/stand/loadkmap/pl_din/Makefile
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/amiga/stand/loadkmap/pl_us/Makefile
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/amiga/stand/loadkmap/sw/Makefile
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/amiga/stand/loadkmap/us/Makefile

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/stand/loadkmap/din/Makefile
diff -u src/sys/arch/amiga/stand/loadkmap/din/Makefile:1.9 src/sys/arch/amiga/stand/loadkmap/din/Makefile:1.10
--- src/sys/arch/amiga/stand/loadkmap/din/Makefile:1.9	Tue May  1 16:15:11 2018
+++ src/sys/arch/amiga/stand/loadkmap/din/Makefile	Thu May  3 20:33:48 2018
@@ -1,6 +1,5 @@
-# $NetBSD: Makefile,v 1.9 2018/05/01 20:15:11 christos Exp $
+# $NetBSD: Makefile,v 1.10 2018/05/04 00:33:48 christos Exp $
 
-.include 
 
 HOSTPROG=	din-kbdmap
 FILES=		din.map

Index: src/sys/arch/amiga/stand/loadkmap/es/Makefile
diff -u src/sys/arch/amiga/stand/loadkmap/es/Makefile:1.6 src/sys/arch/amiga/stand/loadkmap/es/Makefile:1.7
--- src/sys/arch/amiga/stand/loadkmap/es/Makefile:1.6	Tue May  1 16:15:12 2018
+++ src/sys/arch/amiga/stand/loadkmap/es/Makefile	Thu May  3 20:33:48 2018
@@ -1,6 +1,4 @@
-# $NetBSD: Makefile,v 1.6 2018/05/01 20:15:12 christos Exp $
-
-.include 
+# $NetBSD: Makefile,v 1.7 2018/05/04 00:33:48 christos Exp $
 
 HOSTPROG=	es-kbdmap
 FILES=		es.map

Index: src/sys/arch/amiga/stand/loadkmap/fr/Makefile
diff -u src/sys/arch/amiga/stand/loadkmap/fr/Makefile:1.6 src/sys/arch/amiga/stand/loadkmap/fr/Makefile:1.7
--- src/sys/arch/amiga/stand/loadkmap/fr/Makefile:1.6	Tue May  1 16:15:12 2018
+++ src/sys/arch/amiga/stand/loadkmap/fr/Makefile	Thu May  3 20:33:48 2018
@@ -1,6 +1,4 @@
-# $NetBSD: Makefile,v 1.6 2018/05/01 20:15:12 christos Exp $
-
-.include 
+# $NetBSD: Makefile,v 1.7 2018/05/04 00:33:48 christos Exp $
 
 HOSTPROG=	fr-kbdmap
 FILES=		fr.map

Index: src/sys/arch/amiga/stand/loadkmap/pl_din/Makefile
diff -u src/sys/arch/amiga/stand/loadkmap/pl_din/Makefile:1.3 src/sys/arch/amiga/stand/loadkmap/pl_din/Makefile:1.4
--- src/sys/arch/amiga/stand/loadkmap/pl_din/Makefile:1.3	Tue May  1 16:15:12 2018
+++ src/sys/arch/amiga/stand/loadkmap/pl_din/Makefile	Thu May  3 20:33:48 2018
@@ -1,6 +1,4 @@
-# $NetBSD: Makefile,v 1.3 2018/05/01 20:15:12 christos Exp $
-
-.include 
+# $NetBSD: Makefile,v 1.4 2018/05/04 00:33:48 christos Exp $
 
 HOSTPROG=	pl_din-kbdmap
 FILES=		pl_din.map

Index: src/sys/arch/amiga/stand/loadkmap/pl_us/Makefile
diff -u src/sys/arch/amiga/stand/loadkmap/pl_us/Makefile:1.3 src/sys/arch/amiga/stand/loadkmap/pl_us/Makefile:1.4
--- src/sys/arch/amiga/stand/loadkmap/pl_us/Makefile:1.3	Tue May  1 16:15:12 2018
+++ src/sys/arch/amiga/stand/loadkmap/pl_us/Makefile	Thu May  3 20:33:48 2018
@@ -1,6 +1,4 @@
-# $NetBSD: Makefile,v 1.3 2018/05/01 20:15:12 christos Exp $
-
-.include 
+# $NetBSD: Makefile,v 1.4 2018/05/04 00:33:48 christos Exp $
 
 HOSTPROG=	pl_us-kbdmap
 FILES=		pl_us.map

Index: src/sys/arch/amiga/stand/loadkmap/sw/Makefile
diff -u src/sys/arch/amiga/stand/loadkmap/sw/Makefile:1.10 src/sys/arch/amiga/stand/loadkmap/sw/Makefile:1.11
--- src/sys/arch/amiga/stand/loadkmap/sw/Makefile:1.10	Tue May  1 16:15:12 2018
+++ src/sys/arch/amiga/stand/loadkmap/sw/Makefile	Thu May  3 20:33:48 2018
@@ -1,6 +1,4 @@
-# $NetBSD: Makefile,v 1.10 2018/05/01 20:15:12 christos Exp $
-
-.include 
+# $NetBSD: Makefile,v 1.11 2018/05/04 00:33:48 christos Exp $
 
 HOSTPROG=	sw-kbdmap
 FILES=		sw.map

Index: src/sys/arch/amiga/stand/loadkmap/us/Makefile
diff -u src/sys/arch/amiga/stand/loadkmap/us/Makefile:1.9 src/sys/arch/amiga/stand/loadkmap/us/Makefile:1.10
--- src/sys/arch/amiga/stand/loadkmap/us/Makefile:1.9	Tue May  1 16:15:12 2018
+++ src/sys/arch/amiga/stand/loadkmap/us/Makefile	Thu May  3 20:33:48 2018
@@ -1,6 +1,4 @@
-# $NetBSD: Makefile,v 1.9 2018/05/01 20:15:12 christos Exp $
-
-.include 
+# $NetBSD: Makefile,v 1.10 2018/05/04 00:33:48 christos Exp $
 
 HOSTPROG=	us-kbdmap
 FILES=		us.map



CVS commit: src/sys/arch/amiga/stand/loadkmap

2018-05-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri May  4 00:33:48 UTC 2018

Modified Files:
src/sys/arch/amiga/stand/loadkmap/din: Makefile
src/sys/arch/amiga/stand/loadkmap/es: Makefile
src/sys/arch/amiga/stand/loadkmap/fr: Makefile
src/sys/arch/amiga/stand/loadkmap/pl_din: Makefile
src/sys/arch/amiga/stand/loadkmap/pl_us: Makefile
src/sys/arch/amiga/stand/loadkmap/sw: Makefile
src/sys/arch/amiga/stand/loadkmap/us: Makefile

Log Message:
remove bsd.hostinit.mk; it breaks install.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/amiga/stand/loadkmap/din/Makefile
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/amiga/stand/loadkmap/es/Makefile
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/amiga/stand/loadkmap/fr/Makefile
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/amiga/stand/loadkmap/pl_din/Makefile
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/amiga/stand/loadkmap/pl_us/Makefile
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/amiga/stand/loadkmap/sw/Makefile
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/amiga/stand/loadkmap/us/Makefile

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



CVS commit: src/doc

2018-05-03 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri May  4 00:25:26 UTC 2018

Modified Files:
src/doc: TODO.modules

Log Message:
Add some comments/suggestions from John Nemeth.  Thanks!


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/doc/TODO.modules

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.modules
diff -u src/doc/TODO.modules:1.14 src/doc/TODO.modules:1.15
--- src/doc/TODO.modules:1.14	Fri Dec 15 21:57:09 2017
+++ src/doc/TODO.modules	Fri May  4 00:25:26 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: TODO.modules,v 1.14 2017/12/15 21:57:09 pgoyette Exp $ */
+/* $NetBSD: TODO.modules,v 1.15 2018/05/04 00:25:26 pgoyette Exp $ */
 
 Some notes on the limitations of our current (as of 7.99.35) module
 subsystem.  This list was triggered by an Email exchange between
@@ -164,9 +164,31 @@ christos and pgoyette.
 mechanism to define and build modules, whether they are included as
 "built-in" modules or as separately-loadable modules.
 
+(From John Nemeth) Some sort of mechanism for a (driver) module
+to declare the list of vendor/product/other tuples that it can
+handle would be nice.  Perhaps this would go in the module's .plist
+file?  (See #17 below.)  Then drivers that scan for children might
+be able to search the modules directory for an "appropriate" module
+for each child, and auto-load.
+
 16. PR kern/52821 exposes another limitation of config(1) WRT modules.
 Here, an explicit device attachment is required, because we cannot
 rely on all kernel configs to contain the attribute at which the
 modular driver wants to attach.  Unfortunately, the explicit
 attachment causes conflicts with built-in drivers.  (See the PR for
 more details.)
+
+17. (From John Nemeth) It would be potentially useful if a "push" from
+the bootloader could also load-and-push a module's .plist (if it
+exists.
+
+18. (From John Nemeth) Some sort of schema for a module to declare the
+options (or other things?) that the module understands.  This could
+result in a module-options editor to manipulate the .plist 
+
+19. (From John Nemeth) Currently, the order of module initialization is
+based on module classes and declared dependencies.  It might be
+useful to have additional classes (or sub-classes) with additional
+invocations of module_class_init(), and it might be useful to have a
+non-dependency mechanism to provide "IF module-A and module-B are
+BOTH present, module-A needs to be initialized before module-B".



CVS commit: src/doc

2018-05-03 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri May  4 00:25:26 UTC 2018

Modified Files:
src/doc: TODO.modules

Log Message:
Add some comments/suggestions from John Nemeth.  Thanks!


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/doc/TODO.modules

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



Re: CVS commit: src

2018-05-03 Thread Sevan Janiyan


On 05/03/18 23:57, matthew green wrote:
> not sure i want to publish this library as-is.

Anything that's screaming out that I could add to my todo list? (I still
have more to do).

> please make it build private copy for bozohttpd(3lua) instead of
> installing this for the whole to use.
Sure, so create a new directory in src/lib for libbozohttpd, get the
library to build with a new Makefile and set LIBISPRIVATE?



Sevan


re: CVS commit: src

2018-05-03 Thread matthew green
"Sevan Janiyan" writes:
> Module Name:  src
> Committed By: sevan
> Date: Thu May  3 22:27:59 UTC 2018
> 
> Modified Files:
>   src/distrib/sets/lists/base: shl.mi
>   src/distrib/sets/lists/comp: mi
>   src/distrib/sets/lists/man: mi
>   src/lib: Makefile
> 
> Log Message:
> Hello libbozohttpd(3)
> Enabling as it is a dependency for bozohttpd(3lua).

hmm.

not sure i want to publish this library as-is.  please
make it build private copy for bozohttpd(3lua) instead
of installing this for the whole to use.

thanks.


.mrg.


CVS commit: src

2018-05-03 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Thu May  3 22:51:18 UTC 2018

Modified Files:
src/distrib/sets/lists/base: shl.mi
src/lib/lua: Makefile
Added Files:
src/lib/lua/bozohttpd: Makefile

Log Message:
Hello bozohttpd(3lua)


To generate a diff of this commit:
cvs rdiff -u -r1.837 -r1.838 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.6 -r1.7 src/lib/lua/Makefile
cvs rdiff -u -r0 -r1.1 src/lib/lua/bozohttpd/Makefile

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/shl.mi
diff -u src/distrib/sets/lists/base/shl.mi:1.837 src/distrib/sets/lists/base/shl.mi:1.838
--- src/distrib/sets/lists/base/shl.mi:1.837	Thu May  3 22:27:58 2018
+++ src/distrib/sets/lists/base/shl.mi	Thu May  3 22:51:17 2018
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.837 2018/05/03 22:27:58 sevan Exp $
+# $NetBSD: shl.mi,v 1.838 2018/05/03 22:51:17 sevan Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -877,6 +877,7 @@
 ./usr/lib/lua/5.1/gpio.so	base-obsolete		obsolete
 ./usr/lib/lua/5.1/sqlite.so	base-obsolete		obsolete
 ./usr/lib/lua/5.1/syslog.so	base-obsolete		obsolete
+./usr/lib/lua/5.3/bozohttpd.so			base-sys-shlib		compatfile
 ./usr/lib/lua/5.3/gpio.so	base-sys-shlib		compatfile
 ./usr/lib/lua/5.3/netpgp.so 			base-sys-shlib		compatfile
 ./usr/lib/lua/5.3/sqlite.so	base-sys-shlib		compatfile

Index: src/lib/lua/Makefile
diff -u src/lib/lua/Makefile:1.6 src/lib/lua/Makefile:1.7
--- src/lib/lua/Makefile:1.6	Wed Nov 13 09:49:08 2013
+++ src/lib/lua/Makefile	Thu May  3 22:51:18 2018
@@ -1,10 +1,10 @@
-#	$NetBSD: Makefile,v 1.6 2013/11/13 09:49:08 mbalmer Exp $
+#	$NetBSD: Makefile,v 1.7 2018/05/03 22:51:18 sevan Exp $
 
 .include 
 
 .if ${MKPIC} != "no"
 # No support for shared libraries and pic code.
-SUBDIR+=	gpio sqlite syslog
+SUBDIR+=	bozohttpd gpio sqlite syslog
 .endif
 
 .include 

Added files:

Index: src/lib/lua/bozohttpd/Makefile
diff -u /dev/null src/lib/lua/bozohttpd/Makefile:1.1
--- /dev/null	Thu May  3 22:51:18 2018
+++ src/lib/lua/bozohttpd/Makefile	Thu May  3 22:51:18 2018
@@ -0,0 +1,14 @@
+#	$NetBSD: Makefile,v 1.1 2018/05/03 22:51:18 sevan Exp $
+
+LUA_MODULES=		bozohttpd
+LUA_SRCS.bozohttpd=	glue.c
+LUA_DPLIBS+=		bozohttpd \
+			${.CURDIR}/../../../libexec/httpd/libbozohttpd
+
+EXTDIST= 		${.CURDIR}/../../../libexec/httpd
+
+CPPFLAGS+= 		-I${EXTDIST}
+
+.PATH: ${EXTDIST}/lua
+
+.include 



CVS commit: src

2018-05-03 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Thu May  3 22:51:18 UTC 2018

Modified Files:
src/distrib/sets/lists/base: shl.mi
src/lib/lua: Makefile
Added Files:
src/lib/lua/bozohttpd: Makefile

Log Message:
Hello bozohttpd(3lua)


To generate a diff of this commit:
cvs rdiff -u -r1.837 -r1.838 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.6 -r1.7 src/lib/lua/Makefile
cvs rdiff -u -r0 -r1.1 src/lib/lua/bozohttpd/Makefile

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



CVS commit: src

2018-05-03 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Thu May  3 22:27:59 UTC 2018

Modified Files:
src/distrib/sets/lists/base: shl.mi
src/distrib/sets/lists/comp: mi
src/distrib/sets/lists/man: mi
src/lib: Makefile

Log Message:
Hello libbozohttpd(3)
Enabling as it is a dependency for bozohttpd(3lua).


To generate a diff of this commit:
cvs rdiff -u -r1.836 -r1.837 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.2188 -r1.2189 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.1580 -r1.1581 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.255 -r1.256 src/lib/Makefile

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/shl.mi
diff -u src/distrib/sets/lists/base/shl.mi:1.836 src/distrib/sets/lists/base/shl.mi:1.837
--- src/distrib/sets/lists/base/shl.mi:1.836	Sun Apr 29 19:47:34 2018
+++ src/distrib/sets/lists/base/shl.mi	Thu May  3 22:27:58 2018
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.836 2018/04/29 19:47:34 sevan Exp $
+# $NetBSD: shl.mi,v 1.837 2018/05/03 22:27:58 sevan Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -103,6 +103,9 @@
 ./lib/npf/ext_rndblock.so.0			base-npf-shlib		compatfile,npf
 ./lib/npf/ext_rndblock.so.0.0			base-npf-shlib		compatfile,npf
 ./libexec/ld.elf_sobase-sys-shlib		dynamicroot
+./usr/lib/libbozohttpd.so 			base-sys-shlib		compatfile
+./usr/lib/libbozohttpd.so.0			base-sys-shlib		compatfile
+./usr/lib/libbozohttpd.so.0.0			base-sys-shlib		compatfile
 ./usr/lib/i18n/libBIG5.so			base-i18n-shlib		compatfile
 ./usr/lib/i18n/libBIG5.so.5			base-i18n-shlib		compatfile
 ./usr/lib/i18n/libBIG5.so.5.0			base-i18n-shlib		compatfile

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.2188 src/distrib/sets/lists/comp/mi:1.2189
--- src/distrib/sets/lists/comp/mi:1.2188	Wed Apr 18 08:58:41 2018
+++ src/distrib/sets/lists/comp/mi	Thu May  3 22:27:59 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.2188 2018/04/18 08:58:41 mlelstv Exp $
+#	$NetBSD: mi,v 1.2189 2018/05/03 22:27:59 sevan Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.compcomp-sys-root
@@ -206,6 +206,7 @@
 ./usr/include/blacklist.h			comp-c-include
 ./usr/include/bluetooth.h			comp-c-include
 ./usr/include/bm.hcomp-c-include
+./usr/include/bozohttpd.h			comp-c-include
 ./usr/include/bzlib.hcomp-c-include
 ./usr/include/c++/__bit_reference		comp-cxx-include	libcxx
 ./usr/include/c++/__config			comp-cxx-include	libcxx
@@ -3281,6 +3282,9 @@
 ./usr/lib/libatf_p.acomp-obsolete		obsolete
 ./usr/lib/libavl.acomp-zfs-lib		compatfile,zfs
 ./usr/lib/libavl_p.acomp-zfs-proflib	compatfile,profile,zfs
+./usr/lib/libbozohttpd.a			comp-c-lib		compatfile
+./usr/lib/libbozohttpd_p.a			comp-c-lib		compatfile
+./usr/lib/libbozohttpd_pic.a			comp-c-lib		compatfile
 ./usr/lib/libbfd.acomp-obsolete		obsolete
 ./usr/lib/libbind9.acomp-bind-lib		compatfile
 ./usr/lib/libbind9_p.acomp-bind-proflib	compatfile,profile

Index: src/distrib/sets/lists/man/mi
diff -u src/distrib/sets/lists/man/mi:1.1580 src/distrib/sets/lists/man/mi:1.1581
--- src/distrib/sets/lists/man/mi:1.1580	Tue May  1 23:41:51 2018
+++ src/distrib/sets/lists/man/mi	Thu May  3 22:27:59 2018
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1580 2018/05/01 23:41:51 kamil Exp $
+# $NetBSD: mi,v 1.1581 2018/05/03 22:27:59 sevan Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -3844,6 +3844,7 @@
 ./usr/share/man/html1/zless.html		man-util-htmlman	html
 ./usr/share/man/html1/zmore.html		man-util-htmlman	html
 ./usr/share/man/html1/znew.html			man-util-htmlman	html
+./usr/share/man/html3/libbozohttpd.html		man-sys-htmlman		html
 ./usr/share/man/html3/libunbound.html		man-netutil-htmlman	html,unbound
 ./usr/share/man/html3lua/gpio.attach.html	man-sys-htmlman		html
 ./usr/share/man/html3lua/gpio.close.html	man-sys-htmlman		html
@@ -6705,6 +6706,7 @@
 ./usr/share/man/man3/atari/ahdi_writelabel.3	man-obsolete		obsolete
 ./usr/share/man/man3/i386			man-obsolete		obsolete
 ./usr/share/man/man3/i386/keycap.3		man-obsolete		obsolete
+./usr/share/man/man3/libbozohttpd.3		man-sys-man		.man
 ./usr/share/man/man3/libunbound.3		man-netutil-man		.man,unbound
 ./usr/share/man/man3lua/gpio.3lua		man-sys-man		.man
 ./usr/share/man/man3lua/gpio.attach.3lua	man-sys-man		.man

Index: src/lib/Makefile
diff -u src/lib/Makefile:1.255 src/lib/Makefile:1.256
--- src/lib/Makefile:1.255	Tue May  1 19:50:34 2018
+++ src/lib/Makefile	Thu May  3 22:27:58 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.255 2018/05/01 19:50:34 christos Exp $
+#	$NetBSD: Makefile,v 1.256 2018/05/03 22:27:58 sevan Exp $
 #	from: @(#)Makefile	5.25.1.1 (Berkeley) 5/7/91
 
 .include 
@@ -210,6 +210,8 @@ SUBDIR+=	../external/bsd/fetch/lib	# dep
 SUBDIR+=	../external/bsd/openldap/lib	# depends on 

CVS commit: src

2018-05-03 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Thu May  3 22:27:59 UTC 2018

Modified Files:
src/distrib/sets/lists/base: shl.mi
src/distrib/sets/lists/comp: mi
src/distrib/sets/lists/man: mi
src/lib: Makefile

Log Message:
Hello libbozohttpd(3)
Enabling as it is a dependency for bozohttpd(3lua).


To generate a diff of this commit:
cvs rdiff -u -r1.836 -r1.837 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.2188 -r1.2189 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.1580 -r1.1581 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.255 -r1.256 src/lib/Makefile

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



CVS commit: src/sys

2018-05-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu May  3 21:43:33 UTC 2018

Modified Files:
src/sys/compat/common: uipc_syscalls_43.c
src/sys/compat/linux/common: linux_socket.c
src/sys/compat/netbsd32: netbsd32_compat_43.c netbsd32_socket.c
src/sys/kern: uipc_syscalls.c
src/sys/sys: param.h

Log Message:
Fix COMPAT_NETBSD32 cmsg handling:

1. alignment was wrong for > 1 message
2. macros were doing incorrect pointer comparisons, fortunately ending
   the iteration early after the fists cmsg instead of crashing.
3. don't output 32 bit ktrace records for cmsg. 32 bit programs running
   under emulation on 64 bit systems should produce 64 bit ktrace records
   so that the native ktrace can handle the records; remove extra arguments
   that are now not needed (the 32 bit msghdr).
4. output the correct type for cmsg trace records.
5. output all the cmsg records in traces instead of just the first one.

Welcome to 8.99.15 because of the argument removal.

XXX: Really all the code should be changed to use the CMSG_{FIRST,NXT}HDR
macros...


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/compat/common/uipc_syscalls_43.c
cvs rdiff -u -r1.140 -r1.141 src/sys/compat/linux/common/linux_socket.c
cvs rdiff -u -r1.55 -r1.56 src/sys/compat/netbsd32/netbsd32_compat_43.c
cvs rdiff -u -r1.44 -r1.45 src/sys/compat/netbsd32/netbsd32_socket.c
cvs rdiff -u -r1.192 -r1.193 src/sys/kern/uipc_syscalls.c
cvs rdiff -u -r1.559 -r1.560 src/sys/sys/param.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/compat/common/uipc_syscalls_43.c
diff -u src/sys/compat/common/uipc_syscalls_43.c:1.48 src/sys/compat/common/uipc_syscalls_43.c:1.49
--- src/sys/compat/common/uipc_syscalls_43.c:1.48	Fri Mar 16 13:25:04 2018
+++ src/sys/compat/common/uipc_syscalls_43.c	Thu May  3 17:43:33 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_syscalls_43.c,v 1.48 2018/03/16 17:25:04 christos Exp $	*/
+/*	$NetBSD: uipc_syscalls_43.c,v 1.49 2018/05/03 21:43:33 christos Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1990, 1993
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls_43.c,v 1.48 2018/03/16 17:25:04 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls_43.c,v 1.49 2018/05/03 21:43:33 christos Exp $");
 
 #include 
 #include 
@@ -216,7 +216,7 @@ compat_43_sys_recvmsg(struct lwp *l, con
 	msg.msg_iov	= omsg.msg_iov;
 	msg.msg_flags	= (SCARG(uap, flags) & MSG_USERFLAGS) | MSG_IOVUSRSPACE;
 
-	error = do_sys_recvmsg(l, SCARG(uap, s), , NULL, 0, ,
+	error = do_sys_recvmsg(l, SCARG(uap, s), , ,
 	omsg.msg_accrights != NULL ?  : NULL, retval);
 	if (error != 0)
 		return error;
@@ -363,7 +363,7 @@ compat_43_sys_sendmsg(struct lwp *l, con
 		goto bad;
 
 	return do_sys_sendmsg(l, SCARG(uap, s), , SCARG(uap, flags),
-	NULL, 0, retval);
+	retval);
 
 bad:
 	if (nam != NULL)

Index: src/sys/compat/linux/common/linux_socket.c
diff -u src/sys/compat/linux/common/linux_socket.c:1.140 src/sys/compat/linux/common/linux_socket.c:1.141
--- src/sys/compat/linux/common/linux_socket.c:1.140	Fri Mar 16 13:25:04 2018
+++ src/sys/compat/linux/common/linux_socket.c	Thu May  3 17:43:33 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_socket.c,v 1.140 2018/03/16 17:25:04 christos Exp $	*/
+/*	$NetBSD: linux_socket.c,v 1.141 2018/05/03 21:43:33 christos Exp $	*/
 
 /*-
  * Copyright (c) 1995, 1998, 2008 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.140 2018/03/16 17:25:04 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.141 2018/05/03 21:43:33 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -434,8 +434,7 @@ linux_sys_sendto(struct lwp *l, const st
 	aiov.iov_base = __UNCONST(SCARG(uap, msg));
 	aiov.iov_len = SCARG(uap, len);
 
-	return do_sys_sendmsg(l, SCARG(uap, s), , bflags,
-	NULL, 0, retval);
+	return do_sys_sendmsg(l, SCARG(uap, s), , bflags, retval);
 }
 
 static void
@@ -624,8 +623,7 @@ linux_sys_sendmsg(struct lwp *l, const s
 	}
 
 skipcmsg:
-	error = do_sys_sendmsg(l, SCARG(uap, s), , bflags,
-	NULL, 0, retval);
+	error = do_sys_sendmsg(l, SCARG(uap, s), , bflags, retval);
 	/* Freed internally */
 	ctl_mbuf = NULL;
 
@@ -787,7 +785,7 @@ linux_sys_recvmsg(struct lwp *l, const s
 	}
 	msg.msg_flags |= MSG_IOVUSRSPACE;
 
-	error = do_sys_recvmsg(l, SCARG(uap, s), , NULL, 0, ,
+	error = do_sys_recvmsg(l, SCARG(uap, s), , ,
 	msg.msg_control != NULL ?  : NULL, retval);
 	if (error != 0)
 		return error;
@@ -1789,8 +1787,7 @@ linux_sys_sendmmsg(struct lwp *l, const 
 
 		msg->msg_flags = flags;
 
-		error = do_sys_sendmsg_so(l, s, so, fp, msg, flags,
-		, sizeof(msg), retval);
+		error = do_sys_sendmsg_so(l, s, so, fp, msg, flags, retval);
 		if (error)
 			break;
 
@@ -1871,7 +1868,7 @@ linux_sys_recvmmsg(struct lwp *l, const 
 			from = NULL;
 

CVS commit: src/sys

2018-05-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu May  3 21:43:33 UTC 2018

Modified Files:
src/sys/compat/common: uipc_syscalls_43.c
src/sys/compat/linux/common: linux_socket.c
src/sys/compat/netbsd32: netbsd32_compat_43.c netbsd32_socket.c
src/sys/kern: uipc_syscalls.c
src/sys/sys: param.h

Log Message:
Fix COMPAT_NETBSD32 cmsg handling:

1. alignment was wrong for > 1 message
2. macros were doing incorrect pointer comparisons, fortunately ending
   the iteration early after the fists cmsg instead of crashing.
3. don't output 32 bit ktrace records for cmsg. 32 bit programs running
   under emulation on 64 bit systems should produce 64 bit ktrace records
   so that the native ktrace can handle the records; remove extra arguments
   that are now not needed (the 32 bit msghdr).
4. output the correct type for cmsg trace records.
5. output all the cmsg records in traces instead of just the first one.

Welcome to 8.99.15 because of the argument removal.

XXX: Really all the code should be changed to use the CMSG_{FIRST,NXT}HDR
macros...


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/compat/common/uipc_syscalls_43.c
cvs rdiff -u -r1.140 -r1.141 src/sys/compat/linux/common/linux_socket.c
cvs rdiff -u -r1.55 -r1.56 src/sys/compat/netbsd32/netbsd32_compat_43.c
cvs rdiff -u -r1.44 -r1.45 src/sys/compat/netbsd32/netbsd32_socket.c
cvs rdiff -u -r1.192 -r1.193 src/sys/kern/uipc_syscalls.c
cvs rdiff -u -r1.559 -r1.560 src/sys/sys/param.h

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



CVS commit: src/sys/sys

2018-05-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu May  3 21:37:29 UTC 2018

Modified Files:
src/sys/sys: mbuf.h

Log Message:
make mbuftypes always visible


To generate a diff of this commit:
cvs rdiff -u -r1.204 -r1.205 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/sys/mbuf.h
diff -u src/sys/sys/mbuf.h:1.204 src/sys/sys/mbuf.h:1.205
--- src/sys/sys/mbuf.h:1.204	Thu May  3 04:39:28 2018
+++ src/sys/sys/mbuf.h	Thu May  3 17:37:29 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: mbuf.h,v 1.204 2018/05/03 08:39:28 maxv Exp $	*/
+/*	$NetBSD: mbuf.h,v 1.205 2018/05/03 21:37:29 christos Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997, 1999, 2001, 2007 The NetBSD Foundation, Inc.
@@ -397,7 +397,7 @@ MBUF_DEFINE(mbuf, MHLEN, MLEN);
 #define MT_OOBDATA	7	/* expedited data  */
 
 #ifdef MBUFTYPES
-static const char * const mbuftypes[] = {
+const char * const mbuftypes[] = {
 	"mbfree",
 	"mbdata",
 	"mbheader",
@@ -407,6 +407,8 @@ static const char * const mbuftypes[] = 
 	"mbcontrol",
 	"mboobdata",
 };
+#else
+extern const char * const mbuftypes[];
 #endif
 
 /* flags to m_get/MGET */



CVS commit: src/sys/sys

2018-05-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu May  3 21:37:29 UTC 2018

Modified Files:
src/sys/sys: mbuf.h

Log Message:
make mbuftypes always visible


To generate a diff of this commit:
cvs rdiff -u -r1.204 -r1.205 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/doc

2018-05-03 Thread John Nemeth
Module Name:src
Committed By:   jnemeth
Date:   Thu May  3 20:15:49 UTC 2018

Modified Files:
src/doc: 3RDPARTY

Log Message:
time marches on for lvm2tools


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

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1518 src/doc/3RDPARTY:1.1519
--- src/doc/3RDPARTY:1.1518	Wed May  2 22:11:49 2018
+++ src/doc/3RDPARTY	Thu May  3 20:15:49 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1518 2018/05/02 22:11:49 roy Exp $
+#	$NetBSD: 3RDPARTY,v 1.1519 2018/05/03 20:15:49 jnemeth Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -763,7 +763,7 @@ All changes should come via import from 
 
 Package:	lvm2tools
 Version:	2.02.56
-Current Vers:	2.02.114
+Current Vers:	2.02.177
 Maintainer:	lvm-de...@redhat.com
 Archive Site:	ftp://sources.redhat.com/pub/lvm2/
 Home Page:	http://sources.redhat.com/lvm2/



CVS commit: src/doc

2018-05-03 Thread John Nemeth
Module Name:src
Committed By:   jnemeth
Date:   Thu May  3 20:15:49 UTC 2018

Modified Files:
src/doc: 3RDPARTY

Log Message:
time marches on for lvm2tools


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

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



CVS commit: src/sys/net80211

2018-05-03 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu May  3 17:14:37 UTC 2018

Modified Files:
src/sys/net80211: ieee80211_crypto_ccmp.c ieee80211_crypto_wep.c
ieee80211_netbsd.h ieee80211_output.c

Log Message:
Remove ovbcopy from net80211.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/net80211/ieee80211_crypto_ccmp.c
cvs rdiff -u -r1.11 -r1.12 src/sys/net80211/ieee80211_crypto_wep.c
cvs rdiff -u -r1.20 -r1.21 src/sys/net80211/ieee80211_netbsd.h
cvs rdiff -u -r1.61 -r1.62 src/sys/net80211/ieee80211_output.c

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-05-03 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu May  3 17:14:37 UTC 2018

Modified Files:
src/sys/net80211: ieee80211_crypto_ccmp.c ieee80211_crypto_wep.c
ieee80211_netbsd.h ieee80211_output.c

Log Message:
Remove ovbcopy from net80211.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/net80211/ieee80211_crypto_ccmp.c
cvs rdiff -u -r1.11 -r1.12 src/sys/net80211/ieee80211_crypto_wep.c
cvs rdiff -u -r1.20 -r1.21 src/sys/net80211/ieee80211_netbsd.h
cvs rdiff -u -r1.61 -r1.62 src/sys/net80211/ieee80211_output.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_ccmp.c
diff -u src/sys/net80211/ieee80211_crypto_ccmp.c:1.13 src/sys/net80211/ieee80211_crypto_ccmp.c:1.14
--- src/sys/net80211/ieee80211_crypto_ccmp.c:1.13	Fri Jan 19 07:54:34 2018
+++ src/sys/net80211/ieee80211_crypto_ccmp.c	Thu May  3 17:14:37 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ieee80211_crypto_ccmp.c,v 1.13 2018/01/19 07:54:34 maxv Exp $	*/
+/*	$NetBSD: ieee80211_crypto_ccmp.c,v 1.14 2018/05/03 17:14:37 maxv Exp $	*/
 
 /*
  * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
@@ -36,7 +36,7 @@
 __FBSDID("$FreeBSD: src/sys/net80211/ieee80211_crypto_ccmp.c,v 1.7 2005/07/11 03:06:23 sam Exp $");
 #endif
 #ifdef __NetBSD__
-__KERNEL_RCSID(0, "$NetBSD: ieee80211_crypto_ccmp.c,v 1.13 2018/01/19 07:54:34 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ieee80211_crypto_ccmp.c,v 1.14 2018/05/03 17:14:37 maxv Exp $");
 #endif
 
 /*
@@ -243,7 +243,7 @@ ccmp_decap(struct ieee80211_key *k, stru
 	/*
 	 * Copy up 802.11 header and strip crypto bits.
 	 */
-	ovbcopy(mtod(m, void *), mtod(m, u_int8_t *) + ccmp.ic_header, hdrlen);
+	memmove(mtod(m, u_int8_t *) + ccmp.ic_header, mtod(m, void *), hdrlen);
 	m_adj(m, ccmp.ic_header);
 	m_adj(m, -ccmp.ic_trailer);
 

Index: src/sys/net80211/ieee80211_crypto_wep.c
diff -u src/sys/net80211/ieee80211_crypto_wep.c:1.11 src/sys/net80211/ieee80211_crypto_wep.c:1.12
--- src/sys/net80211/ieee80211_crypto_wep.c:1.11	Fri Jan 19 07:58:25 2018
+++ src/sys/net80211/ieee80211_crypto_wep.c	Thu May  3 17:14:37 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ieee80211_crypto_wep.c,v 1.11 2018/01/19 07:58:25 maxv Exp $	*/
+/*	$NetBSD: ieee80211_crypto_wep.c,v 1.12 2018/05/03 17:14:37 maxv Exp $	*/
 
 /*
  * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
@@ -36,7 +36,7 @@
 __FBSDID("$FreeBSD: src/sys/net80211/ieee80211_crypto_wep.c,v 1.7 2005/06/10 16:11:24 sam Exp $");
 #endif
 #ifdef __NetBSD__
-__KERNEL_RCSID(0, "$NetBSD: ieee80211_crypto_wep.c,v 1.11 2018/01/19 07:58:25 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ieee80211_crypto_wep.c,v 1.12 2018/05/03 17:14:37 maxv Exp $");
 #endif
 
 /*
@@ -227,7 +227,7 @@ wep_decap(struct ieee80211_key *k, struc
 	/*
 	 * Copy up 802.11 header and strip crypto bits.
 	 */
-	ovbcopy(mtod(m, void *), mtod(m, u_int8_t *) + wep.ic_header, hdrlen);
+	memmove(mtod(m, u_int8_t *) + wep.ic_header, mtod(m, void *), hdrlen);
 	m_adj(m, wep.ic_header);
 	m_adj(m, -wep.ic_trailer);
 

Index: src/sys/net80211/ieee80211_netbsd.h
diff -u src/sys/net80211/ieee80211_netbsd.h:1.20 src/sys/net80211/ieee80211_netbsd.h:1.21
--- src/sys/net80211/ieee80211_netbsd.h:1.20	Fri Apr 27 06:56:21 2018
+++ src/sys/net80211/ieee80211_netbsd.h	Thu May  3 17:14:37 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: ieee80211_netbsd.h,v 1.20 2018/04/27 06:56:21 maxv Exp $ */
+/* $NetBSD: ieee80211_netbsd.h,v 1.21 2018/05/03 17:14:37 maxv Exp $ */
 /*-
  * Copyright (c) 2003-2005 Sam Leffler, Errno Consulting
  * All rights reserved.
@@ -231,7 +231,6 @@ struct ieee80211_michael_event {
 
 #ifdef _KERNEL
 #define	ticks	hardclock_ticks
-#define	ovbcopy(__src, __dst, __n)	((void)memmove(__dst, __src, __n))
 
 void	if_printf(struct ifnet *, const char *, ...);
 void	get_random_bytes(void *, size_t);

Index: src/sys/net80211/ieee80211_output.c
diff -u src/sys/net80211/ieee80211_output.c:1.61 src/sys/net80211/ieee80211_output.c:1.62
--- src/sys/net80211/ieee80211_output.c:1.61	Thu Jan 18 16:23:43 2018
+++ src/sys/net80211/ieee80211_output.c	Thu May  3 17:14:37 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ieee80211_output.c,v 1.61 2018/01/18 16:23:43 maxv Exp $	*/
+/*	$NetBSD: ieee80211_output.c,v 1.62 2018/05/03 17:14:37 maxv Exp $	*/
 
 /*
  * Copyright (c) 2001 Atsushi Onoe
@@ -37,7 +37,7 @@
 __FBSDID("$FreeBSD: src/sys/net80211/ieee80211_output.c,v 1.34 2005/08/10 16:22:29 sam Exp $");
 #endif
 #ifdef __NetBSD__
-__KERNEL_RCSID(0, "$NetBSD: ieee80211_output.c,v 1.61 2018/01/18 16:23:43 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ieee80211_output.c,v 1.62 2018/05/03 17:14:37 maxv Exp $");
 #endif
 
 #ifdef _KERNEL_OPT
@@ -2084,7 +2084,7 @@ ieee80211_beacon_update(struct ieee80211
 			}
 			if (timlen != bo->bo_tim_len) {
 /* copy up/down trailer */
-ovbcopy(bo->bo_trailer, tie->tim_bitmap+timlen,
+memmove(tie->tim_bitmap+timlen, bo->bo_trailer,
 	bo->bo_trailer_len);
 bo->bo_trailer 

CVS commit: src/share/misc

2018-05-03 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu May  3 17:03:20 UTC 2018

Modified Files:
src/share/misc: acronyms

Log Message:
Fix VLC -> VLA


To generate a diff of this commit:
cvs rdiff -u -r1.267 -r1.268 src/share/misc/acronyms

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



CVS commit: src/share/misc

2018-05-03 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu May  3 17:03:20 UTC 2018

Modified Files:
src/share/misc: acronyms

Log Message:
Fix VLC -> VLA


To generate a diff of this commit:
cvs rdiff -u -r1.267 -r1.268 src/share/misc/acronyms

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

Modified files:

Index: src/share/misc/acronyms
diff -u src/share/misc/acronyms:1.267 src/share/misc/acronyms:1.268
--- src/share/misc/acronyms:1.267	Thu May  3 17:01:08 2018
+++ src/share/misc/acronyms	Thu May  3 17:03:20 2018
@@ -1,4 +1,4 @@
-$NetBSD: acronyms,v 1.267 2018/05/03 17:01:08 kamil Exp $
+$NetBSD: acronyms,v 1.268 2018/05/03 17:03:20 kamil Exp $
 10Q	thank you
 10X	thanks
 1337	elite ("leet")
@@ -552,7 +552,7 @@ UTSL	use the source, Luke
 VCR	video cassette recorder
 VEG	very evil grin
 VIP	very important person
-VLC	variable length array
+VLA	variable length array
 W/	with
 W/E	whatever
 W/O	without



CVS commit: src/share/misc

2018-05-03 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu May  3 17:01:09 UTC 2018

Modified Files:
src/share/misc: acronyms

Log Message:
Register new acronym in wtf(6)

VLCvariable length array

Noted by 


To generate a diff of this commit:
cvs rdiff -u -r1.266 -r1.267 src/share/misc/acronyms

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



CVS commit: src/share/misc

2018-05-03 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu May  3 17:01:09 UTC 2018

Modified Files:
src/share/misc: acronyms

Log Message:
Register new acronym in wtf(6)

VLCvariable length array

Noted by 


To generate a diff of this commit:
cvs rdiff -u -r1.266 -r1.267 src/share/misc/acronyms

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

Modified files:

Index: src/share/misc/acronyms
diff -u src/share/misc/acronyms:1.266 src/share/misc/acronyms:1.267
--- src/share/misc/acronyms:1.266	Thu May  3 15:38:13 2018
+++ src/share/misc/acronyms	Thu May  3 17:01:08 2018
@@ -1,4 +1,4 @@
-$NetBSD: acronyms,v 1.266 2018/05/03 15:38:13 htodd Exp $
+$NetBSD: acronyms,v 1.267 2018/05/03 17:01:08 kamil Exp $
 10Q	thank you
 10X	thanks
 1337	elite ("leet")
@@ -552,6 +552,7 @@ UTSL	use the source, Luke
 VCR	video cassette recorder
 VEG	very evil grin
 VIP	very important person
+VLC	variable length array
 W/	with
 W/E	whatever
 W/O	without



CVS commit: src/sys/net

2018-05-03 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu May  3 16:52:42 UTC 2018

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

Log Message:
Drop early if there's no PPPoE interface. Otherwise it is easy for someone
to flood dmesg over the local subnet.


To generate a diff of this commit:
cvs rdiff -u -r1.136 -r1.137 src/sys/net/if_pppoe.c

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-05-03 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu May  3 16:52:42 UTC 2018

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

Log Message:
Drop early if there's no PPPoE interface. Otherwise it is easy for someone
to flood dmesg over the local subnet.


To generate a diff of this commit:
cvs rdiff -u -r1.136 -r1.137 src/sys/net/if_pppoe.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_pppoe.c
diff -u src/sys/net/if_pppoe.c:1.136 src/sys/net/if_pppoe.c:1.137
--- src/sys/net/if_pppoe.c:1.136	Wed Apr 18 07:40:40 2018
+++ src/sys/net/if_pppoe.c	Thu May  3 16:52:42 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: if_pppoe.c,v 1.136 2018/04/18 07:40:40 knakahara Exp $ */
+/* $NetBSD: if_pppoe.c,v 1.137 2018/05/03 16:52:42 maxv Exp $ */
 
 /*-
  * Copyright (c) 2002, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_pppoe.c,v 1.136 2018/04/18 07:40:40 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_pppoe.c,v 1.137 2018/05/03 16:52:42 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "pppoe.h"
@@ -944,13 +944,16 @@ done:
 static void
 pppoe_disc_input(struct mbuf *m)
 {
+	KASSERT(m->m_flags & M_PKTHDR);
 
-	/* avoid error messages if there is not a single pppoe instance */
+	/*
+	 * Avoid error messages if there is not a single PPPoE instance.
+	 */
 	if (!LIST_EMPTY(_softc_list)) {
-		KASSERT(m->m_flags & M_PKTHDR);
 		pppoe_dispatch_disc_pkt(m, 0);
-	} else
+	} else {
 		m_freem(m);
+	}
 }
 
 static bool
@@ -977,6 +980,13 @@ pppoe_data_input(struct mbuf *m)
 
 	KASSERT(m->m_flags & M_PKTHDR);
 
+	/*
+	 * Avoid error messages if there is not a single PPPoE instance.
+	 */
+	if (LIST_EMPTY(_softc_list)) {
+		goto drop;
+	}
+
 	if (term_unknown) {
 		memcpy(shost, mtod(m, struct ether_header*)->ether_shost,
 		ETHER_ADDR_LEN);



CVS commit: src/sys/arch/aarch64/aarch64

2018-05-03 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Thu May  3 15:47:22 UTC 2018

Modified Files:
src/sys/arch/aarch64/aarch64: aarch64_machdep.c

Log Message:
add sysctl for 
machdep.{cpu_id,id_revidr,id_mvfr,id_mpidr,id_aa64isar,id_aa64mmfr,id_aa64pfr}
each corresponding to system registers MIDR_EL1, REVIDR_EL1, MVFR*_EL1, 
MPIDR_EL1, ID_AA64ISAR*_EL1, ID_AA64MMFR*_EL1, ID_AA64PFR*_EL1.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/aarch64/aarch64/aarch64_machdep.c

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



CVS commit: src/usr.sbin/cpuctl/arch

2018-05-03 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Thu May  3 15:47:36 UTC 2018

Added Files:
src/usr.sbin/cpuctl/arch: aarch64.c

Log Message:
add aarch64 support for cpuctl identify.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/usr.sbin/cpuctl/arch/aarch64.c

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

Added files:

Index: src/usr.sbin/cpuctl/arch/aarch64.c
diff -u /dev/null src/usr.sbin/cpuctl/arch/aarch64.c:1.1
--- /dev/null	Thu May  3 15:47:36 2018
+++ src/usr.sbin/cpuctl/arch/aarch64.c	Thu May  3 15:47:36 2018
@@ -0,0 +1,619 @@
+/*	$NetBSD: aarch64.c,v 1.1 2018/05/03 15:47:36 ryo Exp $	*/
+
+/*
+ * Copyright (c) 2018 Ryo Shimizu 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include 
+
+#ifndef lint
+__RCSID("$NetBSD: aarch64.c,v 1.1 2018/05/03 15:47:36 ryo Exp $");
+#endif /* no lint */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include "../cpuctl.h"
+
+struct cpuidtab {
+	uint32_t cpu_partnum;
+	const char *cpu_name;
+	const char *cpu_class;
+	const char *cpu_architecture;
+};
+
+struct impltab {
+	uint32_t impl_id;
+	const char *impl_name;
+};
+
+struct fieldinfo {
+	int bitpos;
+	int bitwidth;
+	const char *name;
+	const char * const *info;
+};
+
+
+#define CPU_PARTMASK	(CPU_ID_IMPLEMENTOR_MASK | CPU_ID_PARTNO_MASK)
+const struct cpuidtab cpuids[] = {
+	{ CPU_ID_CORTEXA53R0 & CPU_PARTMASK, "Cortex-A53", "Cortex", "V8-A" },
+	{ CPU_ID_CORTEXA57R0 & CPU_PARTMASK, "Cortex-A57", "Cortex", "V8-A" },
+	{ CPU_ID_CORTEXA72R0 & CPU_PARTMASK, "Cortex-A72", "Cortex", "V8-A" },
+	{ CPU_ID_CORTEXA73R0 & CPU_PARTMASK, "Cortex-A73", "Cortex", "V8-A" },
+	{ CPU_ID_CORTEXA55R1 & CPU_PARTMASK, "Cortex-A55", "Cortex", "V8.2-A" },
+	{ CPU_ID_CORTEXA75R2 & CPU_PARTMASK, "Cortex-A75", "Cortex", "V8.2-A" }
+};
+
+const struct impltab implids[] = {
+	{ CPU_ID_ARM_LTD,	"ARM Limited"},
+	{ CPU_ID_BROADCOM,	"Broadcom Corporation"			},
+	{ CPU_ID_CAVIUM,	"Cavium Inc."},
+	{ CPU_ID_DEC,		"Digital Equipment Corporation"		},
+	{ CPU_ID_INFINEON,	"Infineon Technologies AG"		},
+	{ CPU_ID_MOTOROLA,	"Motorola or Freescale Semiconductor Inc." },
+	{ CPU_ID_NVIDIA,	"NVIDIA Corporation"			},
+	{ CPU_ID_APM,		"Applied Micro Circuits Corporation"	},
+	{ CPU_ID_QUALCOMM,	"Qualcomm Inc."},
+	{ CPU_ID_SAMSUNG,	"SAMSUNG"},
+	{ CPU_ID_TI,		"Texas Instruments"			},
+	{ CPU_ID_MARVELL,	"Marvell International Ltd."		},
+	{ CPU_ID_APPLE,		"Apple Inc."},
+	{ CPU_ID_FARADAY,	"Faraday Technology Corporation"	},
+	{ CPU_ID_INTEL,		"Intel Corporation"			}
+};
+
+/* ID_AA64PFR0_EL1 - AArch64 Processor Feature Register 0 */
+struct fieldinfo id_aa64pfr0_fieldinfo[] = {
+	{
+		.bitpos = 0, .bitwidth = 4, .name = "EL0",
+		.info = (const char *[16]) { /* 16=4bit */
+			[0] = "No EL0",
+			[1] = "AArch64",
+			[2] = "AArch64/AArch32"
+		}
+	},
+	{
+		.bitpos = 4, .bitwidth = 4, .name = "EL1",
+		.info = (const char *[16]) { /* 16=4bit */
+			[0] = "No EL1",
+			[1] = "AArch64",
+			[2] = "AArch64/AArch32"
+		}
+	},
+	{
+		.bitpos = 8, .bitwidth = 4, .name = "EL2",
+		.info = (const char *[16]) { /* 16=4bit */
+			[0] = "No EL2",
+			[1] = "AArch64",
+			[2] = "AArch64/AArch32"
+		}
+	},
+	{
+		.bitpos = 12, .bitwidth = 4, .name = "EL3",
+		.info = (const char *[16]) { /* 16=4bit */
+			[0] = "No EL3",
+			[1] = "AArch64",
+			[2] = "AArch64/AArch32"
+		}
+	},
+	{
+		.bitpos = 16, .bitwidth = 4, .name = "FP",
+		.info = (const char *[16]) { /* 16=4bit */
+			[0] = "Floating Point",
+			[15] = "No Floating Point"
+		}
+	},
+	{
+		.bitpos = 20, .bitwidth = 4, .name = "AdvSIMD",
+		.info = (const char 

CVS commit: src/usr.sbin/cpuctl/arch

2018-05-03 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Thu May  3 15:47:36 UTC 2018

Added Files:
src/usr.sbin/cpuctl/arch: aarch64.c

Log Message:
add aarch64 support for cpuctl identify.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/usr.sbin/cpuctl/arch/aarch64.c

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



CVS commit: src/sys/arch/aarch64/aarch64

2018-05-03 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Thu May  3 15:47:22 UTC 2018

Modified Files:
src/sys/arch/aarch64/aarch64: aarch64_machdep.c

Log Message:
add sysctl for 
machdep.{cpu_id,id_revidr,id_mvfr,id_mpidr,id_aa64isar,id_aa64mmfr,id_aa64pfr}
each corresponding to system registers MIDR_EL1, REVIDR_EL1, MVFR*_EL1, 
MPIDR_EL1, ID_AA64ISAR*_EL1, ID_AA64MMFR*_EL1, ID_AA64PFR*_EL1.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/aarch64/aarch64/aarch64_machdep.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/aarch64/aarch64/aarch64_machdep.c
diff -u src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.2 src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.3
--- src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.2	Sun Apr  1 04:35:03 2018
+++ src/sys/arch/aarch64/aarch64/aarch64_machdep.c	Thu May  3 15:47:22 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: aarch64_machdep.c,v 1.2 2018/04/01 04:35:03 ryo Exp $ */
+/* $NetBSD: aarch64_machdep.c,v 1.3 2018/05/03 15:47:22 ryo Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: aarch64_machdep.c,v 1.2 2018/04/01 04:35:03 ryo Exp $");
+__KERNEL_RCSID(1, "$NetBSD: aarch64_machdep.c,v 1.3 2018/05/03 15:47:22 ryo Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_ddb.h"
@@ -41,6 +41,7 @@ __KERNEL_RCSID(1, "$NetBSD: aarch64_mach
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -63,6 +64,15 @@ char cpu_model[32];
 char machine[] = MACHINE;
 char machine_arch[] = MACHINE_ARCH;
 
+/* sysctl node num */
+static int sysctlnode_machdep_cpu_id;
+static int sysctlnode_machdep_id_revidr;
+static int sysctlnode_machdep_id_mvfr;
+static int sysctlnode_machdep_id_mpidr;
+static int sysctlnode_machdep_id_aa64isar;
+static int sysctlnode_machdep_id_aa64mmfr;
+static int sysctlnode_machdep_id_aa64pfr;
+
 const pcu_ops_t * const pcu_ops_md_defs[PCU_UNIT_COUNT] = {
 	[PCU_FPU] = _fpu_ops
 };
@@ -251,6 +261,130 @@ initarm_common(vaddr_t kvm_base, vsize_t
 	return tf;
 }
 
+/*
+ * machine dependent system variables.
+ */
+static int
+aarch64_sysctl_machdep_sysreg_helper(SYSCTLFN_ARGS)
+{
+	struct sysctlnode node;
+	uint64_t databuf[8];
+	void *data;
+
+	node = *rnode;
+	node.sysctl_data = data = 
+
+	/*
+	 * Don't keep values in advance due to system registers may have
+	 * different values on each CPU cores. (e.g. big.LITTLE)
+	 */
+	if (rnode->sysctl_num == sysctlnode_machdep_cpu_id) {
+		((uint32_t *)data)[0] = reg_midr_el1_read();
+		node.sysctl_size = sizeof(uint32_t);
+
+	} else if (rnode->sysctl_num == sysctlnode_machdep_id_revidr) {
+		((uint32_t *)data)[0] = reg_revidr_el1_read();
+		node.sysctl_size = sizeof(uint32_t);
+
+	} else if (rnode->sysctl_num == sysctlnode_machdep_id_mvfr) {
+		((uint32_t *)data)[0] = reg_mvfr0_el1_read();
+		((uint32_t *)data)[1] = reg_mvfr1_el1_read();
+		((uint32_t *)data)[2] = reg_mvfr2_el1_read();
+		node.sysctl_size = sizeof(uint32_t) * 3;
+
+	} else if (rnode->sysctl_num == sysctlnode_machdep_id_mpidr) {
+		((uint64_t *)data)[0] = reg_mpidr_el1_read();
+		node.sysctl_size = sizeof(uint64_t);
+
+	} else if (rnode->sysctl_num == sysctlnode_machdep_id_aa64isar) {
+		((uint64_t *)data)[0] = reg_id_aa64isar0_el1_read();
+		((uint64_t *)data)[1] = reg_id_aa64isar1_el1_read();
+		node.sysctl_size = sizeof(uint64_t) * 2;
+
+	} else if (rnode->sysctl_num == sysctlnode_machdep_id_aa64mmfr) {
+		((uint64_t *)data)[0] = reg_id_aa64mmfr0_el1_read();
+		((uint64_t *)data)[1] = reg_id_aa64mmfr1_el1_read();
+		node.sysctl_size = sizeof(uint64_t) * 2;
+
+	} else if (rnode->sysctl_num == sysctlnode_machdep_id_aa64pfr) {
+		((uint64_t *)data)[0] = reg_id_aa64pfr0_el1_read();
+		((uint64_t *)data)[1] = reg_id_aa64pfr1_el1_read();
+		node.sysctl_size = sizeof(uint64_t) * 2;
+
+	} else {
+		return EOPNOTSUPP;
+	}
+
+	return sysctl_lookup(SYSCTLFN_CALL());
+}
+
+SYSCTL_SETUP(sysctl_machdep_setup, "sysctl machdep subtree setup")
+{
+	const struct sysctlnode *node;
+
+	sysctl_createv(clog, 0, NULL, NULL,
+	CTLFLAG_PERMANENT, CTLTYPE_NODE, "machdep", NULL,
+	NULL, 0, NULL, 0, CTL_MACHDEP, CTL_EOL);
+
+	sysctl_createv(clog, 0, NULL, ,
+	CTLFLAG_PERMANENT|CTLFLAG_READONLY, CTLTYPE_INT,
+	"cpu_id",
+	SYSCTL_DESCR("MIDR_EL1, Main ID Register"),
+	aarch64_sysctl_machdep_sysreg_helper, 0, NULL, 0,
+	CTL_MACHDEP, CTL_CREATE, CTL_EOL);
+	sysctlnode_machdep_cpu_id = node->sysctl_num;
+
+	sysctl_createv(clog, 0, NULL, ,
+	CTLFLAG_PERMANENT|CTLFLAG_READONLY, CTLTYPE_INT,
+	"id_revidr",
+	SYSCTL_DESCR("REVIDR_EL1, Revision ID Register"),
+	aarch64_sysctl_machdep_sysreg_helper, 0, NULL, 0,
+	CTL_MACHDEP, CTL_CREATE, CTL_EOL);
+	sysctlnode_machdep_id_revidr = node->sysctl_num;
+
+	sysctl_createv(clog, 0, NULL, ,
+	CTLFLAG_PERMANENT|CTLFLAG_READONLY, CTLTYPE_STRUCT,
+	"id_mvfr",
+	SYSCTL_DESCR("MVFRn_EL1, 

CVS commit: src/share/misc

2018-05-03 Thread Hisashi T Fujinaka
Module Name:src
Committed By:   htodd
Date:   Thu May  3 15:38:13 UTC 2018

Modified Files:
src/share/misc: acronyms

Log Message:
Added NTBF.


To generate a diff of this commit:
cvs rdiff -u -r1.265 -r1.266 src/share/misc/acronyms

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



CVS commit: src/share/misc

2018-05-03 Thread Hisashi T Fujinaka
Module Name:src
Committed By:   htodd
Date:   Thu May  3 15:38:13 UTC 2018

Modified Files:
src/share/misc: acronyms

Log Message:
Added NTBF.


To generate a diff of this commit:
cvs rdiff -u -r1.265 -r1.266 src/share/misc/acronyms

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

Modified files:

Index: src/share/misc/acronyms
diff -u src/share/misc/acronyms:1.265 src/share/misc/acronyms:1.266
--- src/share/misc/acronyms:1.265	Sat Jan 13 03:35:40 2018
+++ src/share/misc/acronyms	Thu May  3 15:38:13 2018
@@ -1,4 +1,4 @@
-$NetBSD: acronyms,v 1.265 2018/01/13 03:35:40 pgoyette Exp $
+$NetBSD: acronyms,v 1.266 2018/05/03 15:38:13 htodd Exp $
 10Q	thank you
 10X	thanks
 1337	elite ("leet")
@@ -365,6 +365,7 @@ NRFPT	not ready for prime time
 NRN	no reply necessary
 NRN	not right now
 NSFW	not suitable for work
+NTBF	not to be fixed
 NTN	no thanks needed
 NUNP	no users, no problems
 NVM	never mind



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

2018-05-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu May  3 15:16:06 UTC 2018

Modified Files:
src/doc [netbsd-7-0]: CHANGES-7.0.3

Log Message:
Tickets #1600, #1601, #1602


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.102 -r1.1.2.103 src/doc/CHANGES-7.0.3

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

Modified files:

Index: src/doc/CHANGES-7.0.3
diff -u src/doc/CHANGES-7.0.3:1.1.2.102 src/doc/CHANGES-7.0.3:1.1.2.103
--- src/doc/CHANGES-7.0.3:1.1.2.102	Tue Apr 17 15:40:11 2018
+++ src/doc/CHANGES-7.0.3	Thu May  3 15:16:06 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.0.3,v 1.1.2.102 2018/04/17 15:40:11 martin Exp $
+# $NetBSD: CHANGES-7.0.3,v 1.1.2.103 2018/05/03 15:16:06 martin Exp $
 
 A complete list of changes from the NetBSD 7.0.2 release to the NetBSD 7.0.3
 release:
@@ -5413,3 +5413,20 @@ sys/netipsec/ipsec_mbuf.c			1.23,1.24 (p
 	Fix a pretty bad mistake (IPsec DoS).
 	[maxv, ticket #1599]
 
+sys/netipsec/ipsec_output.c			1.67,1.75 (patch)
+
+	compute_ipsec_pos: strengthen checks to avoid overruns,
+	allow the function to fail (and drop the misformed packet).
+	[maxv, ticket #1600]
+
+crypto/external/bsd/heimdal/dist/kdc/connect.c	1.3
+
+	Avoid busy-waiting on a dead child.
+	[spz, ticket #1601]
+
+sys/kern/uipc_mbuf.c1.211 (patch)
+
+	Modify m_defrag, so that it never frees the first mbuf of
+	the chain.
+	[maxv, ticket #1602]
+



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

2018-05-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu May  3 15:16:06 UTC 2018

Modified Files:
src/doc [netbsd-7-0]: CHANGES-7.0.3

Log Message:
Tickets #1600, #1601, #1602


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.102 -r1.1.2.103 src/doc/CHANGES-7.0.3

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



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

2018-05-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu May  3 15:15:17 UTC 2018

Modified Files:
src/doc [netbsd-7-1]: CHANGES-7.1.3

Log Message:
Tickets #1600, #1601, #1602


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.9 -r1.1.2.10 src/doc/CHANGES-7.1.3

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

Modified files:

Index: src/doc/CHANGES-7.1.3
diff -u src/doc/CHANGES-7.1.3:1.1.2.9 src/doc/CHANGES-7.1.3:1.1.2.10
--- src/doc/CHANGES-7.1.3:1.1.2.9	Tue Apr 17 15:38:39 2018
+++ src/doc/CHANGES-7.1.3	Thu May  3 15:15:17 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.1.3,v 1.1.2.9 2018/04/17 15:38:39 martin Exp $
+# $NetBSD: CHANGES-7.1.3,v 1.1.2.10 2018/05/03 15:15:17 martin Exp $
 
 A complete list of changes from the NetBSD 7.1.2 release to the NetBSD 7.1.3
 release:
@@ -105,3 +105,20 @@ sys/netipsec/ipsec_mbuf.c			1.23,1.24 (p
 	Fix a pretty bad mistake (IPsec DoS).
 	[maxv, ticket #1599]
 
+sys/netipsec/ipsec_output.c			1.67,1.75 (patch)
+
+	compute_ipsec_pos: strengthen checks to avoid overruns,
+	allow the function to fail (and drop the misformed packet).
+	[maxv, ticket #1600]
+
+crypto/external/bsd/heimdal/dist/kdc/connect.c	1.3
+
+	Avoid busy-waiting on a dead child.
+	[spz, ticket #1601]
+
+sys/kern/uipc_mbuf.c1.211 (patch)
+
+	Modify m_defrag, so that it never frees the first mbuf of
+	the chain.
+	[maxv, ticket #1602]
+



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

2018-05-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu May  3 15:15:17 UTC 2018

Modified Files:
src/doc [netbsd-7-1]: CHANGES-7.1.3

Log Message:
Tickets #1600, #1601, #1602


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.9 -r1.1.2.10 src/doc/CHANGES-7.1.3

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



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

2018-05-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu May  3 15:14:48 UTC 2018

Modified Files:
src/sys/kern [netbsd-7-1]: uipc_mbuf.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1602):

sys/kern/uipc_mbuf.c: revision 1.211 (via patch)

Modify m_defrag, so that it never frees the first mbuf of the chain. While
here use the given 'flags' argument, and not M_DONTWAIT.

We have a problem with several drivers: they poll an mbuf chain from their
queues and call m_defrag on them, but m_defrag could update the mbuf
pointer, so the mbuf in the queue is no longer valid. It is not easy to
fix each driver, because doing pop+push will reorder the queue, and we
don't really want that to happen.

This problem was independently spotted by me, Kengo, Masanobu, and other
people too it seems (perhaps PR/53218).

Now m_defrag leaves the first mbuf in place, and compresses the chain
only starting from the second mbuf in the chain.

It is important not to compress the first mbuf with hacks, because the
storage of this first mbuf may be shared with other mbufs.


To generate a diff of this commit:
cvs rdiff -u -r1.158.4.1.6.2 -r1.158.4.1.6.3 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.158.4.1.6.2 src/sys/kern/uipc_mbuf.c:1.158.4.1.6.3
--- src/sys/kern/uipc_mbuf.c:1.158.4.1.6.2	Tue Apr 17 08:28:55 2018
+++ src/sys/kern/uipc_mbuf.c	Thu May  3 15:14:48 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_mbuf.c,v 1.158.4.1.6.2 2018/04/17 08:28:55 martin Exp $	*/
+/*	$NetBSD: uipc_mbuf.c,v 1.158.4.1.6.3 2018/05/03 15:14:48 martin Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2001 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.158.4.1.6.2 2018/04/17 08:28:55 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.158.4.1.6.3 2018/05/03 15:14:48 martin Exp $");
 
 #include "opt_mbuftrace.h"
 #include "opt_nmbclusters.h"
@@ -1376,30 +1376,35 @@ m_makewritable(struct mbuf **mp, int off
 }
 
 /*
- * Copy the mbuf chain to a new mbuf chain that is as short as possible.
- * Return the new mbuf chain on success, NULL on failure.  On success,
- * free the old mbuf chain.
+ * Compress the mbuf chain. Return the new mbuf chain on success, NULL on
+ * failure. The first mbuf is preserved, and on success the pointer returned
+ * is the same as the one passed.
  */
 struct mbuf *
 m_defrag(struct mbuf *mold, int flags)
 {
 	struct mbuf *m0, *mn, *n;
-	size_t sz = mold->m_pkthdr.len;
+	int sz;
 
 #ifdef DIAGNOSTIC
 	if ((mold->m_flags & M_PKTHDR) == 0)
 		panic("m_defrag: not a mbuf chain header");
 #endif
 
-	m0 = m_gethdr(flags, MT_DATA);
+	if (mold->m_next == NULL)
+		return mold;
+
+	m0 = m_get(flags, MT_DATA);
 	if (m0 == NULL)
 		return NULL;
-	M_COPY_PKTHDR(m0, mold);
 	mn = m0;
 
+	sz = mold->m_pkthdr.len - mold->m_len;
+	KASSERT(sz >= 0);
+
 	do {
-		if (sz > MHLEN) {
-			MCLGET(mn, M_DONTWAIT);
+		if (sz > MLEN) {
+			MCLGET(mn, flags);
 			if ((mn->m_flags & M_EXT) == 0) {
 m_freem(m0);
 return NULL;
@@ -1415,7 +1420,7 @@ m_defrag(struct mbuf *mold, int flags)
 
 		if (sz > 0) {
 			/* need more mbufs */
-			n = m_get(M_NOWAIT, MT_DATA);
+			n = m_get(flags, MT_DATA);
 			if (n == NULL) {
 m_freem(m0);
 return NULL;
@@ -1426,9 +1431,10 @@ m_defrag(struct mbuf *mold, int flags)
 		}
 	} while (sz > 0);
 
-	m_freem(mold);
+	m_freem(mold->m_next);
+	mold->m_next = m0;
 
-	return m0;
+	return mold;
 }
 
 int



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

2018-05-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu May  3 15:14:48 UTC 2018

Modified Files:
src/sys/kern [netbsd-7-1]: uipc_mbuf.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1602):

sys/kern/uipc_mbuf.c: revision 1.211 (via patch)

Modify m_defrag, so that it never frees the first mbuf of the chain. While
here use the given 'flags' argument, and not M_DONTWAIT.

We have a problem with several drivers: they poll an mbuf chain from their
queues and call m_defrag on them, but m_defrag could update the mbuf
pointer, so the mbuf in the queue is no longer valid. It is not easy to
fix each driver, because doing pop+push will reorder the queue, and we
don't really want that to happen.

This problem was independently spotted by me, Kengo, Masanobu, and other
people too it seems (perhaps PR/53218).

Now m_defrag leaves the first mbuf in place, and compresses the chain
only starting from the second mbuf in the chain.

It is important not to compress the first mbuf with hacks, because the
storage of this first mbuf may be shared with other mbufs.


To generate a diff of this commit:
cvs rdiff -u -r1.158.4.1.6.2 -r1.158.4.1.6.3 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: [netbsd-7] src/doc

2018-05-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu May  3 15:14:15 UTC 2018

Modified Files:
src/doc [netbsd-7]: CHANGES-7.2

Log Message:
Tickets #1600, #1601, #1602


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.86 -r1.1.2.87 src/doc/CHANGES-7.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-7.2
diff -u src/doc/CHANGES-7.2:1.1.2.86 src/doc/CHANGES-7.2:1.1.2.87
--- src/doc/CHANGES-7.2:1.1.2.86	Tue Apr 17 15:36:37 2018
+++ src/doc/CHANGES-7.2	Thu May  3 15:14:14 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.2,v 1.1.2.86 2018/04/17 15:36:37 martin Exp $
+# $NetBSD: CHANGES-7.2,v 1.1.2.87 2018/05/03 15:14:14 martin Exp $
 
 A complete list of changes from the NetBSD 7.1 release to the NetBSD 7.2
 release:
@@ -5445,3 +5445,20 @@ sys/netipsec/ipsec_mbuf.c			1.23,1.24 (p
 	Fix a pretty bad mistake (IPsec DoS).
 	[maxv, ticket #1599]
 
+sys/netipsec/ipsec_output.c			1.67,1.75 (patch)
+
+	compute_ipsec_pos: strengthen checks to avoid overruns,
+	allow the function to fail (and drop the misformed packet).
+	[maxv, ticket #1600]
+
+crypto/external/bsd/heimdal/dist/kdc/connect.c	1.3
+
+	Avoid busy-waiting on a dead child.
+	[spz, ticket #1601]
+
+sys/kern/uipc_mbuf.c1.211 (patch)
+
+	Modify m_defrag, so that it never frees the first mbuf of
+	the chain.
+	[maxv, ticket #1602]
+



CVS commit: [netbsd-7] src/doc

2018-05-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu May  3 15:14:15 UTC 2018

Modified Files:
src/doc [netbsd-7]: CHANGES-7.2

Log Message:
Tickets #1600, #1601, #1602


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.86 -r1.1.2.87 src/doc/CHANGES-7.2

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



CVS commit: [netbsd-7] src/sys/kern

2018-05-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu May  3 15:13:36 UTC 2018

Modified Files:
src/sys/kern [netbsd-7]: uipc_mbuf.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1602):

sys/kern/uipc_mbuf.c: revision 1.211 (via patch)

Modify m_defrag, so that it never frees the first mbuf of the chain. While
here use the given 'flags' argument, and not M_DONTWAIT.

We have a problem with several drivers: they poll an mbuf chain from their
queues and call m_defrag on them, but m_defrag could update the mbuf
pointer, so the mbuf in the queue is no longer valid. It is not easy to
fix each driver, because doing pop+push will reorder the queue, and we
don't really want that to happen.

This problem was independently spotted by me, Kengo, Masanobu, and other
people too it seems (perhaps PR/53218).

Now m_defrag leaves the first mbuf in place, and compresses the chain
only starting from the second mbuf in the chain.

It is important not to compress the first mbuf with hacks, because the
storage of this first mbuf may be shared with other mbufs.


To generate a diff of this commit:
cvs rdiff -u -r1.158.4.3 -r1.158.4.4 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.158.4.3 src/sys/kern/uipc_mbuf.c:1.158.4.4
--- src/sys/kern/uipc_mbuf.c:1.158.4.3	Tue Apr 17 08:27:18 2018
+++ src/sys/kern/uipc_mbuf.c	Thu May  3 15:13:36 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_mbuf.c,v 1.158.4.3 2018/04/17 08:27:18 martin Exp $	*/
+/*	$NetBSD: uipc_mbuf.c,v 1.158.4.4 2018/05/03 15:13:36 martin Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2001 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.158.4.3 2018/04/17 08:27:18 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.158.4.4 2018/05/03 15:13:36 martin Exp $");
 
 #include "opt_mbuftrace.h"
 #include "opt_nmbclusters.h"
@@ -1376,30 +1376,35 @@ m_makewritable(struct mbuf **mp, int off
 }
 
 /*
- * Copy the mbuf chain to a new mbuf chain that is as short as possible.
- * Return the new mbuf chain on success, NULL on failure.  On success,
- * free the old mbuf chain.
+ * Compress the mbuf chain. Return the new mbuf chain on success, NULL on
+ * failure. The first mbuf is preserved, and on success the pointer returned
+ * is the same as the one passed.
  */
 struct mbuf *
 m_defrag(struct mbuf *mold, int flags)
 {
 	struct mbuf *m0, *mn, *n;
-	size_t sz = mold->m_pkthdr.len;
+	int sz;
 
 #ifdef DIAGNOSTIC
 	if ((mold->m_flags & M_PKTHDR) == 0)
 		panic("m_defrag: not a mbuf chain header");
 #endif
 
-	m0 = m_gethdr(flags, MT_DATA);
+	if (mold->m_next == NULL)
+		return mold;
+
+	m0 = m_get(flags, MT_DATA);
 	if (m0 == NULL)
 		return NULL;
-	M_COPY_PKTHDR(m0, mold);
 	mn = m0;
 
+	sz = mold->m_pkthdr.len - mold->m_len;
+	KASSERT(sz >= 0);
+
 	do {
-		if (sz > MHLEN) {
-			MCLGET(mn, M_DONTWAIT);
+		if (sz > MLEN) {
+			MCLGET(mn, flags);
 			if ((mn->m_flags & M_EXT) == 0) {
 m_freem(m0);
 return NULL;
@@ -1415,7 +1420,7 @@ m_defrag(struct mbuf *mold, int flags)
 
 		if (sz > 0) {
 			/* need more mbufs */
-			n = m_get(M_NOWAIT, MT_DATA);
+			n = m_get(flags, MT_DATA);
 			if (n == NULL) {
 m_freem(m0);
 return NULL;
@@ -1426,9 +1431,10 @@ m_defrag(struct mbuf *mold, int flags)
 		}
 	} while (sz > 0);
 
-	m_freem(mold);
+	m_freem(mold->m_next);
+	mold->m_next = m0;
 
-	return m0;
+	return mold;
 }
 
 int



CVS commit: [netbsd-7] src/sys/kern

2018-05-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu May  3 15:13:36 UTC 2018

Modified Files:
src/sys/kern [netbsd-7]: uipc_mbuf.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1602):

sys/kern/uipc_mbuf.c: revision 1.211 (via patch)

Modify m_defrag, so that it never frees the first mbuf of the chain. While
here use the given 'flags' argument, and not M_DONTWAIT.

We have a problem with several drivers: they poll an mbuf chain from their
queues and call m_defrag on them, but m_defrag could update the mbuf
pointer, so the mbuf in the queue is no longer valid. It is not easy to
fix each driver, because doing pop+push will reorder the queue, and we
don't really want that to happen.

This problem was independently spotted by me, Kengo, Masanobu, and other
people too it seems (perhaps PR/53218).

Now m_defrag leaves the first mbuf in place, and compresses the chain
only starting from the second mbuf in the chain.

It is important not to compress the first mbuf with hacks, because the
storage of this first mbuf may be shared with other mbufs.


To generate a diff of this commit:
cvs rdiff -u -r1.158.4.3 -r1.158.4.4 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: [netbsd-7-0] src/crypto/external/bsd/heimdal/dist/kdc

2018-05-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu May  3 15:09:43 UTC 2018

Modified Files:
src/crypto/external/bsd/heimdal/dist/kdc [netbsd-7-0]: connect.c

Log Message:
Pull up following revision(s) (requested by spz in ticket #1601):

crypto/external/bsd/heimdal/dist/kdc/connect.c: revision 1.3

avoid busy-waiting on a dead child


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2.4.1 -r1.1.1.2.4.2 \
src/crypto/external/bsd/heimdal/dist/kdc/connect.c

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

Modified files:

Index: src/crypto/external/bsd/heimdal/dist/kdc/connect.c
diff -u src/crypto/external/bsd/heimdal/dist/kdc/connect.c:1.1.1.2.4.1 src/crypto/external/bsd/heimdal/dist/kdc/connect.c:1.1.1.2.4.2
--- src/crypto/external/bsd/heimdal/dist/kdc/connect.c:1.1.1.2.4.1	Sun Aug 20 05:42:01 2017
+++ src/crypto/external/bsd/heimdal/dist/kdc/connect.c	Thu May  3 15:09:43 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: connect.c,v 1.1.1.2.4.1 2017/08/20 05:42:01 snj Exp $	*/
+/*	$NetBSD: connect.c,v 1.1.1.2.4.2 2018/05/03 15:09:43 martin Exp $	*/
 
 /*
  * Copyright (c) 1997-2005 Kungliga Tekniska Högskolan
@@ -1193,7 +1193,7 @@ start_kdc(krb5_context context,
 break;
 default:
 for (i=0; i < max_kdcs; i++) {
-if (pids[i] == 0) {
+if (pids[i] < 1) {
 pids[i] = pid;
 break;
 }



CVS commit: [netbsd-7-0] src/crypto/external/bsd/heimdal/dist/kdc

2018-05-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu May  3 15:09:43 UTC 2018

Modified Files:
src/crypto/external/bsd/heimdal/dist/kdc [netbsd-7-0]: connect.c

Log Message:
Pull up following revision(s) (requested by spz in ticket #1601):

crypto/external/bsd/heimdal/dist/kdc/connect.c: revision 1.3

avoid busy-waiting on a dead child


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2.4.1 -r1.1.1.2.4.2 \
src/crypto/external/bsd/heimdal/dist/kdc/connect.c

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



CVS commit: [netbsd-7-1] src/crypto/external/bsd/heimdal/dist/kdc

2018-05-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu May  3 15:08:54 UTC 2018

Modified Files:
src/crypto/external/bsd/heimdal/dist/kdc [netbsd-7-1]: connect.c

Log Message:
Pull up following revision(s) (requested by spz in ticket #1601):

crypto/external/bsd/heimdal/dist/kdc/connect.c: revision 1.3

avoid busy-waiting on a dead child


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2.12.1 -r1.1.1.2.12.2 \
src/crypto/external/bsd/heimdal/dist/kdc/connect.c

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

Modified files:

Index: src/crypto/external/bsd/heimdal/dist/kdc/connect.c
diff -u src/crypto/external/bsd/heimdal/dist/kdc/connect.c:1.1.1.2.12.1 src/crypto/external/bsd/heimdal/dist/kdc/connect.c:1.1.1.2.12.2
--- src/crypto/external/bsd/heimdal/dist/kdc/connect.c:1.1.1.2.12.1	Sun Aug 20 05:44:14 2017
+++ src/crypto/external/bsd/heimdal/dist/kdc/connect.c	Thu May  3 15:08:54 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: connect.c,v 1.1.1.2.12.1 2017/08/20 05:44:14 snj Exp $	*/
+/*	$NetBSD: connect.c,v 1.1.1.2.12.2 2018/05/03 15:08:54 martin Exp $	*/
 
 /*
  * Copyright (c) 1997-2005 Kungliga Tekniska Högskolan
@@ -1193,7 +1193,7 @@ start_kdc(krb5_context context,
 break;
 default:
 for (i=0; i < max_kdcs; i++) {
-if (pids[i] == 0) {
+if (pids[i] < 1) {
 pids[i] = pid;
 break;
 }



CVS commit: [netbsd-7-1] src/crypto/external/bsd/heimdal/dist/kdc

2018-05-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu May  3 15:08:54 UTC 2018

Modified Files:
src/crypto/external/bsd/heimdal/dist/kdc [netbsd-7-1]: connect.c

Log Message:
Pull up following revision(s) (requested by spz in ticket #1601):

crypto/external/bsd/heimdal/dist/kdc/connect.c: revision 1.3

avoid busy-waiting on a dead child


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2.12.1 -r1.1.1.2.12.2 \
src/crypto/external/bsd/heimdal/dist/kdc/connect.c

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



CVS commit: [netbsd-7] src/crypto/external/bsd/heimdal/dist/kdc

2018-05-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu May  3 15:08:09 UTC 2018

Modified Files:
src/crypto/external/bsd/heimdal/dist/kdc [netbsd-7]: connect.c

Log Message:
Pull up following revision(s) (requested by spz in ticket #1601):

crypto/external/bsd/heimdal/dist/kdc/connect.c: revision 1.3

avoid busy-waiting on a dead child


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2.2.1 -r1.1.1.2.2.2 \
src/crypto/external/bsd/heimdal/dist/kdc/connect.c

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

Modified files:

Index: src/crypto/external/bsd/heimdal/dist/kdc/connect.c
diff -u src/crypto/external/bsd/heimdal/dist/kdc/connect.c:1.1.1.2.2.1 src/crypto/external/bsd/heimdal/dist/kdc/connect.c:1.1.1.2.2.2
--- src/crypto/external/bsd/heimdal/dist/kdc/connect.c:1.1.1.2.2.1	Sun Aug 20 05:46:33 2017
+++ src/crypto/external/bsd/heimdal/dist/kdc/connect.c	Thu May  3 15:08:09 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: connect.c,v 1.1.1.2.2.1 2017/08/20 05:46:33 snj Exp $	*/
+/*	$NetBSD: connect.c,v 1.1.1.2.2.2 2018/05/03 15:08:09 martin Exp $	*/
 
 /*
  * Copyright (c) 1997-2005 Kungliga Tekniska Högskolan
@@ -1193,7 +1193,7 @@ start_kdc(krb5_context context,
 break;
 default:
 for (i=0; i < max_kdcs; i++) {
-if (pids[i] == 0) {
+if (pids[i] < 1) {
 pids[i] = pid;
 break;
 }



CVS commit: [netbsd-7] src/crypto/external/bsd/heimdal/dist/kdc

2018-05-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu May  3 15:08:09 UTC 2018

Modified Files:
src/crypto/external/bsd/heimdal/dist/kdc [netbsd-7]: connect.c

Log Message:
Pull up following revision(s) (requested by spz in ticket #1601):

crypto/external/bsd/heimdal/dist/kdc/connect.c: revision 1.3

avoid busy-waiting on a dead child


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2.2.1 -r1.1.1.2.2.2 \
src/crypto/external/bsd/heimdal/dist/kdc/connect.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/doc

2018-05-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu May  3 15:05:46 UTC 2018

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

Log Message:
Fix entry for ticket #1547


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.336 -r1.1.2.337 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-05-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu May  3 15:05:46 UTC 2018

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

Log Message:
Fix entry for ticket #1547


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.336 -r1.1.2.337 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.336 src/doc/CHANGES-6.2:1.1.2.337
--- src/doc/CHANGES-6.2:1.1.2.336	Thu May  3 14:58:46 2018
+++ src/doc/CHANGES-6.2	Thu May  3 15:05:46 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.2,v 1.1.2.336 2018/05/03 14:58:46 martin Exp $
+# $NetBSD: CHANGES-6.2,v 1.1.2.337 2018/05/03 15:05:46 martin Exp $
 
 A complete list of changes from the 6.1 release until the 6.2 release:
 
@@ -21240,7 +21240,7 @@ sys/netipsec/ipsec_output.c			1.67,1.75 
 	allow the function to fail (and drop the misformed packet).
 	[maxv, ticket #1546]
 
-sys/kern/uipc_mbuf.c1.211
+sys/kern/uipc_mbuf.c1.211 (patch)
 
 	Modify m_defrag, so that it never frees the first mbuf of
 	the chain.



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

2018-05-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu May  3 15:05:21 UTC 2018

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

Log Message:
Fix entry for ticket #1547


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.140 -r1.1.2.141 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/doc

2018-05-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu May  3 15:05:21 UTC 2018

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

Log Message:
Fix entry for ticket #1547


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.140 -r1.1.2.141 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.140 src/doc/CHANGES-6.1.6:1.1.2.141
--- src/doc/CHANGES-6.1.6:1.1.2.140	Thu May  3 15:01:58 2018
+++ src/doc/CHANGES-6.1.6	Thu May  3 15:05:21 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.1.6,v 1.1.2.140 2018/05/03 15:01:58 martin Exp $
+# $NetBSD: CHANGES-6.1.6,v 1.1.2.141 2018/05/03 15:05:21 martin Exp $
 
 A complete list of changes from the NetBSD 6.1.5 release to the NetBSD 6.1.6
 release:
@@ -15135,7 +15135,7 @@ sys/netipsec/ipsec_output.c			1.67,1.75 
 	allow the function to fail (and drop the misformed packet).
 	[maxv, ticket #1546]
 
-sys/kern/uipc_mbuf.c1.211
+sys/kern/uipc_mbuf.c1.211 (patch)
 
 	Modify m_defrag, so that it never frees the first mbuf of
 	the chain.



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

2018-05-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu May  3 15:04:51 UTC 2018

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

Log Message:
Fix entry for ticket #1547


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.143 -r1.1.2.144 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.143 src/doc/CHANGES-6.0.7:1.1.2.144
--- src/doc/CHANGES-6.0.7:1.1.2.143	Thu May  3 15:02:57 2018
+++ src/doc/CHANGES-6.0.7	Thu May  3 15:04:51 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.0.7,v 1.1.2.143 2018/05/03 15:02:57 martin Exp $
+# $NetBSD: CHANGES-6.0.7,v 1.1.2.144 2018/05/03 15:04:51 martin Exp $
 
 A complete list of changes from the NetBSD 6.0.6 release to the NetBSD 6.0.7
 release:
@@ -15466,7 +15466,7 @@ sys/netipsec/ipsec_output.c			1.67,1.75 
 	allow the function to fail (and drop the misformed packet).
 	[maxv, ticket #1546]
 
-sys/kern/uipc_mbuf.c1.211
+sys/kern/uipc_mbuf.c1.211 (patch)
 
 	Modify m_defrag, so that it never frees the first mbuf of
 	the chain.



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

2018-05-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu May  3 15:04:51 UTC 2018

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

Log Message:
Fix entry for ticket #1547


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.143 -r1.1.2.144 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-05-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu May  3 15:02:57 UTC 2018

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

Log Message:
Tickets #1546 and #1547


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.142 -r1.1.2.143 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-05-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu May  3 15:02:57 UTC 2018

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

Log Message:
Tickets #1546 and #1547


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.142 -r1.1.2.143 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.142 src/doc/CHANGES-6.0.7:1.1.2.143
--- src/doc/CHANGES-6.0.7:1.1.2.142	Wed Apr 18 07:20:17 2018
+++ src/doc/CHANGES-6.0.7	Thu May  3 15:02:57 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.0.7,v 1.1.2.142 2018/04/18 07:20:17 msaitoh Exp $
+# $NetBSD: CHANGES-6.0.7,v 1.1.2.143 2018/05/03 15:02:57 martin Exp $
 
 A complete list of changes from the NetBSD 6.0.6 release to the NetBSD 6.0.7
 release:
@@ -15459,3 +15459,16 @@ sys/netipsec/ipsec_mbuf.c			1.23-1.24
 	Don't assume M_PKTHDR is set only on the first mbuf of the chain.
 	Fix a pretty bad mistake (IPsec DoS).
 	[maxv, ticket #1545]
+
+sys/netipsec/ipsec_output.c			1.67,1.75 (patch)
+
+	compute_ipsec_pos: strengthen checks to avoid overruns,
+	allow the function to fail (and drop the misformed packet).
+	[maxv, ticket #1546]
+
+sys/kern/uipc_mbuf.c1.211
+
+	Modify m_defrag, so that it never frees the first mbuf of
+	the chain.
+	[maxv, ticket #1547]
+



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

2018-05-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu May  3 15:02:30 UTC 2018

Modified Files:
src/sys/kern [netbsd-6-0]: uipc_mbuf.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1547):

sys/kern/uipc_mbuf.c: revision 1.211 (via patch)

Modify m_defrag, so that it never frees the first mbuf of the chain. While
here use the given 'flags' argument, and not M_DONTWAIT.

We have a problem with several drivers: they poll an mbuf chain from their
queues and call m_defrag on them, but m_defrag could update the mbuf
pointer, so the mbuf in the queue is no longer valid. It is not easy to
fix each driver, because doing pop+push will reorder the queue, and we
don't really want that to happen.

This problem was independently spotted by me, Kengo, Masanobu, and other
people too it seems (perhaps PR/53218).

Now m_defrag leaves the first mbuf in place, and compresses the chain
only starting from the second mbuf in the chain.

It is important not to compress the first mbuf with hacks, because the
storage of this first mbuf may be shared with other mbufs.


To generate a diff of this commit:
cvs rdiff -u -r1.145 -r1.145.6.1 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: [netbsd-6-0] src/sys/kern

2018-05-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu May  3 15:02:30 UTC 2018

Modified Files:
src/sys/kern [netbsd-6-0]: uipc_mbuf.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1547):

sys/kern/uipc_mbuf.c: revision 1.211 (via patch)

Modify m_defrag, so that it never frees the first mbuf of the chain. While
here use the given 'flags' argument, and not M_DONTWAIT.

We have a problem with several drivers: they poll an mbuf chain from their
queues and call m_defrag on them, but m_defrag could update the mbuf
pointer, so the mbuf in the queue is no longer valid. It is not easy to
fix each driver, because doing pop+push will reorder the queue, and we
don't really want that to happen.

This problem was independently spotted by me, Kengo, Masanobu, and other
people too it seems (perhaps PR/53218).

Now m_defrag leaves the first mbuf in place, and compresses the chain
only starting from the second mbuf in the chain.

It is important not to compress the first mbuf with hacks, because the
storage of this first mbuf may be shared with other mbufs.


To generate a diff of this commit:
cvs rdiff -u -r1.145 -r1.145.6.1 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.145 src/sys/kern/uipc_mbuf.c:1.145.6.1
--- src/sys/kern/uipc_mbuf.c:1.145	Fri Feb 10 17:35:47 2012
+++ src/sys/kern/uipc_mbuf.c	Thu May  3 15:02:30 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_mbuf.c,v 1.145 2012/02/10 17:35:47 para Exp $	*/
+/*	$NetBSD: uipc_mbuf.c,v 1.145.6.1 2018/05/03 15:02:30 martin Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2001 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.145 2012/02/10 17:35:47 para Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.145.6.1 2018/05/03 15:02:30 martin Exp $");
 
 #include "opt_mbuftrace.h"
 #include "opt_nmbclusters.h"
@@ -1252,30 +1252,35 @@ m_makewritable(struct mbuf **mp, int off
 }
 
 /*
- * Copy the mbuf chain to a new mbuf chain that is as short as possible.
- * Return the new mbuf chain on success, NULL on failure.  On success,
- * free the old mbuf chain.
+ * Compress the mbuf chain. Return the new mbuf chain on success, NULL on
+ * failure. The first mbuf is preserved, and on success the pointer returned
+ * is the same as the one passed.
  */
 struct mbuf *
 m_defrag(struct mbuf *mold, int flags)
 {
 	struct mbuf *m0, *mn, *n;
-	size_t sz = mold->m_pkthdr.len;
+	int sz;
 
 #ifdef DIAGNOSTIC
 	if ((mold->m_flags & M_PKTHDR) == 0)
 		panic("m_defrag: not a mbuf chain header");
 #endif
 
-	MGETHDR(m0, flags, MT_DATA);
+	if (mold->m_next == NULL)
+		return mold;
+
+	m0 = m_get(flags, MT_DATA);
 	if (m0 == NULL)
 		return NULL;
-	M_COPY_PKTHDR(m0, mold);
 	mn = m0;
 
+	sz = mold->m_pkthdr.len - mold->m_len;
+	KASSERT(sz >= 0);
+
 	do {
-		if (sz > MHLEN) {
-			MCLGET(mn, M_DONTWAIT);
+		if (sz > MLEN) {
+			MCLGET(mn, flags);
 			if ((mn->m_flags & M_EXT) == 0) {
 m_freem(m0);
 return NULL;
@@ -1291,7 +1296,7 @@ m_defrag(struct mbuf *mold, int flags)
 
 		if (sz > 0) {
 			/* need more mbufs */
-			MGET(n, M_NOWAIT, MT_DATA);
+			n = m_get(flags, MT_DATA);
 			if (n == NULL) {
 m_freem(m0);
 return NULL;
@@ -1302,9 +1307,10 @@ m_defrag(struct mbuf *mold, int flags)
 		}
 	} while (sz > 0);
 
-	m_freem(mold);
+	m_freem(mold->m_next);
+	mold->m_next = m0;
 
-	return m0;
+	return mold;
 }
 
 int



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

2018-05-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu May  3 15:01:58 UTC 2018

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

Log Message:
Tickets #1546 and #1547


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.139 -r1.1.2.140 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/doc

2018-05-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu May  3 15:01:58 UTC 2018

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

Log Message:
Tickets #1546 and #1547


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.139 -r1.1.2.140 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.139 src/doc/CHANGES-6.1.6:1.1.2.140
--- src/doc/CHANGES-6.1.6:1.1.2.139	Wed Apr 18 07:19:52 2018
+++ src/doc/CHANGES-6.1.6	Thu May  3 15:01:58 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.1.6,v 1.1.2.139 2018/04/18 07:19:52 msaitoh Exp $
+# $NetBSD: CHANGES-6.1.6,v 1.1.2.140 2018/05/03 15:01:58 martin Exp $
 
 A complete list of changes from the NetBSD 6.1.5 release to the NetBSD 6.1.6
 release:
@@ -15128,3 +15128,16 @@ sys/netipsec/ipsec_mbuf.c			1.23-1.24
 	Don't assume M_PKTHDR is set only on the first mbuf of the chain.
 	Fix a pretty bad mistake (IPsec DoS).
 	[maxv, ticket #1545]
+
+sys/netipsec/ipsec_output.c			1.67,1.75 (patch)
+
+	compute_ipsec_pos: strengthen checks to avoid overruns,
+	allow the function to fail (and drop the misformed packet).
+	[maxv, ticket #1546]
+
+sys/kern/uipc_mbuf.c1.211
+
+	Modify m_defrag, so that it never frees the first mbuf of
+	the chain.
+	[maxv, ticket #1547]
+



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

2018-05-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu May  3 15:01:20 UTC 2018

Modified Files:
src/sys/kern [netbsd-6-1]: uipc_mbuf.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1547):

sys/kern/uipc_mbuf.c: revision 1.211 (via patch)

Modify m_defrag, so that it never frees the first mbuf of the chain. While
here use the given 'flags' argument, and not M_DONTWAIT.

We have a problem with several drivers: they poll an mbuf chain from their
queues and call m_defrag on them, but m_defrag could update the mbuf
pointer, so the mbuf in the queue is no longer valid. It is not easy to
fix each driver, because doing pop+push will reorder the queue, and we
don't really want that to happen.

This problem was independently spotted by me, Kengo, Masanobu, and other
people too it seems (perhaps PR/53218).

Now m_defrag leaves the first mbuf in place, and compresses the chain
only starting from the second mbuf in the chain.

It is important not to compress the first mbuf with hacks, because the
storage of this first mbuf may be shared with other mbufs.


To generate a diff of this commit:
cvs rdiff -u -r1.145.2.1 -r1.145.2.1.2.1 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: [netbsd-6-1] src/sys/kern

2018-05-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu May  3 15:01:20 UTC 2018

Modified Files:
src/sys/kern [netbsd-6-1]: uipc_mbuf.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1547):

sys/kern/uipc_mbuf.c: revision 1.211 (via patch)

Modify m_defrag, so that it never frees the first mbuf of the chain. While
here use the given 'flags' argument, and not M_DONTWAIT.

We have a problem with several drivers: they poll an mbuf chain from their
queues and call m_defrag on them, but m_defrag could update the mbuf
pointer, so the mbuf in the queue is no longer valid. It is not easy to
fix each driver, because doing pop+push will reorder the queue, and we
don't really want that to happen.

This problem was independently spotted by me, Kengo, Masanobu, and other
people too it seems (perhaps PR/53218).

Now m_defrag leaves the first mbuf in place, and compresses the chain
only starting from the second mbuf in the chain.

It is important not to compress the first mbuf with hacks, because the
storage of this first mbuf may be shared with other mbufs.


To generate a diff of this commit:
cvs rdiff -u -r1.145.2.1 -r1.145.2.1.2.1 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.145.2.1 src/sys/kern/uipc_mbuf.c:1.145.2.1.2.1
--- src/sys/kern/uipc_mbuf.c:1.145.2.1	Fri Feb  8 19:18:12 2013
+++ src/sys/kern/uipc_mbuf.c	Thu May  3 15:01:20 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_mbuf.c,v 1.145.2.1 2013/02/08 19:18:12 riz Exp $	*/
+/*	$NetBSD: uipc_mbuf.c,v 1.145.2.1.2.1 2018/05/03 15:01:20 martin Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2001 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.145.2.1 2013/02/08 19:18:12 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.145.2.1.2.1 2018/05/03 15:01:20 martin Exp $");
 
 #include "opt_mbuftrace.h"
 #include "opt_nmbclusters.h"
@@ -1266,30 +1266,35 @@ m_makewritable(struct mbuf **mp, int off
 }
 
 /*
- * Copy the mbuf chain to a new mbuf chain that is as short as possible.
- * Return the new mbuf chain on success, NULL on failure.  On success,
- * free the old mbuf chain.
+ * Compress the mbuf chain. Return the new mbuf chain on success, NULL on
+ * failure. The first mbuf is preserved, and on success the pointer returned
+ * is the same as the one passed.
  */
 struct mbuf *
 m_defrag(struct mbuf *mold, int flags)
 {
 	struct mbuf *m0, *mn, *n;
-	size_t sz = mold->m_pkthdr.len;
+	int sz;
 
 #ifdef DIAGNOSTIC
 	if ((mold->m_flags & M_PKTHDR) == 0)
 		panic("m_defrag: not a mbuf chain header");
 #endif
 
-	MGETHDR(m0, flags, MT_DATA);
+	if (mold->m_next == NULL)
+		return mold;
+
+	m0 = m_get(flags, MT_DATA);
 	if (m0 == NULL)
 		return NULL;
-	M_COPY_PKTHDR(m0, mold);
 	mn = m0;
 
+	sz = mold->m_pkthdr.len - mold->m_len;
+	KASSERT(sz >= 0);
+
 	do {
-		if (sz > MHLEN) {
-			MCLGET(mn, M_DONTWAIT);
+		if (sz > MLEN) {
+			MCLGET(mn, flags);
 			if ((mn->m_flags & M_EXT) == 0) {
 m_freem(m0);
 return NULL;
@@ -1305,7 +1310,7 @@ m_defrag(struct mbuf *mold, int flags)
 
 		if (sz > 0) {
 			/* need more mbufs */
-			MGET(n, M_NOWAIT, MT_DATA);
+			n = m_get(flags, MT_DATA);
 			if (n == NULL) {
 m_freem(m0);
 return NULL;
@@ -1316,9 +1321,10 @@ m_defrag(struct mbuf *mold, int flags)
 		}
 	} while (sz > 0);
 
-	m_freem(mold);
+	m_freem(mold->m_next);
+	mold->m_next = m0;
 
-	return m0;
+	return mold;
 }
 
 int



CVS commit: [netbsd-6] src/sys/kern

2018-05-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu May  3 15:00:38 UTC 2018

Modified Files:
src/sys/kern [netbsd-6]: uipc_mbuf.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1547):

sys/kern/uipc_mbuf.c: revision 1.211 (via patch)

Modify m_defrag, so that it never frees the first mbuf of the chain. While
here use the given 'flags' argument, and not M_DONTWAIT.

We have a problem with several drivers: they poll an mbuf chain from their
queues and call m_defrag on them, but m_defrag could update the mbuf
pointer, so the mbuf in the queue is no longer valid. It is not easy to
fix each driver, because doing pop+push will reorder the queue, and we
don't really want that to happen.

This problem was independently spotted by me, Kengo, Masanobu, and other
people too it seems (perhaps PR/53218).

Now m_defrag leaves the first mbuf in place, and compresses the chain
only starting from the second mbuf in the chain.

It is important not to compress the first mbuf with hacks, because the
storage of this first mbuf may be shared with other mbufs.


To generate a diff of this commit:
cvs rdiff -u -r1.145.2.1 -r1.145.2.2 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.145.2.1 src/sys/kern/uipc_mbuf.c:1.145.2.2
--- src/sys/kern/uipc_mbuf.c:1.145.2.1	Fri Feb  8 19:18:12 2013
+++ src/sys/kern/uipc_mbuf.c	Thu May  3 15:00:37 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_mbuf.c,v 1.145.2.1 2013/02/08 19:18:12 riz Exp $	*/
+/*	$NetBSD: uipc_mbuf.c,v 1.145.2.2 2018/05/03 15:00:37 martin Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2001 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.145.2.1 2013/02/08 19:18:12 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.145.2.2 2018/05/03 15:00:37 martin Exp $");
 
 #include "opt_mbuftrace.h"
 #include "opt_nmbclusters.h"
@@ -1266,30 +1266,35 @@ m_makewritable(struct mbuf **mp, int off
 }
 
 /*
- * Copy the mbuf chain to a new mbuf chain that is as short as possible.
- * Return the new mbuf chain on success, NULL on failure.  On success,
- * free the old mbuf chain.
+ * Compress the mbuf chain. Return the new mbuf chain on success, NULL on
+ * failure. The first mbuf is preserved, and on success the pointer returned
+ * is the same as the one passed.
  */
 struct mbuf *
 m_defrag(struct mbuf *mold, int flags)
 {
 	struct mbuf *m0, *mn, *n;
-	size_t sz = mold->m_pkthdr.len;
+	int sz;
 
 #ifdef DIAGNOSTIC
 	if ((mold->m_flags & M_PKTHDR) == 0)
 		panic("m_defrag: not a mbuf chain header");
 #endif
 
-	MGETHDR(m0, flags, MT_DATA);
+	if (mold->m_next == NULL)
+		return mold;
+
+	m0 = m_get(flags, MT_DATA);
 	if (m0 == NULL)
 		return NULL;
-	M_COPY_PKTHDR(m0, mold);
 	mn = m0;
 
+	sz = mold->m_pkthdr.len - mold->m_len;
+	KASSERT(sz >= 0);
+
 	do {
-		if (sz > MHLEN) {
-			MCLGET(mn, M_DONTWAIT);
+		if (sz > MLEN) {
+			MCLGET(mn, flags);
 			if ((mn->m_flags & M_EXT) == 0) {
 m_freem(m0);
 return NULL;
@@ -1305,7 +1310,7 @@ m_defrag(struct mbuf *mold, int flags)
 
 		if (sz > 0) {
 			/* need more mbufs */
-			MGET(n, M_NOWAIT, MT_DATA);
+			n = m_get(flags, MT_DATA);
 			if (n == NULL) {
 m_freem(m0);
 return NULL;
@@ -1316,9 +1321,10 @@ m_defrag(struct mbuf *mold, int flags)
 		}
 	} while (sz > 0);
 
-	m_freem(mold);
+	m_freem(mold->m_next);
+	mold->m_next = m0;
 
-	return m0;
+	return mold;
 }
 
 int



CVS commit: [netbsd-6] src/sys/kern

2018-05-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu May  3 15:00:38 UTC 2018

Modified Files:
src/sys/kern [netbsd-6]: uipc_mbuf.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1547):

sys/kern/uipc_mbuf.c: revision 1.211 (via patch)

Modify m_defrag, so that it never frees the first mbuf of the chain. While
here use the given 'flags' argument, and not M_DONTWAIT.

We have a problem with several drivers: they poll an mbuf chain from their
queues and call m_defrag on them, but m_defrag could update the mbuf
pointer, so the mbuf in the queue is no longer valid. It is not easy to
fix each driver, because doing pop+push will reorder the queue, and we
don't really want that to happen.

This problem was independently spotted by me, Kengo, Masanobu, and other
people too it seems (perhaps PR/53218).

Now m_defrag leaves the first mbuf in place, and compresses the chain
only starting from the second mbuf in the chain.

It is important not to compress the first mbuf with hacks, because the
storage of this first mbuf may be shared with other mbufs.


To generate a diff of this commit:
cvs rdiff -u -r1.145.2.1 -r1.145.2.2 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: [netbsd-6] src/doc

2018-05-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu May  3 14:58:46 UTC 2018

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

Log Message:
Tickets #1546 and #1547


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.335 -r1.1.2.336 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.335 src/doc/CHANGES-6.2:1.1.2.336
--- src/doc/CHANGES-6.2:1.1.2.335	Wed Apr 18 07:19:23 2018
+++ src/doc/CHANGES-6.2	Thu May  3 14:58:46 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.2,v 1.1.2.335 2018/04/18 07:19:23 msaitoh Exp $
+# $NetBSD: CHANGES-6.2,v 1.1.2.336 2018/05/03 14:58:46 martin Exp $
 
 A complete list of changes from the 6.1 release until the 6.2 release:
 
@@ -21233,3 +21233,16 @@ sys/netipsec/ipsec_mbuf.c			1.23-1.24
 	Don't assume M_PKTHDR is set only on the first mbuf of the chain.
 	Fix a pretty bad mistake (IPsec DoS).
 	[maxv, ticket #1545]
+
+sys/netipsec/ipsec_output.c			1.67,1.75 (patch)
+
+	compute_ipsec_pos: strengthen checks to avoid overruns,
+	allow the function to fail (and drop the misformed packet).
+	[maxv, ticket #1546]
+
+sys/kern/uipc_mbuf.c1.211
+
+	Modify m_defrag, so that it never frees the first mbuf of
+	the chain.
+	[maxv, ticket #1547]
+



CVS commit: [netbsd-6] src/doc

2018-05-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu May  3 14:58:46 UTC 2018

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

Log Message:
Tickets #1546 and #1547


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.335 -r1.1.2.336 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-7-0] src/sys/netipsec

2018-05-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu May  3 14:49:50 UTC 2018

Modified Files:
src/sys/netipsec [netbsd-7-0]: ipsec_output.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1600):

sys/netipsec/ipsec_output.c: revision 1.67,1.75 (via patch)

Strengthen this check, to make sure there is room for an ip6_ext structure.
Seems possible to crash m_copydata here (but I didn't test more than that).

Fix the checks in compute_ipsec_pos, otherwise m_copydata could crash. I
already fixed half of the problem two months ago in rev1.67, back then I
thought it was not triggerable because each packet we emit is guaranteed
to have correctly formed IPv6 options; but it is actually triggerable via
IPv6 forwarding, we emit a packet we just received, and we don't sanitize
its options before invoking IPsec.

Since it would be wrong to just stop the iteration and continue the IPsec
processing, allow compute_ipsec_pos to fail, and when it does, drop the
packet entirely.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.40.8.1 src/sys/netipsec/ipsec_output.c

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

Modified files:

Index: src/sys/netipsec/ipsec_output.c
diff -u src/sys/netipsec/ipsec_output.c:1.40 src/sys/netipsec/ipsec_output.c:1.40.8.1
--- src/sys/netipsec/ipsec_output.c:1.40	Sun Nov  3 18:37:10 2013
+++ src/sys/netipsec/ipsec_output.c	Thu May  3 14:49:50 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipsec_output.c,v 1.40 2013/11/03 18:37:10 mrg Exp $	*/
+/*	$NetBSD: ipsec_output.c,v 1.40.8.1 2018/05/03 14:49:50 martin Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2003 Sam Leffler, Errno Consulting
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ipsec_output.c,v 1.40 2013/11/03 18:37:10 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipsec_output.c,v 1.40.8.1 2018/05/03 14:49:50 martin Exp $");
 
 /*
  * IPsec output processing.
@@ -624,7 +624,7 @@ bad:
 #endif
 
 #ifdef INET6
-static void
+static int
 compute_ipsec_pos(struct mbuf *m, int *i, int *off)
 {
 	int nxt;
@@ -641,7 +641,11 @@ compute_ipsec_pos(struct mbuf *m, int *i
 	 * put AH/ESP/IPcomp header.
 	 *  IPv6 hbh dest1 rthdr ah* [esp* dest2 payload]
 	 */
-	do {
+	while (1) {
+		if (*i + sizeof(ip6e) > m->m_pkthdr.len) {
+			return EINVAL;
+		}
+
 		switch (nxt) {
 		case IPPROTO_AH:
 		case IPPROTO_ESP:
@@ -650,7 +654,7 @@ compute_ipsec_pos(struct mbuf *m, int *i
 		 * we should not skip security header added
 		 * beforehand.
 		 */
-			return;
+			return 0;
 
 		case IPPROTO_HOPOPTS:
 		case IPPROTO_DSTOPTS:
@@ -660,7 +664,7 @@ compute_ipsec_pos(struct mbuf *m, int *i
 		 * we should stop there.
 		 */
 			if (nxt == IPPROTO_DSTOPTS && dstopt)
-return;
+return 0;
 
 			if (nxt == IPPROTO_DSTOPTS) {
 /*
@@ -680,16 +684,14 @@ compute_ipsec_pos(struct mbuf *m, int *i
 			m_copydata(m, *i, sizeof(ip6e), );
 			nxt = ip6e.ip6e_nxt;
 			*off = *i + offsetof(struct ip6_ext, ip6e_nxt);
-			/*
-			 * we will never see nxt == IPPROTO_AH
-			 * so it is safe to omit AH case.
-			 */
 			*i += (ip6e.ip6e_len + 1) << 3;
 			break;
 		default:
-			return;
+			return 0;
 		}
-	} while (*i < m->m_pkthdr.len);
+	}
+
+	return 0;
 }
 
 static int
@@ -791,7 +793,9 @@ ipsec6_process_packet(
 		i = ip->ip_hl << 2;
 		off = offsetof(struct ip, ip_p);
 	} else {	
-		compute_ipsec_pos(m, , );
+		error = compute_ipsec_pos(m, , );
+		if (error)
+			goto bad;
 	}
 	error = (*sav->tdb_xform->xf_output)(m, isr, NULL, i, off);
 	splx(s);



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

2018-05-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu May  3 14:48:26 UTC 2018

Modified Files:
src/sys/netipsec [netbsd-7-1]: ipsec_output.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1600):

sys/netipsec/ipsec_output.c: revision 1.67,1.75 (via patch)

Strengthen this check, to make sure there is room for an ip6_ext structure.
Seems possible to crash m_copydata here (but I didn't test more than that).

Fix the checks in compute_ipsec_pos, otherwise m_copydata could crash. I
already fixed half of the problem two months ago in rev1.67, back then I
thought it was not triggerable because each packet we emit is guaranteed
to have correctly formed IPv6 options; but it is actually triggerable via
IPv6 forwarding, we emit a packet we just received, and we don't sanitize
its options before invoking IPsec.

Since it would be wrong to just stop the iteration and continue the IPsec
processing, allow compute_ipsec_pos to fail, and when it does, drop the
packet entirely.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.40.12.1 src/sys/netipsec/ipsec_output.c

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

Modified files:

Index: src/sys/netipsec/ipsec_output.c
diff -u src/sys/netipsec/ipsec_output.c:1.40 src/sys/netipsec/ipsec_output.c:1.40.12.1
--- src/sys/netipsec/ipsec_output.c:1.40	Sun Nov  3 18:37:10 2013
+++ src/sys/netipsec/ipsec_output.c	Thu May  3 14:48:26 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipsec_output.c,v 1.40 2013/11/03 18:37:10 mrg Exp $	*/
+/*	$NetBSD: ipsec_output.c,v 1.40.12.1 2018/05/03 14:48:26 martin Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2003 Sam Leffler, Errno Consulting
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ipsec_output.c,v 1.40 2013/11/03 18:37:10 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipsec_output.c,v 1.40.12.1 2018/05/03 14:48:26 martin Exp $");
 
 /*
  * IPsec output processing.
@@ -624,7 +624,7 @@ bad:
 #endif
 
 #ifdef INET6
-static void
+static int
 compute_ipsec_pos(struct mbuf *m, int *i, int *off)
 {
 	int nxt;
@@ -641,7 +641,11 @@ compute_ipsec_pos(struct mbuf *m, int *i
 	 * put AH/ESP/IPcomp header.
 	 *  IPv6 hbh dest1 rthdr ah* [esp* dest2 payload]
 	 */
-	do {
+	while (1) {
+		if (*i + sizeof(ip6e) > m->m_pkthdr.len) {
+			return EINVAL;
+		}
+
 		switch (nxt) {
 		case IPPROTO_AH:
 		case IPPROTO_ESP:
@@ -650,7 +654,7 @@ compute_ipsec_pos(struct mbuf *m, int *i
 		 * we should not skip security header added
 		 * beforehand.
 		 */
-			return;
+			return 0;
 
 		case IPPROTO_HOPOPTS:
 		case IPPROTO_DSTOPTS:
@@ -660,7 +664,7 @@ compute_ipsec_pos(struct mbuf *m, int *i
 		 * we should stop there.
 		 */
 			if (nxt == IPPROTO_DSTOPTS && dstopt)
-return;
+return 0;
 
 			if (nxt == IPPROTO_DSTOPTS) {
 /*
@@ -680,16 +684,14 @@ compute_ipsec_pos(struct mbuf *m, int *i
 			m_copydata(m, *i, sizeof(ip6e), );
 			nxt = ip6e.ip6e_nxt;
 			*off = *i + offsetof(struct ip6_ext, ip6e_nxt);
-			/*
-			 * we will never see nxt == IPPROTO_AH
-			 * so it is safe to omit AH case.
-			 */
 			*i += (ip6e.ip6e_len + 1) << 3;
 			break;
 		default:
-			return;
+			return 0;
 		}
-	} while (*i < m->m_pkthdr.len);
+	}
+
+	return 0;
 }
 
 static int
@@ -791,7 +793,9 @@ ipsec6_process_packet(
 		i = ip->ip_hl << 2;
 		off = offsetof(struct ip, ip_p);
 	} else {	
-		compute_ipsec_pos(m, , );
+		error = compute_ipsec_pos(m, , );
+		if (error)
+			goto bad;
 	}
 	error = (*sav->tdb_xform->xf_output)(m, isr, NULL, i, off);
 	splx(s);



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

2018-05-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu May  3 14:48:26 UTC 2018

Modified Files:
src/sys/netipsec [netbsd-7-1]: ipsec_output.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1600):

sys/netipsec/ipsec_output.c: revision 1.67,1.75 (via patch)

Strengthen this check, to make sure there is room for an ip6_ext structure.
Seems possible to crash m_copydata here (but I didn't test more than that).

Fix the checks in compute_ipsec_pos, otherwise m_copydata could crash. I
already fixed half of the problem two months ago in rev1.67, back then I
thought it was not triggerable because each packet we emit is guaranteed
to have correctly formed IPv6 options; but it is actually triggerable via
IPv6 forwarding, we emit a packet we just received, and we don't sanitize
its options before invoking IPsec.

Since it would be wrong to just stop the iteration and continue the IPsec
processing, allow compute_ipsec_pos to fail, and when it does, drop the
packet entirely.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.40.12.1 src/sys/netipsec/ipsec_output.c

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



CVS commit: [netbsd-7] src/sys/netipsec

2018-05-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu May  3 14:47:22 UTC 2018

Modified Files:
src/sys/netipsec [netbsd-7]: ipsec_output.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1600):

sys/netipsec/ipsec_output.c: revision 1.67,1.75 (via patch)

Strengthen this check, to make sure there is room for an ip6_ext structure.
Seems possible to crash m_copydata here (but I didn't test more than that).

Fix the checks in compute_ipsec_pos, otherwise m_copydata could crash. I
already fixed half of the problem two months ago in rev1.67, back then I
thought it was not triggerable because each packet we emit is guaranteed
to have correctly formed IPv6 options; but it is actually triggerable via
IPv6 forwarding, we emit a packet we just received, and we don't sanitize
its options before invoking IPsec.

Since it would be wrong to just stop the iteration and continue the IPsec
processing, allow compute_ipsec_pos to fail, and when it does, drop the
packet entirely.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.40.4.1 src/sys/netipsec/ipsec_output.c

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

Modified files:

Index: src/sys/netipsec/ipsec_output.c
diff -u src/sys/netipsec/ipsec_output.c:1.40 src/sys/netipsec/ipsec_output.c:1.40.4.1
--- src/sys/netipsec/ipsec_output.c:1.40	Sun Nov  3 18:37:10 2013
+++ src/sys/netipsec/ipsec_output.c	Thu May  3 14:47:22 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipsec_output.c,v 1.40 2013/11/03 18:37:10 mrg Exp $	*/
+/*	$NetBSD: ipsec_output.c,v 1.40.4.1 2018/05/03 14:47:22 martin Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2003 Sam Leffler, Errno Consulting
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ipsec_output.c,v 1.40 2013/11/03 18:37:10 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipsec_output.c,v 1.40.4.1 2018/05/03 14:47:22 martin Exp $");
 
 /*
  * IPsec output processing.
@@ -624,7 +624,7 @@ bad:
 #endif
 
 #ifdef INET6
-static void
+static int
 compute_ipsec_pos(struct mbuf *m, int *i, int *off)
 {
 	int nxt;
@@ -641,7 +641,11 @@ compute_ipsec_pos(struct mbuf *m, int *i
 	 * put AH/ESP/IPcomp header.
 	 *  IPv6 hbh dest1 rthdr ah* [esp* dest2 payload]
 	 */
-	do {
+	while (1) {
+		if (*i + sizeof(ip6e) > m->m_pkthdr.len) {
+			return EINVAL;
+		}
+
 		switch (nxt) {
 		case IPPROTO_AH:
 		case IPPROTO_ESP:
@@ -650,7 +654,7 @@ compute_ipsec_pos(struct mbuf *m, int *i
 		 * we should not skip security header added
 		 * beforehand.
 		 */
-			return;
+			return 0;
 
 		case IPPROTO_HOPOPTS:
 		case IPPROTO_DSTOPTS:
@@ -660,7 +664,7 @@ compute_ipsec_pos(struct mbuf *m, int *i
 		 * we should stop there.
 		 */
 			if (nxt == IPPROTO_DSTOPTS && dstopt)
-return;
+return 0;
 
 			if (nxt == IPPROTO_DSTOPTS) {
 /*
@@ -680,16 +684,14 @@ compute_ipsec_pos(struct mbuf *m, int *i
 			m_copydata(m, *i, sizeof(ip6e), );
 			nxt = ip6e.ip6e_nxt;
 			*off = *i + offsetof(struct ip6_ext, ip6e_nxt);
-			/*
-			 * we will never see nxt == IPPROTO_AH
-			 * so it is safe to omit AH case.
-			 */
 			*i += (ip6e.ip6e_len + 1) << 3;
 			break;
 		default:
-			return;
+			return 0;
 		}
-	} while (*i < m->m_pkthdr.len);
+	}
+
+	return 0;
 }
 
 static int
@@ -791,7 +793,9 @@ ipsec6_process_packet(
 		i = ip->ip_hl << 2;
 		off = offsetof(struct ip, ip_p);
 	} else {	
-		compute_ipsec_pos(m, , );
+		error = compute_ipsec_pos(m, , );
+		if (error)
+			goto bad;
 	}
 	error = (*sav->tdb_xform->xf_output)(m, isr, NULL, i, off);
 	splx(s);



CVS commit: [netbsd-7] src/sys/netipsec

2018-05-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu May  3 14:47:22 UTC 2018

Modified Files:
src/sys/netipsec [netbsd-7]: ipsec_output.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1600):

sys/netipsec/ipsec_output.c: revision 1.67,1.75 (via patch)

Strengthen this check, to make sure there is room for an ip6_ext structure.
Seems possible to crash m_copydata here (but I didn't test more than that).

Fix the checks in compute_ipsec_pos, otherwise m_copydata could crash. I
already fixed half of the problem two months ago in rev1.67, back then I
thought it was not triggerable because each packet we emit is guaranteed
to have correctly formed IPv6 options; but it is actually triggerable via
IPv6 forwarding, we emit a packet we just received, and we don't sanitize
its options before invoking IPsec.

Since it would be wrong to just stop the iteration and continue the IPsec
processing, allow compute_ipsec_pos to fail, and when it does, drop the
packet entirely.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.40.4.1 src/sys/netipsec/ipsec_output.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/netipsec

2018-05-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu May  3 14:37:25 UTC 2018

Modified Files:
src/sys/netipsec [netbsd-6-0]: ipsec_output.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1546):

sys/netipsec/ipsec_output.c: revision 1.67,1.75 (via patch)

Strengthen this check, to make sure there is room for an ip6_ext structure.
Seems possible to crash m_copydata here (but I didn't test more than that).

Fix the checks in compute_ipsec_pos, otherwise m_copydata could crash. I
already fixed half of the problem two months ago in rev1.67, back then I
thought it was not triggerable because each packet we emit is guaranteed
to have correctly formed IPv6 options; but it is actually triggerable via
IPv6 forwarding, we emit a packet we just received, and we don't sanitize
its options before invoking IPsec.

Since it would be wrong to just stop the iteration and continue the IPsec
processing, allow compute_ipsec_pos to fail, and when it does, drop the
packet entirely.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.38.8.1 src/sys/netipsec/ipsec_output.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/netipsec

2018-05-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu May  3 14:37:25 UTC 2018

Modified Files:
src/sys/netipsec [netbsd-6-0]: ipsec_output.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1546):

sys/netipsec/ipsec_output.c: revision 1.67,1.75 (via patch)

Strengthen this check, to make sure there is room for an ip6_ext structure.
Seems possible to crash m_copydata here (but I didn't test more than that).

Fix the checks in compute_ipsec_pos, otherwise m_copydata could crash. I
already fixed half of the problem two months ago in rev1.67, back then I
thought it was not triggerable because each packet we emit is guaranteed
to have correctly formed IPv6 options; but it is actually triggerable via
IPv6 forwarding, we emit a packet we just received, and we don't sanitize
its options before invoking IPsec.

Since it would be wrong to just stop the iteration and continue the IPsec
processing, allow compute_ipsec_pos to fail, and when it does, drop the
packet entirely.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.38.8.1 src/sys/netipsec/ipsec_output.c

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

Modified files:

Index: src/sys/netipsec/ipsec_output.c
diff -u src/sys/netipsec/ipsec_output.c:1.38 src/sys/netipsec/ipsec_output.c:1.38.8.1
--- src/sys/netipsec/ipsec_output.c:1.38	Tue Jan 10 20:01:57 2012
+++ src/sys/netipsec/ipsec_output.c	Thu May  3 14:37:25 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipsec_output.c,v 1.38 2012/01/10 20:01:57 drochner Exp $	*/
+/*	$NetBSD: ipsec_output.c,v 1.38.8.1 2018/05/03 14:37:25 martin Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2003 Sam Leffler, Errno Consulting
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ipsec_output.c,v 1.38 2012/01/10 20:01:57 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipsec_output.c,v 1.38.8.1 2018/05/03 14:37:25 martin Exp $");
 
 /*
  * IPsec output processing.
@@ -632,7 +632,7 @@ bad:
 #endif
 
 #ifdef INET6
-static void
+static int
 compute_ipsec_pos(struct mbuf *m, int *i, int *off)
 {
 	int nxt;
@@ -649,7 +649,11 @@ compute_ipsec_pos(struct mbuf *m, int *i
 	 * put AH/ESP/IPcomp header.
 	 *  IPv6 hbh dest1 rthdr ah* [esp* dest2 payload]
 	 */
-	do {
+	while (1) {
+		if (*i + sizeof(ip6e) > m->m_pkthdr.len) {
+			return EINVAL;
+		}
+
 		switch (nxt) {
 		case IPPROTO_AH:
 		case IPPROTO_ESP:
@@ -658,7 +662,7 @@ compute_ipsec_pos(struct mbuf *m, int *i
 		 * we should not skip security header added
 		 * beforehand.
 		 */
-			return;
+			return 0;
 
 		case IPPROTO_HOPOPTS:
 		case IPPROTO_DSTOPTS:
@@ -668,7 +672,7 @@ compute_ipsec_pos(struct mbuf *m, int *i
 		 * we should stop there.
 		 */
 			if (nxt == IPPROTO_DSTOPTS && dstopt)
-return;
+return 0;
 
 			if (nxt == IPPROTO_DSTOPTS) {
 /*
@@ -688,16 +692,14 @@ compute_ipsec_pos(struct mbuf *m, int *i
 			m_copydata(m, *i, sizeof(ip6e), );
 			nxt = ip6e.ip6e_nxt;
 			*off = *i + offsetof(struct ip6_ext, ip6e_nxt);
-			/*
-			 * we will never see nxt == IPPROTO_AH
-			 * so it is safe to omit AH case.
-			 */
 			*i += (ip6e.ip6e_len + 1) << 3;
 			break;
 		default:
-			return;
+			return 0;
 		}
-	} while (*i < m->m_pkthdr.len);
+	}
+
+	return 0;
 }
 
 static int
@@ -799,7 +801,9 @@ ipsec6_process_packet(
 		i = ip->ip_hl << 2;
 		off = offsetof(struct ip, ip_p);
 	} else {	
-		compute_ipsec_pos(m, , );
+		error = compute_ipsec_pos(m, , );
+		if (error)
+			goto bad;
 	}
 	error = (*sav->tdb_xform->xf_output)(m, isr, NULL, i, off);
 	splx(s);



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

2018-05-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu May  3 14:36:30 UTC 2018

Modified Files:
src/sys/netipsec [netbsd-6-1]: ipsec_output.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1546):

sys/netipsec/ipsec_output.c: revision 1.67,1.75 (via patch)

Strengthen this check, to make sure there is room for an ip6_ext structure.
Seems possible to crash m_copydata here (but I didn't test more than that).

Fix the checks in compute_ipsec_pos, otherwise m_copydata could crash. I
already fixed half of the problem two months ago in rev1.67, back then I
thought it was not triggerable because each packet we emit is guaranteed
to have correctly formed IPv6 options; but it is actually triggerable via
IPv6 forwarding, we emit a packet we just received, and we don't sanitize
its options before invoking IPsec.

Since it would be wrong to just stop the iteration and continue the IPsec
processing, allow compute_ipsec_pos to fail, and when it does, drop the
packet entirely.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.38.16.1 src/sys/netipsec/ipsec_output.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/sys/netipsec

2018-05-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu May  3 14:36:30 UTC 2018

Modified Files:
src/sys/netipsec [netbsd-6-1]: ipsec_output.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1546):

sys/netipsec/ipsec_output.c: revision 1.67,1.75 (via patch)

Strengthen this check, to make sure there is room for an ip6_ext structure.
Seems possible to crash m_copydata here (but I didn't test more than that).

Fix the checks in compute_ipsec_pos, otherwise m_copydata could crash. I
already fixed half of the problem two months ago in rev1.67, back then I
thought it was not triggerable because each packet we emit is guaranteed
to have correctly formed IPv6 options; but it is actually triggerable via
IPv6 forwarding, we emit a packet we just received, and we don't sanitize
its options before invoking IPsec.

Since it would be wrong to just stop the iteration and continue the IPsec
processing, allow compute_ipsec_pos to fail, and when it does, drop the
packet entirely.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.38.16.1 src/sys/netipsec/ipsec_output.c

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

Modified files:

Index: src/sys/netipsec/ipsec_output.c
diff -u src/sys/netipsec/ipsec_output.c:1.38 src/sys/netipsec/ipsec_output.c:1.38.16.1
--- src/sys/netipsec/ipsec_output.c:1.38	Tue Jan 10 20:01:57 2012
+++ src/sys/netipsec/ipsec_output.c	Thu May  3 14:36:30 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipsec_output.c,v 1.38 2012/01/10 20:01:57 drochner Exp $	*/
+/*	$NetBSD: ipsec_output.c,v 1.38.16.1 2018/05/03 14:36:30 martin Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2003 Sam Leffler, Errno Consulting
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ipsec_output.c,v 1.38 2012/01/10 20:01:57 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipsec_output.c,v 1.38.16.1 2018/05/03 14:36:30 martin Exp $");
 
 /*
  * IPsec output processing.
@@ -632,7 +632,7 @@ bad:
 #endif
 
 #ifdef INET6
-static void
+static int
 compute_ipsec_pos(struct mbuf *m, int *i, int *off)
 {
 	int nxt;
@@ -649,7 +649,11 @@ compute_ipsec_pos(struct mbuf *m, int *i
 	 * put AH/ESP/IPcomp header.
 	 *  IPv6 hbh dest1 rthdr ah* [esp* dest2 payload]
 	 */
-	do {
+	while (1) {
+		if (*i + sizeof(ip6e) > m->m_pkthdr.len) {
+			return EINVAL;
+		}
+
 		switch (nxt) {
 		case IPPROTO_AH:
 		case IPPROTO_ESP:
@@ -658,7 +662,7 @@ compute_ipsec_pos(struct mbuf *m, int *i
 		 * we should not skip security header added
 		 * beforehand.
 		 */
-			return;
+			return 0;
 
 		case IPPROTO_HOPOPTS:
 		case IPPROTO_DSTOPTS:
@@ -668,7 +672,7 @@ compute_ipsec_pos(struct mbuf *m, int *i
 		 * we should stop there.
 		 */
 			if (nxt == IPPROTO_DSTOPTS && dstopt)
-return;
+return 0;
 
 			if (nxt == IPPROTO_DSTOPTS) {
 /*
@@ -688,16 +692,14 @@ compute_ipsec_pos(struct mbuf *m, int *i
 			m_copydata(m, *i, sizeof(ip6e), );
 			nxt = ip6e.ip6e_nxt;
 			*off = *i + offsetof(struct ip6_ext, ip6e_nxt);
-			/*
-			 * we will never see nxt == IPPROTO_AH
-			 * so it is safe to omit AH case.
-			 */
 			*i += (ip6e.ip6e_len + 1) << 3;
 			break;
 		default:
-			return;
+			return 0;
 		}
-	} while (*i < m->m_pkthdr.len);
+	}
+
+	return 0;
 }
 
 static int
@@ -799,7 +801,9 @@ ipsec6_process_packet(
 		i = ip->ip_hl << 2;
 		off = offsetof(struct ip, ip_p);
 	} else {	
-		compute_ipsec_pos(m, , );
+		error = compute_ipsec_pos(m, , );
+		if (error)
+			goto bad;
 	}
 	error = (*sav->tdb_xform->xf_output)(m, isr, NULL, i, off);
 	splx(s);



CVS commit: [netbsd-6] src/sys/netipsec

2018-05-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu May  3 14:33:30 UTC 2018

Modified Files:
src/sys/netipsec [netbsd-6]: ipsec_output.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1546):

sys/netipsec/ipsec_output.c: revision 1.67,1.75 (via patch)

Strengthen this check, to make sure there is room for an ip6_ext structure.
Seems possible to crash m_copydata here (but I didn't test more than that).

Fix the checks in compute_ipsec_pos, otherwise m_copydata could crash. I
already fixed half of the problem two months ago in rev1.67, back then I
thought it was not triggerable because each packet we emit is guaranteed
to have correctly formed IPv6 options; but it is actually triggerable via
IPv6 forwarding, we emit a packet we just received, and we don't sanitize
its options before invoking IPsec.

Since it would be wrong to just stop the iteration and continue the IPsec
processing, allow compute_ipsec_pos to fail, and when it does, drop the
packet entirely.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.38.2.1 src/sys/netipsec/ipsec_output.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/netipsec

2018-05-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu May  3 14:33:30 UTC 2018

Modified Files:
src/sys/netipsec [netbsd-6]: ipsec_output.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1546):

sys/netipsec/ipsec_output.c: revision 1.67,1.75 (via patch)

Strengthen this check, to make sure there is room for an ip6_ext structure.
Seems possible to crash m_copydata here (but I didn't test more than that).

Fix the checks in compute_ipsec_pos, otherwise m_copydata could crash. I
already fixed half of the problem two months ago in rev1.67, back then I
thought it was not triggerable because each packet we emit is guaranteed
to have correctly formed IPv6 options; but it is actually triggerable via
IPv6 forwarding, we emit a packet we just received, and we don't sanitize
its options before invoking IPsec.

Since it would be wrong to just stop the iteration and continue the IPsec
processing, allow compute_ipsec_pos to fail, and when it does, drop the
packet entirely.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.38.2.1 src/sys/netipsec/ipsec_output.c

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

Modified files:

Index: src/sys/netipsec/ipsec_output.c
diff -u src/sys/netipsec/ipsec_output.c:1.38 src/sys/netipsec/ipsec_output.c:1.38.2.1
--- src/sys/netipsec/ipsec_output.c:1.38	Tue Jan 10 20:01:57 2012
+++ src/sys/netipsec/ipsec_output.c	Thu May  3 14:33:30 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipsec_output.c,v 1.38 2012/01/10 20:01:57 drochner Exp $	*/
+/*	$NetBSD: ipsec_output.c,v 1.38.2.1 2018/05/03 14:33:30 martin Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2003 Sam Leffler, Errno Consulting
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ipsec_output.c,v 1.38 2012/01/10 20:01:57 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipsec_output.c,v 1.38.2.1 2018/05/03 14:33:30 martin Exp $");
 
 /*
  * IPsec output processing.
@@ -632,7 +632,7 @@ bad:
 #endif
 
 #ifdef INET6
-static void
+static int
 compute_ipsec_pos(struct mbuf *m, int *i, int *off)
 {
 	int nxt;
@@ -649,7 +649,11 @@ compute_ipsec_pos(struct mbuf *m, int *i
 	 * put AH/ESP/IPcomp header.
 	 *  IPv6 hbh dest1 rthdr ah* [esp* dest2 payload]
 	 */
-	do {
+	while (1) {
+		if (*i + sizeof(ip6e) > m->m_pkthdr.len) {
+			return EINVAL;
+		}
+
 		switch (nxt) {
 		case IPPROTO_AH:
 		case IPPROTO_ESP:
@@ -658,7 +662,7 @@ compute_ipsec_pos(struct mbuf *m, int *i
 		 * we should not skip security header added
 		 * beforehand.
 		 */
-			return;
+			return 0;
 
 		case IPPROTO_HOPOPTS:
 		case IPPROTO_DSTOPTS:
@@ -668,7 +672,7 @@ compute_ipsec_pos(struct mbuf *m, int *i
 		 * we should stop there.
 		 */
 			if (nxt == IPPROTO_DSTOPTS && dstopt)
-return;
+return 0;
 
 			if (nxt == IPPROTO_DSTOPTS) {
 /*
@@ -688,16 +692,14 @@ compute_ipsec_pos(struct mbuf *m, int *i
 			m_copydata(m, *i, sizeof(ip6e), );
 			nxt = ip6e.ip6e_nxt;
 			*off = *i + offsetof(struct ip6_ext, ip6e_nxt);
-			/*
-			 * we will never see nxt == IPPROTO_AH
-			 * so it is safe to omit AH case.
-			 */
 			*i += (ip6e.ip6e_len + 1) << 3;
 			break;
 		default:
-			return;
+			return 0;
 		}
-	} while (*i < m->m_pkthdr.len);
+	}
+
+	return 0;
 }
 
 static int
@@ -799,7 +801,9 @@ ipsec6_process_packet(
 		i = ip->ip_hl << 2;
 		off = offsetof(struct ip, ip_p);
 	} else {	
-		compute_ipsec_pos(m, , );
+		error = compute_ipsec_pos(m, , );
+		if (error)
+			goto bad;
 	}
 	error = (*sav->tdb_xform->xf_output)(m, isr, NULL, i, off);
 	splx(s);



CVS commit: src/sys/sys

2018-05-03 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu May  3 08:39:28 UTC 2018

Modified Files:
src/sys/sys: mbuf.h

Log Message:
Remove unused M_MAXCOMPRESS macro.


To generate a diff of this commit:
cvs rdiff -u -r1.203 -r1.204 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/sys

2018-05-03 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu May  3 08:39:28 UTC 2018

Modified Files:
src/sys/sys: mbuf.h

Log Message:
Remove unused M_MAXCOMPRESS macro.


To generate a diff of this commit:
cvs rdiff -u -r1.203 -r1.204 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/sys/mbuf.h
diff -u src/sys/sys/mbuf.h:1.203 src/sys/sys/mbuf.h:1.204
--- src/sys/sys/mbuf.h:1.203	Thu May  3 08:14:29 2018
+++ src/sys/sys/mbuf.h	Thu May  3 08:39:28 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: mbuf.h,v 1.203 2018/05/03 08:14:29 maxv Exp $	*/
+/*	$NetBSD: mbuf.h,v 1.204 2018/05/03 08:39:28 maxv Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997, 1999, 2001, 2007 The NetBSD Foundation, Inc.
@@ -329,7 +329,6 @@ MBUF_DEFINE(_mbuf_dummy, 1, 1);
 #define	MHLEN		(MSIZE - offsetof(struct _mbuf_dummy, m_pktdat))
 
 #define	MINCLSIZE	(MHLEN+MLEN+1)	/* smallest amount to put in cluster */
-#define	M_MAXCOMPRESS	(MHLEN / 2)	/* max amount to copy for compression */
 
 /*
  * The *real* struct mbuf



Re: CVS commit: src/sys/dev/pci/ixgbe

2018-05-03 Thread Frank Kardel

Hi,

I am now seeing that packet reception stops. tcpdump will only show 
outgoing packets and no incoming packets.


ifconfig ixgX down
ifconfig ixgX up

gets things going again.

Code from 2018-02-24 was fine and I think even code shortly before this 
commit was fine, but there was the mbuf used-after-free issue that hit 
me pretty hard. So the system wasn't running for too long anyway.


Does that ring a bell ?

Frank

On 04/25/18 10:46, SAITOH Masanobu wrote:

Module Name:src
Committed By:   msaitoh
Date:   Wed Apr 25 08:46:19 UTC 2018

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c ixgbe.h ixgbe_netbsd.c ixgbe_netbsd.h
ixgbe_osdep.h

Log Message:
  Don't free and reallocate bus_dmamem when it's not required. Currently,
the watchdog timer is completely broken and never fire (it's from FreeBSD
(pre iflib)). If the problem is fixed and watchdog fired, ixgbe_init() always
calls ixgbe_jcl_reinit() and it causes panic. The reason is that
ixgbe_local_timer1(it includes watchdog function) is softint and
xgbe_jcl_reinit() calls bus_dmamem*() functions. bus_dmamem*() can't be called
from interrupt context.

  One of the way to prevent panic is use worqueue for the timer, but it's
not a small change. (I'll do it in future).

  Another way is not reallocate dmamem if it's not required. If both the MTU
(rx_mbuf_sz in reality) and the number of RX descriptors are not changed, it's
not required to call bus_dmamem_{unmap,free}(). Even if we use workque, this
change save time of ixgbe_init().

  I have a code to fix broken watchdog timer but it sometime causes watchdog
timeout, so I don't commit it yet.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.45 -r1.46 src/sys/dev/pci/ixgbe/ixgbe.h
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/pci/ixgbe/ixgbe_netbsd.c
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/pci/ixgbe/ixgbe_netbsd.h
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/pci/ixgbe/ixgbe_osdep.h

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



Re: CVS commit: src/sys/dev/pci/ixgbe

2018-05-03 Thread Frank Kardel

Hi,

I am now seeing that packet reception stops. tcpdump will only show 
outgoing packets and no incoming packets.


ifconfig ixgX down
ifconfig ixgX up

gets things going again.

Code from 2018-02-24 was fine and I think even code shortly before this 
commit was fine, but there was the mbuf used-after-free issue that hit 
me pretty hard. So the system wasn't running for too long anyway.


Does that ring a bell ?

Frank

On 04/25/18 10:46, SAITOH Masanobu wrote:

Module Name:src
Committed By:   msaitoh
Date:   Wed Apr 25 08:46:19 UTC 2018

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c ixgbe.h ixgbe_netbsd.c ixgbe_netbsd.h
ixgbe_osdep.h

Log Message:
  Don't free and reallocate bus_dmamem when it's not required. Currently,
the watchdog timer is completely broken and never fire (it's from FreeBSD
(pre iflib)). If the problem is fixed and watchdog fired, ixgbe_init() always
calls ixgbe_jcl_reinit() and it causes panic. The reason is that
ixgbe_local_timer1(it includes watchdog function) is softint and
xgbe_jcl_reinit() calls bus_dmamem*() functions. bus_dmamem*() can't be called
from interrupt context.

  One of the way to prevent panic is use worqueue for the timer, but it's
not a small change. (I'll do it in future).

  Another way is not reallocate dmamem if it's not required. If both the MTU
(rx_mbuf_sz in reality) and the number of RX descriptors are not changed, it's
not required to call bus_dmamem_{unmap,free}(). Even if we use workque, this
change save time of ixgbe_init().

  I have a code to fix broken watchdog timer but it sometime causes watchdog
timeout, so I don't commit it yet.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.45 -r1.46 src/sys/dev/pci/ixgbe/ixgbe.h
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/pci/ixgbe/ixgbe_netbsd.c
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/pci/ixgbe/ixgbe_netbsd.h
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/pci/ixgbe/ixgbe_osdep.h

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



CVS commit: src/sys/sys

2018-05-03 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu May  3 08:14:29 UTC 2018

Modified Files:
src/sys/sys: mbuf.h

Log Message:
Fix comment, M_LOOP is not used for statistics, it's mostly used to avoid
recomputing the checksum when the packet is received on loopback.


To generate a diff of this commit:
cvs rdiff -u -r1.202 -r1.203 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/sys

2018-05-03 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu May  3 08:14:29 UTC 2018

Modified Files:
src/sys/sys: mbuf.h

Log Message:
Fix comment, M_LOOP is not used for statistics, it's mostly used to avoid
recomputing the checksum when the packet is received on loopback.


To generate a diff of this commit:
cvs rdiff -u -r1.202 -r1.203 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/sys/mbuf.h
diff -u src/sys/sys/mbuf.h:1.202 src/sys/sys/mbuf.h:1.203
--- src/sys/sys/mbuf.h:1.202	Thu May  3 07:25:49 2018
+++ src/sys/sys/mbuf.h	Thu May  3 08:14:29 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: mbuf.h,v 1.202 2018/05/03 07:25:49 maxv Exp $	*/
+/*	$NetBSD: mbuf.h,v 1.203 2018/05/03 08:14:29 maxv Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997, 1999, 2001, 2007 The NetBSD Foundation, Inc.
@@ -345,7 +345,7 @@ MBUF_DEFINE(mbuf, MHLEN, MLEN);
 /* mbuf pkthdr flags, also in m_flags */
 #define	M_AUTHIPHDR	0x0010	/* authenticated (IPsec) */
 #define	M_DECRYPTED	0x0020	/* decrypted (IPsec) */
-#define	M_LOOP		0x0040	/* for Mbuf statistics */
+#define	M_LOOP		0x0040	/* received on loopback */
 #define	M_BCAST		0x0100	/* send/received as L2 broadcast */
 #define	M_MCAST		0x0200	/* send/received as L2 multicast */
 #define	M_CANFASTFWD	0x0400	/* packet can be fast-forwarded */



CVS commit: src/sys/kern

2018-05-03 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu May  3 07:46:17 UTC 2018

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

Log Message:
Revert my rev1.190, remove the M_READONLY check. The initial code was
correct: what is read-only is the mbuf storage, not the mbuf itself. The
storage contains the packet payload, and never has anything related to
mbufs. So it is fine to remove M_PKTHDR on mbufs that have a read-only
storage.

In fact it was kind of obvious, since several places already manually
remove M_PKTHDR without taking care of the external storage.


To generate a diff of this commit:
cvs rdiff -u -r1.213 -r1.214 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.213 src/sys/kern/uipc_mbuf.c:1.214
--- src/sys/kern/uipc_mbuf.c:1.213	Thu May  3 07:25:50 2018
+++ src/sys/kern/uipc_mbuf.c	Thu May  3 07:46:17 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_mbuf.c,v 1.213 2018/05/03 07:25:50 maxv Exp $	*/
+/*	$NetBSD: uipc_mbuf.c,v 1.214 2018/05/03 07:46:17 maxv Exp $	*/
 
 /*
  * Copyright (c) 1999, 2001 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.213 2018/05/03 07:25:50 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.214 2018/05/03 07:46:17 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_mbuftrace.h"
@@ -1538,11 +1538,6 @@ m_remove_pkthdr(struct mbuf *m)
 {
 	KASSERT(m->m_flags & M_PKTHDR);
 
-	if (M_READONLY(m)) {
-		/* Nothing we can do. */
-		return;
-	}
-
 	m_tag_delete_chain(m, NULL);
 	m->m_flags &= ~M_PKTHDR;
 	memset(>m_pkthdr, 0, sizeof(m->m_pkthdr));



CVS commit: src/sys/kern

2018-05-03 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu May  3 07:46:17 UTC 2018

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

Log Message:
Revert my rev1.190, remove the M_READONLY check. The initial code was
correct: what is read-only is the mbuf storage, not the mbuf itself. The
storage contains the packet payload, and never has anything related to
mbufs. So it is fine to remove M_PKTHDR on mbufs that have a read-only
storage.

In fact it was kind of obvious, since several places already manually
remove M_PKTHDR without taking care of the external storage.


To generate a diff of this commit:
cvs rdiff -u -r1.213 -r1.214 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/nfs

2018-05-03 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Thu May  3 07:28:44 UTC 2018

Modified Files:
src/sys/nfs: nfs_serv.c

Log Message:
nfsrv_readlink: stop attaching a zero-length mbuf for zero length symlinks.


To generate a diff of this commit:
cvs rdiff -u -r1.173 -r1.174 src/sys/nfs/nfs_serv.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/nfs/nfs_serv.c
diff -u src/sys/nfs/nfs_serv.c:1.173 src/sys/nfs/nfs_serv.c:1.174
--- src/sys/nfs/nfs_serv.c:1.173	Wed Apr 26 03:02:49 2017
+++ src/sys/nfs/nfs_serv.c	Thu May  3 07:28:43 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_serv.c,v 1.173 2017/04/26 03:02:49 riastradh Exp $	*/
+/*	$NetBSD: nfs_serv.c,v 1.174 2018/05/03 07:28:43 hannken Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -55,7 +55,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nfs_serv.c,v 1.173 2017/04/26 03:02:49 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nfs_serv.c,v 1.174 2018/05/03 07:28:43 hannken Exp $");
 
 #include 
 #include 
@@ -600,7 +600,10 @@ out:
 	}
 	len -= uiop->uio_resid;
 	padlen = nfsm_padlen(len);
-	if (uiop->uio_resid || padlen)
+	if (len == 0) {
+		m_freem(mp3);
+		mp3 = NULL;
+	} else if (uiop->uio_resid || padlen)
 		nfs_zeropad(mp3, uiop->uio_resid, padlen);
 	nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
 	*tl = txdr_unsigned(len);



CVS commit: src/sys/nfs

2018-05-03 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Thu May  3 07:28:44 UTC 2018

Modified Files:
src/sys/nfs: nfs_serv.c

Log Message:
nfsrv_readlink: stop attaching a zero-length mbuf for zero length symlinks.


To generate a diff of this commit:
cvs rdiff -u -r1.173 -r1.174 src/sys/nfs/nfs_serv.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-05-03 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu May  3 07:25:50 UTC 2018

Modified Files:
src/sys/kern: uipc_mbuf.c
src/sys/netinet: ip_reass.c
src/sys/netinet6: frag6.c
src/sys/sys: mbuf.h

Log Message:
Rename m_pkthdr_remove -> m_remove_pkthdr, to match the existing naming
convention, eg m_copy_pkthdr and m_move_pkthdr.


To generate a diff of this commit:
cvs rdiff -u -r1.212 -r1.213 src/sys/kern/uipc_mbuf.c
cvs rdiff -u -r1.15 -r1.16 src/sys/netinet/ip_reass.c
cvs rdiff -u -r1.72 -r1.73 src/sys/netinet6/frag6.c
cvs rdiff -u -r1.201 -r1.202 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.212 src/sys/kern/uipc_mbuf.c:1.213
--- src/sys/kern/uipc_mbuf.c:1.212	Sat Apr 28 08:34:45 2018
+++ src/sys/kern/uipc_mbuf.c	Thu May  3 07:25:50 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_mbuf.c,v 1.212 2018/04/28 08:34:45 maxv Exp $	*/
+/*	$NetBSD: uipc_mbuf.c,v 1.213 2018/05/03 07:25:50 maxv Exp $	*/
 
 /*
  * Copyright (c) 1999, 2001 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.212 2018/04/28 08:34:45 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.213 2018/05/03 07:25:50 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_mbuftrace.h"
@@ -1534,7 +1534,7 @@ m_defrag(struct mbuf *m, int how)
 }
 
 void
-m_pkthdr_remove(struct mbuf *m)
+m_remove_pkthdr(struct mbuf *m)
 {
 	KASSERT(m->m_flags & M_PKTHDR);
 

Index: src/sys/netinet/ip_reass.c
diff -u src/sys/netinet/ip_reass.c:1.15 src/sys/netinet/ip_reass.c:1.16
--- src/sys/netinet/ip_reass.c:1.15	Wed Apr 11 07:15:12 2018
+++ src/sys/netinet/ip_reass.c	Thu May  3 07:25:49 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_reass.c,v 1.15 2018/04/11 07:15:12 maxv Exp $	*/
+/*	$NetBSD: ip_reass.c,v 1.16 2018/05/03 07:25:49 maxv Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1988, 1993
@@ -46,7 +46,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip_reass.c,v 1.15 2018/04/11 07:15:12 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_reass.c,v 1.16 2018/05/03 07:25:49 maxv Exp $");
 
 #include 
 #include 
@@ -389,7 +389,7 @@ insert:
 		t = q->ipqe_m;
 		nq = TAILQ_NEXT(q, ipqe_q);
 		pool_cache_put(ipfren_cache, q);
-		m_pkthdr_remove(t);
+		m_remove_pkthdr(t);
 		m_cat(m, t);
 	}
 

Index: src/sys/netinet6/frag6.c
diff -u src/sys/netinet6/frag6.c:1.72 src/sys/netinet6/frag6.c:1.73
--- src/sys/netinet6/frag6.c:1.72	Tue May  1 07:21:39 2018
+++ src/sys/netinet6/frag6.c	Thu May  3 07:25:49 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: frag6.c,v 1.72 2018/05/01 07:21:39 maxv Exp $	*/
+/*	$NetBSD: frag6.c,v 1.73 2018/05/03 07:25:49 maxv Exp $	*/
 /*	$KAME: frag6.c,v 1.40 2002/05/27 21:40:31 itojun Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: frag6.c,v 1.72 2018/05/01 07:21:39 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: frag6.c,v 1.73 2018/05/03 07:25:49 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -439,7 +439,7 @@ insert:
 			t = t->m_next;
 		t->m_next = af6->ip6af_m;
 		m_adj(t->m_next, af6->ip6af_offset);
-		m_pkthdr_remove(t->m_next);
+		m_remove_pkthdr(t->m_next);
 		kmem_intr_free(af6, sizeof(struct ip6asfrag));
 		af6 = af6dwn;
 	}

Index: src/sys/sys/mbuf.h
diff -u src/sys/sys/mbuf.h:1.201 src/sys/sys/mbuf.h:1.202
--- src/sys/sys/mbuf.h:1.201	Thu May  3 07:01:08 2018
+++ src/sys/sys/mbuf.h	Thu May  3 07:25:49 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: mbuf.h,v 1.201 2018/05/03 07:01:08 maxv Exp $	*/
+/*	$NetBSD: mbuf.h,v 1.202 2018/05/03 07:25:49 maxv Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997, 1999, 2001, 2007 The NetBSD Foundation, Inc.
@@ -764,8 +764,6 @@ extern struct mowner revoked_mowner;
 MALLOC_DECLARE(M_MBUF);
 MALLOC_DECLARE(M_SONAME);
 
-void	m_pkthdr_remove(struct mbuf *);
-
 struct	mbuf *m_copym(struct mbuf *, int, int, int);
 struct	mbuf *m_copypacket(struct mbuf *, int);
 struct	mbuf *m_devget(char *, int, int, struct ifnet *,
@@ -794,6 +792,7 @@ void	m_verify_packet(struct mbuf *);
 struct	mbuf *m_free(struct mbuf *);
 void	m_freem(struct mbuf *);
 void	mbinit(void);
+void	m_remove_pkthdr(struct mbuf *);
 void	m_copy_pkthdr(struct mbuf *, struct mbuf *);
 void	m_move_pkthdr(struct mbuf *, struct mbuf *);
 



CVS commit: src/sys

2018-05-03 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu May  3 07:25:50 UTC 2018

Modified Files:
src/sys/kern: uipc_mbuf.c
src/sys/netinet: ip_reass.c
src/sys/netinet6: frag6.c
src/sys/sys: mbuf.h

Log Message:
Rename m_pkthdr_remove -> m_remove_pkthdr, to match the existing naming
convention, eg m_copy_pkthdr and m_move_pkthdr.


To generate a diff of this commit:
cvs rdiff -u -r1.212 -r1.213 src/sys/kern/uipc_mbuf.c
cvs rdiff -u -r1.15 -r1.16 src/sys/netinet/ip_reass.c
cvs rdiff -u -r1.72 -r1.73 src/sys/netinet6/frag6.c
cvs rdiff -u -r1.201 -r1.202 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

2018-05-03 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu May  3 07:13:49 UTC 2018

Modified Files:
src/sys/external/bsd/ipf/netinet: ip_auth.c ip_fil_netbsd.c ip_frag.c
ip_log.c ip_nat.c ip_nat6.c ip_proxy.c ip_sync.c
src/sys/netinet: in_proto.c tcp_congctl.c tcp_debug.c tcp_input.c
tcp_output.c tcp_sack.c tcp_subr.c tcp_timer.c tcp_usrreq.c
tcp_vtw.c
src/sys/netinet6: in6_proto.c
src/usr.bin/netstat: inet.c inet6.c vtw.c
src/usr.bin/systat: netstat.c
src/usr.sbin/trpt: trpt.c

Log Message:
Remove now unused tcpip.h includes. Some were already unused before.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/external/bsd/ipf/netinet/ip_auth.c \
src/sys/external/bsd/ipf/netinet/ip_frag.c \
src/sys/external/bsd/ipf/netinet/ip_proxy.c \
src/sys/external/bsd/ipf/netinet/ip_sync.c
cvs rdiff -u -r1.27 -r1.28 src/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c
cvs rdiff -u -r1.6 -r1.7 src/sys/external/bsd/ipf/netinet/ip_log.c
cvs rdiff -u -r1.18 -r1.19 src/sys/external/bsd/ipf/netinet/ip_nat.c
cvs rdiff -u -r1.10 -r1.11 src/sys/external/bsd/ipf/netinet/ip_nat6.c
cvs rdiff -u -r1.127 -r1.128 src/sys/netinet/in_proto.c
cvs rdiff -u -r1.24 -r1.25 src/sys/netinet/tcp_congctl.c
cvs rdiff -u -r1.31 -r1.32 src/sys/netinet/tcp_debug.c
cvs rdiff -u -r1.406 -r1.407 src/sys/netinet/tcp_input.c
cvs rdiff -u -r1.205 -r1.206 src/sys/netinet/tcp_output.c
cvs rdiff -u -r1.34 -r1.35 src/sys/netinet/tcp_sack.c
cvs rdiff -u -r1.278 -r1.279 src/sys/netinet/tcp_subr.c
cvs rdiff -u -r1.94 -r1.95 src/sys/netinet/tcp_timer.c
cvs rdiff -u -r1.218 -r1.219 src/sys/netinet/tcp_usrreq.c
cvs rdiff -u -r1.18 -r1.19 src/sys/netinet/tcp_vtw.c
cvs rdiff -u -r1.123 -r1.124 src/sys/netinet6/in6_proto.c
cvs rdiff -u -r1.107 -r1.108 src/usr.bin/netstat/inet.c
cvs rdiff -u -r1.70 -r1.71 src/usr.bin/netstat/inet6.c
cvs rdiff -u -r1.9 -r1.10 src/usr.bin/netstat/vtw.c
cvs rdiff -u -r1.29 -r1.30 src/usr.bin/systat/netstat.c
cvs rdiff -u -r1.27 -r1.28 src/usr.sbin/trpt/trpt.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/external/bsd/ipf/netinet/ip_auth.c
diff -u src/sys/external/bsd/ipf/netinet/ip_auth.c:1.5 src/sys/external/bsd/ipf/netinet/ip_auth.c:1.6
--- src/sys/external/bsd/ipf/netinet/ip_auth.c:1.5	Fri May 30 02:16:17 2014
+++ src/sys/external/bsd/ipf/netinet/ip_auth.c	Thu May  3 07:13:48 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_auth.c,v 1.5 2014/05/30 02:16:17 rmind Exp $	*/
+/*	$NetBSD: ip_auth.c,v 1.6 2018/05/03 07:13:48 maxv Exp $	*/
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -111,7 +111,6 @@ extern struct ifqueue   ipintrq;		/* ip 
 #include 
 #include 
 #include "netinet/ip_compat.h"
-#include 
 #include "netinet/ip_fil.h"
 #include "netinet/ip_auth.h"
 #if !defined(MENTAT) && !defined(linux)
@@ -131,7 +130,7 @@ extern struct ifqueue   ipintrq;		/* ip 
 
 #if !defined(lint)
 #if defined(__NetBSD__)
-__KERNEL_RCSID(0, "$NetBSD: ip_auth.c,v 1.5 2014/05/30 02:16:17 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_auth.c,v 1.6 2018/05/03 07:13:48 maxv Exp $");
 #else
 static const char rcsid[] = "@(#)Id: ip_auth.c,v 1.1.1.2 2012/07/22 13:45:08 darrenr Exp";
 #endif
Index: src/sys/external/bsd/ipf/netinet/ip_frag.c
diff -u src/sys/external/bsd/ipf/netinet/ip_frag.c:1.5 src/sys/external/bsd/ipf/netinet/ip_frag.c:1.6
--- src/sys/external/bsd/ipf/netinet/ip_frag.c:1.5	Sun Apr 23 19:09:29 2017
+++ src/sys/external/bsd/ipf/netinet/ip_frag.c	Thu May  3 07:13:48 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_frag.c,v 1.5 2017/04/23 19:09:29 christos Exp $	*/
+/*	$NetBSD: ip_frag.c,v 1.6 2018/05/03 07:13:48 maxv Exp $	*/
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -73,7 +73,6 @@ struct file;
 #include 
 #include 
 #include "netinet/ip_compat.h"
-#include 
 #include "netinet/ip_fil.h"
 #include "netinet/ip_nat.h"
 #include "netinet/ip_frag.h"
@@ -87,7 +86,7 @@ struct file;
 #if !defined(lint)
 #if defined(__NetBSD__)
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip_frag.c,v 1.5 2017/04/23 19:09:29 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_frag.c,v 1.6 2018/05/03 07:13:48 maxv Exp $");
 #else
 static const char sccsid[] = "@(#)ip_frag.c	1.11 3/24/96 (C) 1993-2000 Darren Reed";
 static const char rcsid[] = "@(#)Id: ip_frag.c,v 1.1.1.2 2012/07/22 13:45:17 darrenr Exp";
Index: src/sys/external/bsd/ipf/netinet/ip_proxy.c
diff -u src/sys/external/bsd/ipf/netinet/ip_proxy.c:1.5 src/sys/external/bsd/ipf/netinet/ip_proxy.c:1.6
--- src/sys/external/bsd/ipf/netinet/ip_proxy.c:1.5	Sun Jul 22 16:34:04 2012
+++ src/sys/external/bsd/ipf/netinet/ip_proxy.c	Thu May  3 07:13:48 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_proxy.c,v 1.5 2012/07/22 16:34:04 darrenr Exp $	*/
+/*	$NetBSD: ip_proxy.c,v 1.6 2018/05/03 07:13:48 maxv Exp $	*/
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -77,7 +77,6 @@ struct file;
 #include 
 #include 
 #include "netinet/ip_compat.h"
-#include 
 

CVS commit: src

2018-05-03 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu May  3 07:13:49 UTC 2018

Modified Files:
src/sys/external/bsd/ipf/netinet: ip_auth.c ip_fil_netbsd.c ip_frag.c
ip_log.c ip_nat.c ip_nat6.c ip_proxy.c ip_sync.c
src/sys/netinet: in_proto.c tcp_congctl.c tcp_debug.c tcp_input.c
tcp_output.c tcp_sack.c tcp_subr.c tcp_timer.c tcp_usrreq.c
tcp_vtw.c
src/sys/netinet6: in6_proto.c
src/usr.bin/netstat: inet.c inet6.c vtw.c
src/usr.bin/systat: netstat.c
src/usr.sbin/trpt: trpt.c

Log Message:
Remove now unused tcpip.h includes. Some were already unused before.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/external/bsd/ipf/netinet/ip_auth.c \
src/sys/external/bsd/ipf/netinet/ip_frag.c \
src/sys/external/bsd/ipf/netinet/ip_proxy.c \
src/sys/external/bsd/ipf/netinet/ip_sync.c
cvs rdiff -u -r1.27 -r1.28 src/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c
cvs rdiff -u -r1.6 -r1.7 src/sys/external/bsd/ipf/netinet/ip_log.c
cvs rdiff -u -r1.18 -r1.19 src/sys/external/bsd/ipf/netinet/ip_nat.c
cvs rdiff -u -r1.10 -r1.11 src/sys/external/bsd/ipf/netinet/ip_nat6.c
cvs rdiff -u -r1.127 -r1.128 src/sys/netinet/in_proto.c
cvs rdiff -u -r1.24 -r1.25 src/sys/netinet/tcp_congctl.c
cvs rdiff -u -r1.31 -r1.32 src/sys/netinet/tcp_debug.c
cvs rdiff -u -r1.406 -r1.407 src/sys/netinet/tcp_input.c
cvs rdiff -u -r1.205 -r1.206 src/sys/netinet/tcp_output.c
cvs rdiff -u -r1.34 -r1.35 src/sys/netinet/tcp_sack.c
cvs rdiff -u -r1.278 -r1.279 src/sys/netinet/tcp_subr.c
cvs rdiff -u -r1.94 -r1.95 src/sys/netinet/tcp_timer.c
cvs rdiff -u -r1.218 -r1.219 src/sys/netinet/tcp_usrreq.c
cvs rdiff -u -r1.18 -r1.19 src/sys/netinet/tcp_vtw.c
cvs rdiff -u -r1.123 -r1.124 src/sys/netinet6/in6_proto.c
cvs rdiff -u -r1.107 -r1.108 src/usr.bin/netstat/inet.c
cvs rdiff -u -r1.70 -r1.71 src/usr.bin/netstat/inet6.c
cvs rdiff -u -r1.9 -r1.10 src/usr.bin/netstat/vtw.c
cvs rdiff -u -r1.29 -r1.30 src/usr.bin/systat/netstat.c
cvs rdiff -u -r1.27 -r1.28 src/usr.sbin/trpt/trpt.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-05-03 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu May  3 07:01:08 UTC 2018

Modified Files:
src/sys/dist/pf/net: pf.c
src/sys/external/bsd/ipf/netinet: ip_compat.h ip_fil_netbsd.c
src/sys/netinet: dccp_usrreq.c sctp_output.c
src/sys/sys: mbuf.h

Log Message:
Remove m_copy completely.


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/sys/dist/pf/net/pf.c
cvs rdiff -u -r1.12 -r1.13 src/sys/external/bsd/ipf/netinet/ip_compat.h
cvs rdiff -u -r1.26 -r1.27 src/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c
cvs rdiff -u -r1.17 -r1.18 src/sys/netinet/dccp_usrreq.c
cvs rdiff -u -r1.14 -r1.15 src/sys/netinet/sctp_output.c
cvs rdiff -u -r1.200 -r1.201 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-05-03 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu May  3 07:01:08 UTC 2018

Modified Files:
src/sys/dist/pf/net: pf.c
src/sys/external/bsd/ipf/netinet: ip_compat.h ip_fil_netbsd.c
src/sys/netinet: dccp_usrreq.c sctp_output.c
src/sys/sys: mbuf.h

Log Message:
Remove m_copy completely.


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/sys/dist/pf/net/pf.c
cvs rdiff -u -r1.12 -r1.13 src/sys/external/bsd/ipf/netinet/ip_compat.h
cvs rdiff -u -r1.26 -r1.27 src/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c
cvs rdiff -u -r1.17 -r1.18 src/sys/netinet/dccp_usrreq.c
cvs rdiff -u -r1.14 -r1.15 src/sys/netinet/sctp_output.c
cvs rdiff -u -r1.200 -r1.201 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/dist/pf/net/pf.c
diff -u src/sys/dist/pf/net/pf.c:1.80 src/sys/dist/pf/net/pf.c:1.81
--- src/sys/dist/pf/net/pf.c:1.80	Mon Feb 19 23:03:00 2018
+++ src/sys/dist/pf/net/pf.c	Thu May  3 07:01:08 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pf.c,v 1.80 2018/02/19 23:03:00 christos Exp $	*/
+/*	$NetBSD: pf.c,v 1.81 2018/05/03 07:01:08 maxv Exp $	*/
 /*	$OpenBSD: pf.c,v 1.552.2.1 2007/11/27 16:37:57 henning Exp $ */
 
 /*
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pf.c,v 1.80 2018/02/19 23:03:00 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pf.c,v 1.81 2018/05/03 07:01:08 maxv Exp $");
 
 #include "pflog.h"
 
@@ -1856,7 +1856,11 @@ pf_send_icmp(struct mbuf *m, u_int8_t ty
 	struct pf_mtag	*pf_mtag;
 #endif /* __NetBSD__ */
 
+#ifdef __NetBSD__
+	m0 = m_copym(m, 0, M_COPYALL, M_DONTWAIT);
+#else
 	m0 = m_copy(m, 0, M_COPYALL);
+#endif
 
 #ifdef __NetBSD__
 	if ((pf_mtag = pf_get_mtag(m0)) == NULL)

Index: src/sys/external/bsd/ipf/netinet/ip_compat.h
diff -u src/sys/external/bsd/ipf/netinet/ip_compat.h:1.12 src/sys/external/bsd/ipf/netinet/ip_compat.h:1.13
--- src/sys/external/bsd/ipf/netinet/ip_compat.h:1.12	Tue May  1 07:07:00 2018
+++ src/sys/external/bsd/ipf/netinet/ip_compat.h	Thu May  3 07:01:08 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_compat.h,v 1.12 2018/05/01 07:07:00 maxv Exp $	*/
+/*	$NetBSD: ip_compat.h,v 1.13 2018/05/03 07:01:08 maxv Exp $	*/
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -251,7 +251,7 @@ struct file;
 #  define	MSGDSIZE(m)	mbufchainlen(m)
 #  define	M_LEN(m)	(m)->m_len
 #  define	M_ADJ(m,x)	m_adj(m, x)
-#  define	M_COPY(x)	m_copy((x), 0, M_COPYALL)
+#  define	M_COPY(x)	m_copym((x), 0, M_COPYALL, M_DONTWAIT)
 #  define	GETKTIME(x)	microtime((struct timeval *)x)
 #  define	IPF_PANIC(x,y)	if (x) { printf y; panic("ipf_panic"); }
 #  define	COPYIN(a,b,c)	copyin((void *)(a), (void *)(b), (c))

Index: src/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c
diff -u src/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c:1.26 src/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c:1.27
--- src/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c:1.26	Sun Jul 23 06:19:00 2017
+++ src/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c	Thu May  3 07:01:08 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_fil_netbsd.c,v 1.26 2017/07/23 06:19:00 christos Exp $	*/
+/*	$NetBSD: ip_fil_netbsd.c,v 1.27 2018/05/03 07:01:08 maxv Exp $	*/
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -8,7 +8,7 @@
 #if !defined(lint)
 #if defined(__NetBSD__)
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip_fil_netbsd.c,v 1.26 2017/07/23 06:19:00 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_fil_netbsd.c,v 1.27 2018/05/03 07:01:08 maxv Exp $");
 #else
 static const char sccsid[] = "@(#)ip_fil.c	2.41 6/5/96 (C) 1993-2000 Darren Reed";
 static const char rcsid[] = "@(#)Id: ip_fil_netbsd.c,v 1.1.1.2 2012/07/22 13:45:17 darrenr Exp";
@@ -1312,7 +1312,7 @@ ipf_fastroute(mb_t *m0, mb_t **mpp, fr_i
 		else
 			mhip->ip_off |= IP_MF;
 		mhip->ip_len = htons((u_short)(len + mhlen));
-		m->m_next = m_copy(m0, off, len);
+		m->m_next = m_copym(m0, off, len, M_DONTWAIT);
 		if (m->m_next == 0) {
 			error = ENOBUFS;	/* ??? */
 			goto sendorfree;

Index: src/sys/netinet/dccp_usrreq.c
diff -u src/sys/netinet/dccp_usrreq.c:1.17 src/sys/netinet/dccp_usrreq.c:1.18
--- src/sys/netinet/dccp_usrreq.c:1.17	Thu Feb  8 09:05:20 2018
+++ src/sys/netinet/dccp_usrreq.c	Thu May  3 07:01:08 2018
@@ -1,5 +1,5 @@
 /*	$KAME: dccp_usrreq.c,v 1.67 2005/11/03 16:05:04 nishida Exp $	*/
-/*	$NetBSD: dccp_usrreq.c,v 1.17 2018/02/08 09:05:20 dholland Exp $ */
+/*	$NetBSD: dccp_usrreq.c,v 1.18 2018/05/03 07:01:08 maxv Exp $ */
 
 /*
  * Copyright (c) 2003 Joacim Häggmark, Magnus Erixzon, Nils-Erik Mattsson 
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dccp_usrreq.c,v 1.17 2018/02/08 09:05:20 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dccp_usrreq.c,v 1.18 2018/05/03 07:01:08 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1413,7 +1413,8 @@ again:
 			mtod(m, char *) + hdrlen);
 			m->m_len += len;
 		} else {
-			m->m_next = m_copy(so->so_snd.sb_mb, off, (int) len);
+			m->m_next = 

CVS commit: src/sys

2018-05-03 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu May  3 06:41:30 UTC 2018

Modified Files:
src/sys/netinet6: in6_proto.c
Removed Files:
src/sys/net: net_osdep.h

Log Message:
Remove net_osdep.h completely.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r0 src/sys/net/net_osdep.h
cvs rdiff -u -r1.122 -r1.123 src/sys/netinet6/in6_proto.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-05-03 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu May  3 06:41:30 UTC 2018

Modified Files:
src/sys/netinet6: in6_proto.c
Removed Files:
src/sys/net: net_osdep.h

Log Message:
Remove net_osdep.h completely.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r0 src/sys/net/net_osdep.h
cvs rdiff -u -r1.122 -r1.123 src/sys/netinet6/in6_proto.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/netinet6/in6_proto.c
diff -u src/sys/netinet6/in6_proto.c:1.122 src/sys/netinet6/in6_proto.c:1.123
--- src/sys/netinet6/in6_proto.c:1.122	Thu Mar 15 08:15:21 2018
+++ src/sys/netinet6/in6_proto.c	Thu May  3 06:41:30 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: in6_proto.c,v 1.122 2018/03/15 08:15:21 maxv Exp $	*/
+/*	$NetBSD: in6_proto.c,v 1.123 2018/05/03 06:41:30 maxv Exp $	*/
 /*	$KAME: in6_proto.c,v 1.66 2000/10/10 15:35:47 itojun Exp $	*/
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.122 2018/03/15 08:15:21 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.123 2018/05/03 06:41:30 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_gateway.h"
@@ -138,8 +138,6 @@ __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,
 
 #include 
 
-#include 
-
 /*
  * TCP/IP protocol family: IP6, ICMP6, UDP, TCP.
  */