From 9a5d20a88afb5dbb27bbe9003216f06fbdfd1e38 Mon Sep 17 00:00:00 2001 From: "Matthieu Baerts (NGI0)" Date: Fri, 4 Sep 2026 18:13:02 +0200 Subject: [PATCH 1/2] selftests: netfilter: use KHDR_INCLUDES in CFLAGS 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. Link: https://docs.kernel.org/dev-tools/kselftest.html#contributing-new-tests-details Signed-off-by: Matthieu Baerts (NGI0) Reviewed-by: Ilya Maximets Link: https://patch.msgid.link/20260904-net-sft-nf-khdr_includes-v1-1-92455af428e9@kernel.org Signed-off-by: Jakub Kicinski --- 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) From f1f4394a8bb466f05acd143057fbe2c5f6ed67a4 Mon Sep 17 00:00:00 2001 From: "Matthieu Baerts (NGI0)" Date: Fri, 4 Sep 2026 18:13:03 +0200 Subject: [PATCH 2/2] selftests: forwarding: use KHDR_INCLUDES in CFLAGS 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. Link: https://docs.kernel.org/dev-tools/kselftest.html#contributing-new-tests-details Signed-off-by: Matthieu Baerts (NGI0) Reviewed-by: Ilya Maximets Link: https://patch.msgid.link/20260904-net-sft-nf-khdr_includes-v1-2-92455af428e9@kernel.org Signed-off-by: Jakub Kicinski --- tools/testing/selftests/net/forwarding/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/testing/selftests/net/forwarding/Makefile b/tools/testing/selftests/net/forwarding/Makefile index bbaf4d937dd8..1bdfd141c0fb 100644 --- a/tools/testing/selftests/net/forwarding/Makefile +++ b/tools/testing/selftests/net/forwarding/Makefile @@ -1,5 +1,7 @@ # SPDX-License-Identifier: GPL-2.0+ OR MIT +CFLAGS += $(KHDR_INCLUDES) + TEST_PROGS := \ bridge_activity_notify.sh \ bridge_fdb_learning_limit.sh \