Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to Attach a BPF_PROG_TYPE_SK_MSG #330

Open
fengzx33 opened this issue May 26, 2023 · 3 comments
Open

How to Attach a BPF_PROG_TYPE_SK_MSG #330

fengzx33 opened this issue May 26, 2023 · 3 comments

Comments

@fengzx33
Copy link

No description provided.

@geyslan
Copy link
Member

geyslan commented May 26, 2023

@fengzx33 I suppose you can get information about BPF_PROG_TYPE_SK_MSG from the kernel Documentation/bpf/map_sockmap.rst and through the use of its helpers in tools/testing/selftests/bpf/progs/test_sockmap_kern.h.

@rafaeldtinoco we currently don't support bpf_msg_push_data and bpf_msg_pull_data, right?

@fengzx33
Copy link
Author

@geyslan Thank you, but what I would like to know is how to successfully attach to a SEC like SEC("sk_msg") using libbpfgo. I am looking for a function similar to AttachCgroup(cgroupV2DirPath string) or the steps required for attaching to such SEC("sk_msg") using libbpfgo.

@fengzx33
Copy link
Author

fengzx33 commented Jun 7, 2023

@geyslan @rafaeldtinoco I found that libbpfgo haven't an api, which can attach SEC("sk_msg") , what should i do? thanks

example: https://github.com/dafu-wu/istio-tcpip-bypass/blob/796d738babee7da77815ad2819a69d37d8472dea/bpf/bpf_redir.c#L9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants