msun: remove requirement to have C99 inline semantic
The 'extern inline' usage is removed.
PR: 277958
Reviewed by: dim
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D56139
ip_mroute: FIBify
Modify the control plane (ioctl and socket option handlers) to use the
routing socket FIB to index into the mfctable array. Modify the
forwarding plane to use the mbuf's FIB to determine which routing table
to use.
MFC after: 2 weeks
Sponsored by: Stormshield
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D55241
ip6_mroute: Handle interface detach events
When an interface goes away we need to make sure the v6 multicast
routing tables don't carry any dangling references to the ifnet. The v4
code handles this already. Copy the approach there and use an
eventhandler to purge the corresponding MIF, if one exists, and further
go through all routes in the FIB and remove references to the interface.
MFC after: 2 weeks
Sponsored by: Stormshield
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D55246
ip(6)_mroute: Grow the routing tables when the number of FIBs changes
Use the new rtnumfibs_change event to expand the mfctable array when the
number of FIBs increases.
MFC after: 2 weeks
Sponsored by: Stormshield
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D55240
tests: Add some simple regression tests for ip_mroute
These use atf_python to create a number of hosts linked to a router.
The router runs pimd (for IPv4) or ip6_mrouter (simplistic IPv6
multicast router that I wrote since I couldn't find one in the ports
tree). The vnet_host*_handler() methods are invoked in different VNET
jails connected to the router; they register the connected epair with a
multicast group and verify that they can send messages to each other.
The tests are synchronized by sending messages over a unix domain
socket. The flow is something like:
1) test startup_method() is called, the unix socket is created,
2) the superclass creates jails and links them together using the
declared topology,
3) we wait for all child jails to start up and send a message on the
unix socket indicating that they are ready
4) we start the routing daemon in the main jail,
5) the test actually starts; starttest() kicks off the
vnet_host*_handlers(), which mostly just verify that they can send
[11 lines not shown]
ip6_mroute: Pass the multicast interface number directly to del_m6if()
There's no need to pass a pointer to the interface number. No
functional change intended.
MFC after: 2 weeks
Sponsored by: Stormshield
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D55245
ip6_mroute: FIBify
Modify the control plane (ioctl and socket option handlers) to use the
routing socket FIB to index into the mfctable array. Modify the
forwarding plane to use the mbuf's FIB to determine which routing table
to use.
MFC after: 2 weeks
Sponsored by: Stormshield
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D55242
ip6_mroute: Start putting global variables into a structure
As in the IPv4 version of this change, I added a struct mf6ctable
structure which holds all global routing table state, soon to become
per-FIB state.
Note that much of the v6 multicast routing code was not VNETified; this
change fixes that too.
MFC after: 2 weeks
Sponsored by: Stormshield
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D55238
net/route: Add an eventhandler for rt_numfibs changes
The multicast routing code will start implementing per-FIB routing
tables. As a part of this, it needs to be notified when the number of
FIBs changes, so that it can expand its tables.
Add an eventhandler for this purpose.
MFC after: 2 weeks
Sponsored by: Stormshield
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D55239
ip_mroute: Start moving globals into a structure
I would like to support per-FIB multicast routing tables, such that one
can run a routing daemon per-FIB, with each daemon oblivious to the
existence of others. Currently the multicast routing code is completely
unaware of FIBs.
To that end, start collecting various global variables in ip_mroute.c
into a per-VNET struct mfctable. In a future patch this will be
expanded into an array of mfctable structures, one per FIB. For now,
all of the state is collected into V_mfctables[0].
Each mfctable contains, among other things:
- a pointer to the routing socket, if routing is enabled,
- a hash table of routing cache entries,
- an table of network interfaces participating in the routing
configuration
This change has no functional effect, it is just factoring out these
[6 lines not shown]
ifnet: Fix races in if_vmove_reclaim()
The thread running if_vmove_reclaim() may race with other threads those
running if_detach(), if_vmove_loan() or if_vmove_reclaim(). In case the
current thread loses race, two issues arise,
1. It is unstable and unsafe to access ifp->if_vnet,
2. The interface is removed from "active" list, hence if_unlink_ifnet()
can fail.
For the first case, check against source prison's vnet instead, given
the interface is obtained from that vnet.
For the second one, return ENODEV to indicate the interface was on the
list but the current thread loses race, to distinguish from ENXIO, which
means the interface or child prison is not found. This is the same with
if_vmove_loan().
Reviewed by: kp, pouria
[3 lines not shown]
pfctl: parser must not ignore error from pfctl_optimize_ruleset()
Ignoring the error may cause pfctl(8) to load inconsistent ruleset
preventing pf(4) to enforce desired policy.
Issue reported and fix suggested by berts _from_ fastmail _dot_ com
'Looks good.' @deraadt
MFC after: 1 week
Obtained from: OpenBSD, sashan <sashan at openbsd.org>, 9fd28a8cca
Sponsored by: Rubicon Communications, LLC ("Netgate")
(cherry picked from commit 343ace42f82a629374af4dc3a72da5f46f2c3feb)
pfctl: parser must not ignore error from pfctl_optimize_ruleset()
Ignoring the error may cause pfctl(8) to load inconsistent ruleset
preventing pf(4) to enforce desired policy.
Issue reported and fix suggested by berts _from_ fastmail _dot_ com
'Looks good.' @deraadt
MFC after: 1 week
Obtained from: OpenBSD, sashan <sashan at openbsd.org>, 9fd28a8cca
Sponsored by: Rubicon Communications, LLC ("Netgate")
(cherry picked from commit 343ace42f82a629374af4dc3a72da5f46f2c3feb)
snd_uaudio: Retire sndcard_func usage
This is effectively a no-op, as it does not make use of the
sndcard_func->varinfo field, so eventually ua_probe() always succeeds.
Also change ua_probe()'s value to 0. There is no need to return
BUS_PROBE_DEFAULT, because snd_uaudio() attaches the sound(4)'s children
with bus_attach_children().
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D56160
pkgbase: Move all of ATF into the atf package
Parts of ATF (including the licence and some of the documentation) were
for some reason part of the tests package instead of the atf package.
Moving them to where they logically belong poses no problem since tests
already depends on atf.
PR: 294129
MFC after: 1 week
Reviewed by: ivy
Differential Revision: https://reviews.freebsd.org/D56158
pkgbase: Move all of Kyua into the kyua package
Some Kyua directories were improperly tagged as belonging to the tests
package. Move them to the kyua package, which contains all of the
files found in these directories.
PR: 294129
MFC after: 1 week
Reviewed by: ivy, emaste
Differential Revision: https://reviews.freebsd.org/D56159
acpi_apm: Narrow scope of ACPI_LOCK
This lock doesn't need to be held across seldrain/knlist_destroy. It
is also redundant (and a bug) to hold it across knlist_add and
knlist_remove since it is the mutex for the knlist.
PR: 293901
Reported by: Jiaming Zhang <r772577952 at gmail.com>
Reviewed by: markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D55994