]> git.99rst.org Git - openwrt-packages.git/commit
batman-adv: fix build against kernels backporting kmalloc_obj
authorJosef Schlehofer <redacted>
Thu, 6 Aug 2026 12:43:25 +0000 (14:43 +0200)
committerJosef Schlehofer <redacted>
Tue, 18 Aug 2026 08:04:02 +0000 (10:04 +0200)
commit53bafc09a375230009552845a86005148b57c73c
treee31d69ff78a1ebbe0f416c02e1bb68aebd3ba243
parentfe1e65bed7e3fd7e9b892724a1f039ade9ce4eb8
batman-adv: fix build against kernels backporting kmalloc_obj

The compat definitions of kzalloc_obj(), kmalloc_obj() and
kmalloc_objs() were guarded by a version range which carves out only
specific stable backports. These helpers are backported on demand to
stable kernel branches, so on a newer stable kernel they collide
with the definitions in include/linux/slab.h and the module fails to
build:

    compat-hacks.h:52:9: error: "kzalloc_obj" redefined [-Werror]
    ./include/linux/slab.h:963:9: note: this is the location of the
    previous definition

CI showed this on exactly the four targets sitting on
KERNEL_PATCHVER 6.12 - mips_24kc, powerpc_8548, arm_cortex-a15 and
arm_cortex-a9 - while the six 6.18 targets passed.

Guard each definition on the macro name instead, so the compat code
steps aside whenever the kernel provides the helper, without having
to track which point release of which stable series picked up the
backport.

This mirrors what batman-adv carries in compat-include/linux/slab.h.
That file is not used by this package, which force-includes its own
compat-hacks.h instead, so the same fix has to be applied here as
well. slab.h is included explicitly, because unlike the upstream
file this header does not otherwise pull it in.

Upstream-Status: Backport [96a26bababe5e9c9b9f9226e7cdbe60f49f57b71]

Signed-off-by: Josef Schlehofer <redacted>
Co-authored-by: Claude Fable 5 <redacted>
net/batman-adv/src/compat-hacks.h
git clone https://git.99rst.org/PROJECT