CVS commit: src/lib/libc/sys

2022-06-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Jun 28 20:24:08 UTC 2022

Modified Files:
src/lib/libc/sys: bind.2

Log Message:
bind.2: add references to specific protocol families

Referring the reader to "the manual entries in section 4" was too
unspecific to be useful, as that section contains device drivers as
well.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/lib/libc/sys/bind.2

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

Modified files:

Index: src/lib/libc/sys/bind.2
diff -u src/lib/libc/sys/bind.2:1.31 src/lib/libc/sys/bind.2:1.32
--- src/lib/libc/sys/bind.2:1.31	Sun Mar 28 03:29:31 2021
+++ src/lib/libc/sys/bind.2	Tue Jun 28 20:24:08 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: bind.2,v 1.31 2021/03/28 03:29:31 dholland Exp $
+.\"	$NetBSD: bind.2,v 1.32 2022/06/28 20:24:08 rillig Exp $
 .\"
 .\" Copyright (c) 1983, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\" @(#)bind.2	8.1 (Berkeley) 6/4/93
 .\"
-.Dd March 27, 2021
+.Dd June 28, 2022
 .Dt BIND 2
 .Os
 .Sh NAME
@@ -133,7 +133,9 @@ The name would reside on a read-only fil
 .Xr connect 2 ,
 .Xr getsockname 2 ,
 .Xr listen 2 ,
-.Xr socket 2
+.Xr socket 2 ,
+.Xr inet 4 ,
+.Xr inet6 4
 .Sh HISTORY
 The
 .Fn bind



CVS commit: src/lib/libc/sys

2022-06-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Jun 28 20:24:08 UTC 2022

Modified Files:
src/lib/libc/sys: bind.2

Log Message:
bind.2: add references to specific protocol families

Referring the reader to "the manual entries in section 4" was too
unspecific to be useful, as that section contains device drivers as
well.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/lib/libc/sys/bind.2

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



CVS commit: src

2022-06-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Jun 28 20:12:52 UTC 2022

Modified Files:
src/games/trek: trek.6
src/lib/libc/net: sockatmark.3
src/lib/libc/sys: socket.2
src/share/man/man4: inet.4 unix.4
src/share/man/man4/man4.hp300: rmp.4
src/share/man/man9: mbuf.9

Log Message:
fix references in manual pages to the reference documentation


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/games/trek/trek.6
cvs rdiff -u -r1.9 -r1.10 src/lib/libc/net/sockatmark.3
cvs rdiff -u -r1.42 -r1.43 src/lib/libc/sys/socket.2
cvs rdiff -u -r1.18 -r1.19 src/share/man/man4/inet.4
cvs rdiff -u -r1.27 -r1.28 src/share/man/man4/unix.4
cvs rdiff -u -r1.12 -r1.13 src/share/man/man4/man4.hp300/rmp.4
cvs rdiff -u -r1.66 -r1.67 src/share/man/man9/mbuf.9

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

Modified files:

