Thread (8 messages) flat view 8 messages, 3 authors, 1d ago
WARM1d

[PATCH net 1/2] selftests: netfilter: use KHDR_INCLUDES in CFLAGS

From: "Matthieu Baerts (NGI0)" <matttbe@kernel.org>
Date: 2026-09-04 16:13:20
Also in: linux-kselftest, lkml, netfilter-devel
Subsystem: kernel selftest framework, netfilter, networking [general], the rest · Maintainers: Shuah Khan, Shuah Khan, Pablo Neira Ayuso, Florian Westphal, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

KHDR_INCLUDES is typically used to include headers from the kernel
source directory instead of only relying on the ones from the host: they
can be missing or outdated.

The kselftest doc recommends assigning KHDR_INCLUDES to CFLAGS in a
target Makefile. lib.mk will set KHDR_INCLUDES to "-isystem
$(top_srcdir)/usr/include" if the user didn't set it, e.g. if the kernel
was built in a different build directory.

Other net targets have KHDR_INCLUDES added to their CFLAGS.

Fixes: 3f189349e52a ("selftests: netfilter: move to net subdir")
Link: https://docs.kernel.org/dev-tools/kselftest.html#contributing-new-tests-details
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
 tools/testing/selftests/net/netfilter/Makefile | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/tools/testing/selftests/net/netfilter/Makefile b/tools/testing/selftests/net/netfilter/Makefile
index f88dd4ef8d26..df3c20c90f5d 100644
--- a/tools/testing/selftests/net/netfilter/Makefile
+++ b/tools/testing/selftests/net/netfilter/Makefile
@@ -2,6 +2,8 @@
 
 top_srcdir = ../../../../..
 
+CFLAGS += $(KHDR_INCLUDES)
+
 HOSTPKG_CONFIG := pkg-config
 MNL_CFLAGS := $(shell $(HOSTPKG_CONFIG) --cflags libmnl 2>/dev/null)
 MNL_LDLIBS := $(shell $(HOSTPKG_CONFIG) --libs libmnl 2>/dev/null || echo -lmnl)
-- 
2.55.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help