diff options
author | Gleb Smirnoff <glebius@FreeBSD.org> | 2025-01-17 04:29:40 +0000 |
---|---|---|
committer | Gleb Smirnoff <glebius@FreeBSD.org> | 2025-01-17 04:32:53 +0000 |
commit | 38d947b53cbca845926bdd91272ce1c65ba59ecb (patch) | |
tree | cfe0f11c572672077ceaa58774d43dbc840d763b | |
parent | 13d81ef632ec6ca5e6936ab77e8ac67a8c430033 (diff) |
netisr: fix compilation without VIMAGE
- Don't use bare vnet(4) definitions in the KASSERT, they aren't available
on a kernel without VIMAGE. Just through MPASS() here. This is more of
documenting assertion rather than an assertion that may actually fire on
an unmodified kernel.
- V_netisr_enable is different to the rest of V_ prefixed globals. On a
kernel without VIMAGE it basically doesn't exist, instead of being
present as a single instance.
Fixes: a1be7978f1879313c141882a1e0812b468dead57
-rw-r--r-- | sys/net/netisr.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/net/netisr.c b/sys/net/netisr.c index e9b8fa4d833c..7b4368276c58 100644 --- a/sys/net/netisr.c +++ b/sys/net/netisr.c @@ -396,8 +396,7 @@ netisr_register(const struct netisr_handler *nhp) * Test that the requested registration is valid. */ CURVNET_ASSERT_SET(); - KASSERT(IS_DEFAULT_VNET(curvnet), ("%s: curvnet %p is not vnet0 %p", - __func__, curvnet, vnet0)); + MPASS(IS_DEFAULT_VNET(curvnet)); KASSERT(nhp->nh_name != NULL, ("%s: nh_name NULL for %u", __func__, proto)); KASSERT(nhp->nh_handler != NULL, @@ -457,8 +456,8 @@ netisr_register(const struct netisr_handler *nhp) npwp->nw_qlimit = netisr_proto[proto].np_qlimit; } - V_netisr_enable[proto] = 1; #ifdef VIMAGE + V_netisr_enable[proto] = 1; VNET_LIST_RLOCK_NOSLEEP(); VNET_FOREACH(vnet_iter) { if (vnet_iter == curvnet) |