Index: src/games/trek/trek.6
diff -u src/games/trek/trek.6:1.13 src/games/trek/trek.6:1.14
--- src/games/trek/trek.6:1.13	Mon May 25 00:53:46 2009
+++ src/games/trek/trek.6	Tue Jun 28 20:12:52 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: trek.6,v 1.13 2009/05/25 00:53:46 dholland Exp $
+.\"	$NetBSD: trek.6,v 1.14 2022/06/28 20:12:52 rillig Exp $
 .\"
 .\" Copyright (c) 1980, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"	@(#)trek.6	8.2 (Berkeley) 12/30/93
 .\"
-.Dd May 24, 2009
+.Dd June 28, 2022
 .Dt TREK 6
 .Os
 .Sh NAME
@@ -78,7 +78,7 @@ You should normally start out with a nov
 In general, throughout the game, if you forget what is appropriate
 the game will tell you what it expects if you just type in a question mark.
 .Sh SEE ALSO
-.Pa /usr/share/doc/usd/31.trek
+.Pa /usr/share/doc/reference/ref6/trek
 .Sh AUTHORS
 .An Eric Allman
 .Sh COMMAND SUMMARY

Index: src/lib/libc/net/sockatmark.3
diff -u src/lib/libc/net/sockatmark.3:1.9 src/lib/libc/net/sockatmark.3:1.10
--- src/lib/libc/net/sockatmark.3:1.9	Wed Apr 30 13:10:50 2008
+++ src/lib/libc/net/sockatmark.3	Tue Jun 28 20:12:52 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sockatmark.3,v 1.9 2008/04/30 13:10:50 martin Exp $
+.\"	$NetBSD: sockatmark.3,v 1.10 2022/06/28 20:12:52 rillig Exp $
 .\"
 .\" Copyright (c) 2001 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd May 15, 2003
+.Dd June 28, 2022
 .Dt SOCKATMARK 3
 .Os
 .Sh NAME
@@ -76,7 +76,7 @@ does not refer to a socket.
 .%T "An Introductory 4.4BSD Interprocess Communication Tutorial"
 .%A Stuart Sechrest
 .Re
-.Pq see Pa /usr/share/doc/psd/20.ipctut
+.Pq see Pa /usr/share/doc/reference/ref3/sockets
 .Rs
 .%T "Advanced 4.4BSD IPC Tutorial"
 .%A Samuel J. Leffler
@@ -86,7 +86,7 @@ does not refer to a socket.
 .%A Steve Miller
 .%A Chris Torek
 .Re
-.Pq see Pa /usr/share/doc/psd/21.ipc
+.Pq see Pa /usr/share/doc/reference/ref3/sockets-advanced
 .Sh STANDARDS
 The
 .Nm sockatmark

Index: src/lib/libc/sys/socket.2
diff -u src/lib/libc/sys/socket.2:1.42 src/lib/libc/sys/socket.2:1.43
--- src/lib/libc/sys/socket.2:1.42	Sat May 27 21:02:55 2017
+++ src/lib/libc/sys/socket.2	Tue Jun 28 20:12:52 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: socket.2,v 1.42 2017/05/27 21:02:55 bouyer Exp $
+.\"	$NetBSD: socket.2,v 1.43 2022/06/28 20:12:52 rillig Exp $
 .\"
 .\" Copyright (c) 1983, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\" @(#)socket.2	8.1 (Berkeley) 6/4/93
 .\"
-.Dd April 27, 2017
+.Dd June 28, 2022
 .Dt SOCKET 2
 .Os
 .Sh NAME
@@ -276,7 +276,7 @@ The socket type is not supported by the 
 .%T "An Introductory 4.4BSD Interprocess Communication Tutorial"
 .%A Stuart Sechrest
 .Re
-.Pq see Pa /usr/share/doc/psd/20.ipctut
+.Pq see Pa /usr/share/doc/reference/ref3/sockets
 .Rs
 .%T "Advanced 4.4BSD IPC Tutorial"
 .%A Samuel J. Leffler
@@ -286,7 +286,7 @@ The socket type is not supported by the 
 .%A Steve Miller
 .%A Chris Torek
 .Re
-.Pq see Pa /usr/share/doc/psd/21.ipc
+.Pq see Pa /usr/share/doc/reference/ref3/sockets-advanced
 .Sh HISTORY
 The
 .Fn socket

Index: src/share/man/man4/inet.4
diff -u src/share/man/man4/inet.4:1.18 src/share/man/man4/inet.4:1.19
--- src/share/man/man4/inet.4:1.18	Mon Mar 22 18:58:31 2010
+++ src/share/man/man4/inet.4	Tue Jun 28 20:12:52 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: inet.4,v 1.18 2010/03/22 18:58:31 joerg Exp $
+.\"	$NetBSD: inet.4,v 1.19 2022/06/28 20:12:52 rillig Exp $
 .\"
 .\" Copyright (c) 1983, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\" @(#)inet.4	8.1 (Berkeley) 6/5/93
 .\"
-.Dd May 15, 2003
+.Dd June 28, 2022
 .Dt INET 4
 .Os
 .Sh NAME
@@ -164,7 +164,7 @@ Get interface network mask.
 .%T "An Introductory 4.4BSD Interprocess Communication Tutorial"
 .%A Stuart Sechrest
 .Re
-.Pq see Pa /usr/share/doc/psd/20.ipctut
+.Pq 

CVS commit: src

2022-06-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Jun 28 20:12:52 UTC 2022

Modified Files:
src/games/trek: trek.6
src/lib/libc/net: sockatmark.3
src/lib/libc/sys: socket.2
src/share/man/man4: inet.4 unix.4
src/share/man/man4/man4.hp300: rmp.4
src/share/man/man9: mbuf.9

Log Message:
fix references in manual pages to the reference documentation


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/games/trek/trek.6
cvs rdiff -u -r1.9 -r1.10 src/lib/libc/net/sockatmark.3
cvs rdiff -u -r1.42 -r1.43 src/lib/libc/sys/socket.2
cvs rdiff -u -r1.18 -r1.19 src/share/man/man4/inet.4
cvs rdiff -u -r1.27 -r1.28 src/share/man/man4/unix.4
cvs rdiff -u -r1.12 -r1.13 src/share/man/man4/man4.hp300/rmp.4
cvs rdiff -u -r1.66 -r1.67 src/share/man/man9/mbuf.9

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



Re: lint warnings

2022-06-28 Thread Roland Illig

In article <20220624201621.ef2aff...@cvs.netbsd.org>,
Roland Illig  wrote:

-=-=-=-=-=-

Module Name:    src
Committed By:   rillig
Date:   Fri Jun 24 20:16:21 UTC 2022

Modified Files:
 src/tests/usr.bin/xlint/lint1: msg_247.c
 src/usr.bin/xlint/lint1: tree.c

Log Message:
lint: do not warn about pointer cast between sockaddr variants


Am 28.06.2022 um 15:28 schrieb Christos Zoulas:

I meant that I don't want to lose all those warnings in pedantic mode, but
I was not planning to add it. It seems useful to still have a way for lint
report the cases where they are usage-specific correct, but not
linguistically correct.


I agree on this use case. On the same scheme, I'd have a few more use
cases, and eventually this might lead to a query language for inspecting
C code. I'm thinking of queries like:

* implicit conversions from floating to integer types
* implicit conversions that change the signedness
* usual arithmetic conversions that change one of the operands
* casts from floating to integer types
* binary + with operand types 'integer' and 'pointer'
* no-op pointer casts
* pointer casts between types that are not strictly compatible
* pointer casts after function calls to 'malloc'
* conversion from array to pointer

Short of having this runtime query language, these questions might be
implemented as lint warnings that are disabled by default and could be
enabled by their message ID or a descriptive name. All current lint
warnings are enabled by default, it's just that some branches are
guarded by command line flags, especially in cases where several places
in lint's code generate the same warning.

And maybe there are already tools out there that support this kind of
queries, in a simpler language than C.

Roland


CVS commit: src/doc

2022-06-28 Thread Frederic Cambus
Module Name:src
Committed By:   fcambus
Date:   Tue Jun 28 15:58:59 UTC 2022

Modified Files:
src/doc: 3RDPARTY

Log Message:
Note that GCC 10.4 has been released today.


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

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



CVS commit: src/doc

2022-06-28 Thread Frederic Cambus
Module Name:src
Committed By:   fcambus
Date:   Tue Jun 28 15:58:59 UTC 2022

Modified Files:
src/doc: 3RDPARTY

Log Message:
Note that GCC 10.4 has been released today.


To generate a diff of this commit:
cvs rdiff -u -r1.1862 -r1.1863 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.1862 src/doc/3RDPARTY:1.1863
--- src/doc/3RDPARTY:1.1862	Sun Jun  5 05:16:57 2022
+++ src/doc/3RDPARTY	Tue Jun 28 15:58:59 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1862 2022/06/05 05:16:57 mrg Exp $
+#	$NetBSD: 3RDPARTY,v 1.1863 2022/06/28 15:58:59 fcambus Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -451,11 +451,11 @@ There is a flex2netbsd script to help ne
 
 Package:	gcc
 Version:	10.3.0
-Current Vers:	10.3.0/11.3.0/12.1.0
+Current Vers:	10.4.0/11.3.0/12.1.0
 Maintainer:	FSF
 Archive Site:	ftp://ftp.gnu.org/gnu/gcc/
 Home Page:	https://www.gnu.org/software/gcc/
-Date:		2022-05-06
+Date:		2022-06-28
 Mailing List:	gcc-b...@gnu.org
 Responsible:	mrg, christos, skrll
 License:	GPLv3, LGPLv3.1



Re: lint warnings

2022-06-28 Thread Christos Zoulas

On 2022-06-28 12:10 am, Roland Illig wrote:

Am 27.06.2022 um 20:20 schrieb Christos Zoulas:

In article <68ea25e4-a22b-4fbc-af8c-30c4195d2...@gmx.de>,
Roland Illig   wrote:

27.06.2022 01:20:20 Christos Zoulas :


In article <20220624201621.ef2aff...@cvs.netbsd.org>,
Roland Illig  wrote:

-=-=-=-=-=-

Module Name:    src
Committed By:   rillig
Date:   Fri Jun 24 20:16:21 UTC 2022

Modified Files:
     src/tests/usr.bin/xlint/lint1: msg_247.c
     src/usr.bin/xlint/lint1: tree.c

Log Message:
lint: do not warn about pointer cast between sockaddr variants


My expectation of lint is that it warns me about possible bugs, and
casting between the sockaddr variants is required by the API, 
therefore

I don't see a point in flagging it as a possible bug.

Or would you rather fix all the current warnings by adding an
intermediate cast to 'void *'? That would be a lot of work, plus the
intermediate cast can hide other typos.


There is no intermediate cast needed; you can just cast the sockaddr 
flavor

to (void *) or (const void *).


This '(void *)' or '(const void *)' is exactly what I meant with
'intermediate cast'. This cast would also hide casts between completely
unrelated pointer types, therefore I prefer the direct cast from one
sockaddr pointer to another.


Yes, I meant there is only one cast needed.



Lint warns about the direct casts in all cases that seem dubious, while
it treats a cast chain involving '(void *)' as an 'I know what I'm
doing' from the author. This exact behavior makes sense to me.


... cast from 'pointer to array[20] of double' to 'pointer
to double': I don't see how that could be dangerous ...


... I was thinking to wrap them all up into a pedantic flag instead.


Did you mean this as 'I will implement this pedantic flag', or rather 
as

'you should implement this'? Right now, I won't do that because I'm
lacking any good examples that would demonstrate the usefulness of this
new flag. If you add that flag, could you add a few examples to the
existing tests? Having these examples is much easier than digging
through the code, trying to find examples retrospectively 25 years 
later. :)


