I want to build a application which supports eBPF
on CentOS 7
(the kernel version is 3.10.0
):
if(setsockopt(sock, SOL_SOCKET, SO_ATTACH_BPF, prog_fd, sizeof(prog_f)) {
......
}
So I download a 4.0.5
version, make the following configurations on:
CONFIG_BPF=y
CONFIG_BPF_SYSCALL=y
Then follow this link to build and install a 4.0.5
kernel.
After executing make modules_install install
, I find there is still no SO_ATTACH_BPF
in <asm-generic/socket.h>
, so the above code can't be compiled successfully.
How to build Linux kernel to support SO_ATTACH_BPF
socket option?