From b7028cb44b8048391bbf444b9cdf7dc5dfbcffba Mon Sep 17 00:00:00 2001 From: Patrick Rohr Date: Mon, 28 Oct 2024 15:49:11 -0700 Subject: [PATCH] Add bpf_sk_fullsock helper This helper is available on 5.1+ kernels and required to read certain fields (like the mark) from skb->sk. Test: TH Change-Id: I96087c9974262594fdcb4119cbdbd1b39c26a5d4 --- bpf/headers/include/bpf_helpers.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bpf/headers/include/bpf_helpers.h b/bpf/headers/include/bpf_helpers.h index ac5ffda7d6..b994a9f28f 100644 --- a/bpf/headers/include/bpf_helpers.h +++ b/bpf/headers/include/bpf_helpers.h @@ -403,6 +403,8 @@ static unsigned long long (*bpf_get_current_uid_gid)(void) = (void*) BPF_FUNC_ge static unsigned long long (*bpf_get_smp_processor_id)(void) = (void*) BPF_FUNC_get_smp_processor_id; static long (*bpf_get_stackid)(void* ctx, void* map, uint64_t flags) = (void*) BPF_FUNC_get_stackid; static long (*bpf_get_current_comm)(void* buf, uint32_t buf_size) = (void*) BPF_FUNC_get_current_comm; +// bpf_sk_fullsock requires 5.1+ kernel +static struct bpf_sock* (*bpf_sk_fullsock)(struct bpf_sock* sk) = (void*) BPF_FUNC_sk_fullsock; // GPL only: static int (*bpf_trace_printk)(const char* fmt, int fmt_size, ...) = (void*) BPF_FUNC_trace_printk;