I meant that I don't want to lose all those warnings in pedantic mode, 
but
I was not planning to add it. It seems useful to still have a way for 
lint
report the cases where they are usage-specific correct, but not 
linguistically

correct.

christos


CVS commit: src/sys/dev/bluetooth

2022-06-28 Thread Iain Hibbert
Module Name:src
Committed By:   plunky
Date:   Tue Jun 28 13:25:36 UTC 2022

Modified Files:
src/sys/dev/bluetooth: bcsp.c bth5.c btuart.c

Log Message:
remove KASSERT() checking for t_oproc at open since assigning this line
discipline to a pty may not have that set. Instead do a runtime check to
ensure that the function exists before calling it, as ttstart() handles it.

Same code in btuart.c, bcsp.c and bth5.c

Reported-by: syzbot+766981eef92a3cd03...@syzkaller.appspotmail.com


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/bluetooth/bcsp.c
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/bluetooth/bth5.c
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/bluetooth/btuart.c

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

Modified files:

Index: src/sys/dev/bluetooth/bcsp.c
diff -u src/sys/dev/bluetooth/bcsp.c:1.31 src/sys/dev/bluetooth/bcsp.c:1.32
--- src/sys/dev/bluetooth/bcsp.c:1.31	Thu Jan 24 09:33:03 2019
+++ src/sys/dev/bluetooth/bcsp.c	Tue Jun 28 13:25:36 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcsp.c,v 1.31 2019/01/24 09:33:03 knakahara Exp $	*/
+/*	$NetBSD: bcsp.c,v 1.32 2022/06/28 13:25:36 plunky Exp $	*/
 /*
  * Copyright (c) 2007 KIYOHARA Takashi
  * All rights reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bcsp.c,v 1.31 2019/01/24 09:33:03 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcsp.c,v 1.32 2022/06/28 13:25:36 plunky Exp $");
 
 #include 
 #include 
@@ -387,8 +387,6 @@ bcspopen(dev_t device __unused, struct t
 		}
 	}
 
-	KASSERT(tp->t_oproc != NULL);
-
 	cfdata = malloc(sizeof(struct cfdata), M_DEVBUF, M_WAITOK);
 	for (unit = 0; unit < bcsp_cd.cd_ndevs; unit++)
 		if (device_lookup(_cd, unit) == NULL)
@@ -597,7 +595,7 @@ bcsp_slip_transmit(struct tty *tp)
 
 	sc->sc_stats.byte_tx += count;
 
-	if (tp->t_outq.c_cc != 0)
+	if (tp->t_outq.c_cc != 0 && tp->t_oproc != NULL)
 		(*tp->t_oproc)(tp);
 
 	return 0;

Index: src/sys/dev/bluetooth/bth5.c
diff -u src/sys/dev/bluetooth/bth5.c:1.6 src/sys/dev/bluetooth/bth5.c:1.7
--- src/sys/dev/bluetooth/bth5.c:1.6	Sat Nov 16 22:06:49 2019
+++ src/sys/dev/bluetooth/bth5.c	Tue Jun 28 13:25:36 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: bth5.c,v 1.6 2019/11/16 22:06:49 mlelstv Exp $	*/
+/*	$NetBSD: bth5.c,v 1.7 2022/06/28 13:25:36 plunky Exp $	*/
 /*
  * Copyright (c) 2017 Nathanial Sloss 
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bth5.c,v 1.6 2019/11/16 22:06:49 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bth5.c,v 1.7 2022/06/28 13:25:36 plunky Exp $");
 
 #include 
 #include 
@@ -392,8 +392,6 @@ bth5open(dev_t device __unused, struct t
 		}
 	}
 
-	KASSERT(tp->t_oproc != NULL);
-
 	cfdata = malloc(sizeof(struct cfdata), M_DEVBUF, M_WAITOK);
 	for (unit = 0; unit < bthfive_cd.cd_ndevs; unit++)
 		if (device_lookup(_cd, unit) == NULL)
@@ -633,7 +631,7 @@ bth5_slip_transmit(struct tty *tp)
 
 	sc->sc_stats.byte_tx += count;
 
-	if (tp->t_outq.c_cc != 0)
+	if (tp->t_outq.c_cc != 0 && tp->t_oproc != NULL)
 		(*tp->t_oproc)(tp);
 
 	return 0;

Index: src/sys/dev/bluetooth/btuart.c
diff -u src/sys/dev/bluetooth/btuart.c:1.29 src/sys/dev/bluetooth/btuart.c:1.30
--- src/sys/dev/bluetooth/btuart.c:1.29	Thu Jan 24 09:33:03 2019
+++ src/sys/dev/bluetooth/btuart.c	Tue Jun 28 13:25:36 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: btuart.c,v 1.29 2019/01/24 09:33:03 knakahara Exp $	*/
+/*	$NetBSD: btuart.c,v 1.30 2022/06/28 13:25:36 plunky Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007 KIYOHARA Takashi
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: btuart.c,v 1.29 2019/01/24 09:33:03 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: btuart.c,v 1.30 2022/06/28 13:25:36 plunky Exp $");
 
 #include 
 #include 
@@ -240,8 +240,6 @@ btuartopen(dev_t devno __unused, struct 
 		}
 	}
 
-	KASSERT(tp->t_oproc != NULL);
-
 	cfdata = malloc(sizeof(struct cfdata), M_DEVBUF, M_WAITOK);
 	for (unit = 0; unit < btuart_cd.cd_ndevs; unit++)
 		if (device_lookup(_cd, unit) == NULL)
@@ -543,7 +541,7 @@ btuartstart(struct tty *tp)
 
 	sc->sc_stats.byte_tx += count;
 
-	if (tp->t_outq.c_cc != 0)
+	if (tp->t_outq.c_cc != 0 && tp->t_oproc != NULL)
 		(*tp->t_oproc)(tp);
 
 	return 0;



CVS commit: src/sys/dev/bluetooth

2022-06-28 Thread Iain Hibbert
Module Name:src
Committed By:   plunky
Date:   Tue Jun 28 13:25:36 UTC 2022

Modified Files:
src/sys/dev/bluetooth: bcsp.c bth5.c btuart.c

Log Message:
remove KASSERT() checking for t_oproc at open since assigning this line
discipline to a pty may not have that set. Instead do a runtime check to
ensure that the function exists before calling it, as ttstart() handles it.

Same code in btuart.c, bcsp.c and bth5.c

Reported-by: syzbot+766981eef92a3cd03...@syzkaller.appspotmail.com


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/bluetooth/bcsp.c
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/bluetooth/bth5.c
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/bluetooth/btuart.c

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



CVS commit: src/sys/kern

2022-06-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Jun 28 11:41:32 UTC 2022

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

Log Message:
recvmmsg(2): Avoid arithmetic overflow in timeout calculations.

XXX This is not right -- it doesn't actually do anything to time
out...

Reported-by: syzbot+784209d76a94fcc64...@syzkaller.appspotmail.com


To generate a diff of this commit:
cvs rdiff -u -r1.203 -r1.204 src/sys/kern/uipc_syscalls.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_syscalls.c
diff -u src/sys/kern/uipc_syscalls.c:1.203 src/sys/kern/uipc_syscalls.c:1.204
--- src/sys/kern/uipc_syscalls.c:1.203	Mon Jun 27 04:06:48 2022
+++ src/sys/kern/uipc_syscalls.c	Tue Jun 28 11:41:32 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_syscalls.c,v 1.203 2022/06/27 04:06:48 riastradh Exp $	*/
+/*	$NetBSD: uipc_syscalls.c,v 1.204 2022/06/28 11:41:32 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls.c,v 1.203 2022/06/27 04:06:48 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls.c,v 1.204 2022/06/28 11:41:32 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_pipe.h"
@@ -1042,7 +1042,12 @@ sys_recvmmsg(struct lwp *l, const struct
 		if ((error = copyin(SCARG(uap, timeout), , sizeof(ts))) != 0)
 			return error;
 		getnanotime();
-		timespecadd(, , );
+		if (timespecaddok(, )) {
+			timespecadd(, , );
+		} else {
+			ts.tv_sec = __type_max(time_t);
+			ts.tv_nsec = 9L;
+		}
 	}
 
 	s = SCARG(uap, s);
@@ -1109,8 +1114,7 @@ sys_recvmmsg(struct lwp *l, const struct
 
 		if (SCARG(uap, timeout)) {
 			getnanotime();
-			timespecsub(, , );
-			if (now.tv_sec > 0)
+			if (timespeccmp(, , <))
 break;
 		}
 



CVS commit: src/sys/kern

2022-06-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Jun 28 11:41:32 UTC 2022

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

Log Message:
recvmmsg(2): Avoid arithmetic overflow in timeout calculations.

XXX This is not right -- it doesn't actually do anything to time
out...

Reported-by: syzbot+784209d76a94fcc64...@syzkaller.appspotmail.com


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

2022-06-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Jun 28 10:42:22 UTC 2022

Modified Files:
src/sys/arch/arm/apple: apple_intc.c

Log Message:
appleintc: update ci_cpl in pic_set_priority callback


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/apple/apple_intc.c

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

Modified files:

Index: src/sys/arch/arm/apple/apple_intc.c
diff -u src/sys/arch/arm/apple/apple_intc.c:1.8 src/sys/arch/arm/apple/apple_intc.c:1.9
--- src/sys/arch/arm/apple/apple_intc.c:1.8	Mon May  2 04:39:29 2022
+++ src/sys/arch/arm/apple/apple_intc.c	Tue Jun 28 10:42:22 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: apple_intc.c,v 1.8 2022/05/02 04:39:29 ryo Exp $ */
+/* $NetBSD: apple_intc.c,v 1.9 2022/06/28 10:42:22 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2021 Jared McNeill 
@@ -32,7 +32,7 @@
 #define	_INTR_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: apple_intc.c,v 1.8 2022/05/02 04:39:29 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: apple_intc.c,v 1.9 2022/06/28 10:42:22 jmcneill Exp $");
 
 #include 
 #include 
@@ -150,6 +150,7 @@ apple_intc_establish_irq(struct pic_soft
 static void
 apple_intc_set_priority(struct pic_softc *pic, int ipl)
 {
+	curcpu()->ci_cpl = ipl;
 }
 
 static void



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

2022-06-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Jun 28 10:42:22 UTC 2022

Modified Files:
src/sys/arch/arm/apple: apple_intc.c

Log Message:
appleintc: update ci_cpl in pic_set_priority callback


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/apple/apple_intc.c

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



CVS commit: src

2022-06-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jun 28 08:03:49 UTC 2022

Modified Files:
src: UPDATING

Log Message:
Note that src/games/robots now nees a clean rebuild.


To generate a diff of this commit:
cvs rdiff -u -r1.327 -r1.328 src/UPDATING

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

Modified files:

Index: src/UPDATING
diff -u src/UPDATING:1.327 src/UPDATING:1.328
--- src/UPDATING:1.327	Tue Dec  7 21:45:31 2021
+++ src/UPDATING	Tue Jun 28 08:03:49 2022
@@ -1,4 +1,4 @@
-$NetBSD: UPDATING,v 1.327 2021/12/07 21:45:31 andvar Exp $
+$NetBSD: UPDATING,v 1.328 2022/06/28 08:03:49 martin Exp $
 
 This file (UPDATING) is intended to be a brief reference to recent
 changes that might cause problems in the build process, and a guide for
@@ -19,6 +19,10 @@ See also: BUILDING, build.sh, Makefile.
 Recent changes:
 ^^^
 
+20220628:
+	Changes in the build of src/games/robots require a clean build
+	of that program.
+
 2026:
 	Changes in the xorg build require clean obj dirs for external/mit/xorg
 	(or a full clean/non-update build).



CVS commit: src

2022-06-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jun 28 08:03:49 UTC 2022

Modified Files:
src: UPDATING

Log Message:
Note that src/games/robots now nees a clean rebuild.


To generate a diff of this commit:
cvs rdiff -u -r1.327 -r1.328 src/UPDATING

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



CVS commit: src/sys/dev/pci

2022-06-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jun 28 06:24:00 UTC 2022

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

Log Message:
Sprinkle some const. Same code before and after.


To generate a diff of this commit:
cvs rdiff -u -r1.353 -r1.354 src/sys/dev/pci/if_bge.c

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

Modified files:

Index: src/sys/dev/pci/if_bge.c
diff -u src/sys/dev/pci/if_bge.c:1.353 src/sys/dev/pci/if_bge.c:1.354
--- src/sys/dev/pci/if_bge.c:1.353	Thu May 19 04:43:43 2022
+++ src/sys/dev/pci/if_bge.c	Tue Jun 28 06:24:00 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bge.c,v 1.353 2022/05/19 04:43:43 buhrow Exp $	*/
+/*	$NetBSD: if_bge.c,v 1.354 2022/06/28 06:24:00 skrll Exp $	*/
 
 /*
  * Copyright (c) 2001 Wind River Systems
@@ -79,7 +79,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.353 2022/05/19 04:43:43 buhrow Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.354 2022/06/28 06:24:00 skrll Exp $");
 
 #include 
 #include 
@@ -1080,7 +1080,7 @@ bge_read_eeprom(struct bge_softc *sc, vo
 static int
 bge_miibus_readreg(device_t dev, int phy, int reg, uint16_t *val)
 {
-	struct bge_softc *sc = device_private(dev);
+	struct bge_softc * const sc = device_private(dev);
 	uint32_t data;
 	uint32_t autopoll;
 	int rv = 0;
@@ -1134,7 +1134,7 @@ bge_miibus_readreg(device_t dev, int phy
 static int
 bge_miibus_writereg(device_t dev, int phy, int reg, uint16_t val)
 {
-	struct bge_softc *sc = device_private(dev);
+	struct bge_softc * const sc = device_private(dev);
 	uint32_t data, autopoll;
 	int rv = 0;
 	int i;
@@ -1194,7 +1194,7 @@ bge_miibus_writereg(device_t dev, int ph
 static void
 bge_miibus_statchg(struct ifnet *ifp)
 {
-	struct bge_softc *sc = ifp->if_softc;
+	struct bge_softc * const sc = ifp->if_softc;
 	struct mii_data *mii = >bge_mii;
 	uint32_t mac_mode, rx_mode, tx_mode;
 
@@ -1251,7 +1251,7 @@ bge_miibus_statchg(struct ifnet *ifp)
 static void
 bge_set_thresh(struct ifnet *ifp, int lvl)
 {
-	struct bge_softc *sc = ifp->if_softc;
+	struct bge_softc * const sc = ifp->if_softc;
 	int s;
 
 	/* For now, just save the new Rx-intr thresholds and record
@@ -1428,12 +1428,9 @@ static void
 bge_jfree(struct mbuf *m, void *buf, size_t size, void *arg)
 {
 	struct bge_jpool_entry *entry;
-	struct bge_softc *sc;
+	struct bge_softc * const sc = arg;
 	int i, s;
 
-	/* Extract the softc struct pointer. */
-	sc = (struct bge_softc *)arg;
-
 	if (sc == NULL)
 		panic("bge_jfree: can't find softc pointer!");
 
