bpf: Fix double inclusions

Don't include <linux/bpf.h> if using vmlinux; as this causes
double inclusions.

Bug: 419635765
Test: manual; build and load a CO-RE BPF program
Change-Id: I4419778ea71b65ce46ac5e0e6358c33d7f78b82e
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
This commit is contained in:
Kalesh Singh 2025-05-22 17:52:33 -07:00
commit 0227ca2982

View file

@ -7,6 +7,7 @@
// When using vmlinux.h, you can't use any system level headers.
#include <vmlinux.h>
#else
#include <linux/bpf.h>
#include <linux/types.h>
#endif // USE_VMLINUX
#include <bpf/bpf_helpers.h>
@ -17,7 +18,6 @@
#undef __always_inline
#define __always_inline __attribute__((__always_inline__))
#include <linux/bpf.h>
#include <sys/cdefs.h>
#define DEFINE_BPF_MAP_BASE(the_map, TYPE, KeyType, ValueType, num_entries, gid) \