d2d4e127 imp Aug. 11, 2022, 4:27 p.m.
Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D35974
cgit
c32dde31 imp Aug. 11, 2022, 4:27 p.m.
We do a number of games with ploymorphism for different types struct
*devdesc. Adjust one place that this affects to take the address of the
base class (most others have void * at the moment). This is more type
safe than a bare void *.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D35914
cgit
f197c0bf imp Aug. 11, 2022, 4:27 p.m.
Rather than have the magic, hand-crafted fields that have to align with
fields in other structures at the end of i386_devdesc, make it into
anonymous union and adjust the code accordingly. This is safer and
similar to what CAM does.

Sponsored by:		Netflix
Reviewed by:		kevans, tsoome (prior version)
Differential Revision:	https://reviews.freebsd.org/D35965
cgit
bec11d96 imp Aug. 11, 2022, 4:27 p.m.
stdbool.h is implied by stand.h, so remove it.

Sponsored by:		Netflix
cgit
e0b40500 glebius Aug. 11, 2022, 4:19 p.m.
While here remove some code that was compat legacy back in 2005, added
in a1f7e5f8ee7fe.

Reviewed by:		melifaro
Differential revision:	https://reviews.freebsd.org/D36128
cgit
3d2041c0 glebius Aug. 11, 2022, 4:19 p.m.
While here, address the unlocked 'dst' read.  Solve that by storing
a pointer either to the inpcb or to the sockaddr.  If we end up
copying address out of the inpcb, that would be done under the read
lock section.

Reviewed by:		melifaro
Differential revision:	https://reviews.freebsd.org/D36127
cgit
8c77967e glebius Aug. 11, 2022, 4:19 p.m.
The only place to execute this method was raw_usend(). Only those
protocols that used raw socket were able to actually enter that method.
All pr_output assignments being deleted by this commit were a dead code
for many years.

Reviewed by:		melifaro
Differential revision:	https://reviews.freebsd.org/D36126
cgit
f63cb32c glebius Aug. 11, 2022, 4:19 p.m.
Until today the remnants of the original code had provided some aid
in implementation of routing socket and IPSEC key socket.  There were
more obfuscation rather than generalisation with this aid.

A historical reference on the original idea of the raw sockets can
be found in chapter 11 of 4.4BSD System Manager Manual:

https://raw.githubusercontent.com/sergev/4.4BSD-Lite2/master/usr/share/doc/smm/18.net.pdf

Reviewed by:		melifaro
Differential revision:	https://reviews.freebsd.org/D36124
cgit
ea7be129 glebius Aug. 11, 2022, 4:19 p.m.
This makes key socket implementation self contained and removes one
of the last dependencies on the raw socket code and pr_output method.

There are very subtle API visible changes:
- now key socket would return EOPNOTSUPP instead of EINVAL on
  syscalls that are not supposed to be called on a key socket.
- key socket buffer sizes are now controlled by net.key sysctls instead
  of net.raw.  The latter were not documented anywhere, and even Internet
  search doesn't find any references or discussions related to them.

Reviewed by:		melifaro
Differential revision:	https://reviews.freebsd.org/D36123
cgit
36b10ac2 glebius Aug. 11, 2022, 4:19 p.m.
This makes routing socket implementation self contained and removes one
of the last dependencies on the raw socket code and pr_output method.

There are very subtle API visible changes:
- now routing socket would return EOPNOTSUPP instead of EINVAL on
  syscalls that are not supposed to be called on a routing socket.
- routing socket buffer sizes are now controlled by net.rtsock
  sysctls instead of net.raw.  The latter were not documented
  anywhere, and even Internet search doesn't find any references
  or discussions related to these sysctls.

Reviewed by:		melifaro
Differential revision:	https://reviews.freebsd.org/D36122
cgit
d94ec749 glebius Aug. 11, 2022, 4:19 p.m.
Use local storage of the mbuf packet header instead.

Reviewed by:		melifaro
Differential revision:	https://reviews.freebsd.org/D36121
cgit
b8103ca7 glebius Aug. 11, 2022, 4:19 p.m.
The old mechanism of getting them via domains/protocols control input
is a relict from the previous century, when nothing like EVENTHANDLER(9)
existed yet.  Retire PRC_IFDOWN/PRC_IFUP as netinet was the only one
to use them.

Reviewed by:		melifaro
Differential revision:	https://reviews.freebsd.org/D36116
cgit
78d7704b markj Aug. 11, 2022, 2:18 p.m.
Check the canmount property before building the mountpoint string.

Reported by:	Coverity
Fixes:		240afd8c1fcc ("makefs: Add ZFS support")
Sponsored by:	The FreeBSD Foundation
cgit
e2259837 markj Aug. 11, 2022, 2:18 p.m.
nvstring_get() returns a copy of the string, not a pointer into the
nvlist's internal buffer.

Reported by:	Coverity
Fixes:		240afd8c1fcc ("makefs: Add ZFS support")
Sponsored by:	The FreeBSD Foundation
cgit
69077c81 mjg Aug. 11, 2022, 2:12 p.m.
Sponsored by:	Rubicon Communications, LLC ("Netgate")
cgit