@@ -1722,7 +1719,7 @@ bge_free_tx_ring(struct bge_softc *sc, b
 static int
 bge_init_tx_ring(struct bge_softc *sc)
 {
-	struct ifnet *ifp = >ethercom.ec_if;
+	struct ifnet * const ifp = >ethercom.ec_if;
 	int i;
 	bus_dmamap_t dmamap, dmamap32;
 	bus_size_t maxsegsz;
@@ -1800,8 +1797,8 @@ alloc_done:
 static void
 bge_setmulti(struct bge_softc *sc)
 {
-	struct ethercom		*ec = >ethercom;
-	struct ifnet		*ifp = >ec_if;
+	struct ethercom * const ec = >ethercom;
+	struct ifnet * const ifp = >ec_if;
 	struct ether_multi	*enm;
 	struct ether_multistep	step;
 	uint32_t		hashes[4] = { 0, 0, 0, 0 };
@@ -2310,7 +2307,7 @@ bge_blockinit(struct bge_softc *sc)
 {
 	volatile struct bge_rcb	 *rcb;
 	bus_size_t rcb_addr;
-	struct ifnet *ifp = >ethercom.ec_if;
+	struct ifnet * const ifp = >ethercom.ec_if;
 	bge_hostaddr taddr;
 	uint32_t	dmactl, rdmareg, mimode, val;
 	int		i, limit;
@@ -3177,8 +3174,8 @@ bge_probe(device_t parent, cfdata_t matc
 static void
 bge_attach(device_t parent, device_t self, void *aux)
 {
-	struct bge_softc	*sc = device_private(self);
-	struct pci_attach_args	*pa = aux;
+	struct bge_softc * const sc = device_private(self);
+	struct pci_attach_args * const pa = aux;
 	prop_dictionary_t dict;
 	const struct bge_product *bp;
 	const struct bge_revision *br;
@@ -4031,8 +4028,8 @@ again:
 static int
 bge_detach(device_t self, int flags __unused)
 {
-	struct bge_softc *sc = device_private(self);
-	struct ifnet *ifp = >ethercom.ec_if;
+	struct bge_softc * const sc = device_private(self);
+	struct ifnet * const ifp = >ethercom.ec_if;
 	int s;
 
 	s = splnet();
@@ -4656,13 +4653,11 @@ bge_txeof(struct bge_softc *sc)
 static int
 bge_intr(void *xsc)
 {
-	struct bge_softc *sc;
-	struct ifnet *ifp;
+	struct bge_softc * const sc = xsc;
+	struct ifnet * const ifp = >ethercom.ec_if;
 	uint32_t pcistate, statusword, statustag;
 	uint32_t intrmask = BGE_PCISTATE_INTR_NOT_ACTIVE;
 
-	sc = xsc;
-	ifp = >ethercom.ec_if;
 
 	/* 5717 and newer chips have no BGE_PCISTATE_INTR_NOT_ACTIVE bit */
 	if (BGE_IS_5717_PLUS(sc))
@@ -4775,8 +4770,8 @@ bge_asf_driver_up(struct bge_softc *sc)
 static void
 bge_tick(void *xsc)
 {
-	struct bge_softc *sc = xsc;
-	struct mii_data *mii = >bge_mii;
+	struct bge_softc * const sc = xsc;
+	struct mii_data * const mii = >bge_mii;
 	int s;
 
 	s = splnet();
@@ -4815,7 +4810,7 @@ bge_tick(void *xsc)
 static void
 bge_stats_update_regs(struct bge_softc *sc)
 {
-	struct ifnet *ifp 

CVS commit: src/sys/dev/pci

2022-06-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jun 28 06:24:00 UTC 2022

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

Log Message:
Sprinkle some const. Same code before and after.


To generate a diff of this commit:
cvs rdiff -u -r1.353 -r1.354 src/sys/dev/pci/if_bge.c

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