aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2025-01-17 04:29:40 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2025-01-17 04:32:53 +0000
commit38d947b53cbca845926bdd91272ce1c65ba59ecb (patch)
treecfe0f11c572672077ceaa58774d43dbc840d763b
parent13d81ef632ec6ca5e6936ab77e8ac67a8c430033 (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.c5
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)