[Bug 286204] emulators/virtualbox-ose-kmod: error when building 15-Currrent post 93b4a5445658

From: <bugzilla-noreply_at_freebsd.org>
Date: Sat, 19 Apr 2025 13:52:25 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=286204

            Bug ID: 286204
           Summary: emulators/virtualbox-ose-kmod: error when building
                    15-Currrent post 93b4a5445658
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: vbox@FreeBSD.org
          Reporter: Benjamin.Close@clearchain.com
             Flags: maintainer-feedback?(vbox@FreeBSD.org)
          Assignee: vbox@FreeBSD.org

Env: 15.0-CURRENT FreeBSD 15.0-CURRENT #1
drm-related-linuxkpi-changes-n276426-95656f357432

Commit:
https://github.com/freebsd/freebsd-src/commit/93b4a54456589e78dcd37f2db8333baff3f3f0b2

Changed the meaning of NG_ABI_VERSION if the INVARIANTS kernel option was
enabled for netgraph and the ng_ether kernel module.

Hence what previously was:

>NG_ABI_VERSION = ( 12 + 0x10000 )

Now is:

>NG_ABI_VERSION = ( 0x10000 + 0x20000 + 12 )


The virtualbox-ose-*kmod ports don't correctly set invariants if the kernel is
compiled with it and hence the vboxnetflt.ko module fails to load with:

>KLD vboxnetflt.ko: depends on netgraph - not available or version mismatch    
>linker_load_file: /boot/modules/vboxnetflt.ko - unsupported file type   

The dirty hack I used was to make sure invariants is defined in:

>work/VirtualBox-*/src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c

Before the netgraph.h file is included. Ie:


>#define INVARIANTS 1
>#include <netgraph/netgraph.h>

This allows the module to load and virtualbox runs as expected.

A correct fix checking if invariants are defined in the running kernel probably
should be used instead.

-- 
You are receiving this mail because:
You are the assignee for the bug.