Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions elf/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,13 @@ int bpf_prog_detach(int prog_fd, int target_fd, enum bpf_attach_type type)

int bpf_attach_socket(int sock, int fd)
{
const SO_ATTACH_BPF = 50;
return setsockopt(sock, SOL_SOCKET, SO_ATTACH_BPF, &fd, sizeof(fd));
}

int bpf_detach_socket(int sock, int fd)
{
const SO_DETACH_BPF = 27;
return setsockopt(sock, SOL_SOCKET, SO_DETACH_BPF, &fd, sizeof(fd));
}

Expand Down