Skip to content

Commit bc8712f

Browse files
ameryhungMartin KaFai Lau
authored andcommitted
bpf: Emit struct bpf_xdp_sock type in vmlinux BTF
Similar to other BPF UAPI struct, force emit BTF of struct bpf_xdp_sock so that it is defined in vmlinux.h. In a later patch, a selftest will use vmlinux.h to get the definition of struct bpf_xdp_sock instead of bpf.h. Signed-off-by: Amery Hung <[email protected]> Signed-off-by: Martin KaFai Lau <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent 5730dac commit bc8712f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

net/core/filter.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7439,6 +7439,8 @@ u32 bpf_xdp_sock_convert_ctx_access(enum bpf_access_type type,
74397439
offsetof(struct xdp_sock, FIELD)); \
74407440
} while (0)
74417441

7442+
BTF_TYPE_EMIT(struct bpf_xdp_sock);
7443+
74427444
switch (si->off) {
74437445
case offsetof(struct bpf_xdp_sock, queue_id):
74447446
BPF_XDP_SOCK_GET(queue_id);

0 commit comments

Comments
 (0)