Skip to content
Snippets Groups Projects
Commit 68bf7864 authored by Michael Bestas's avatar Michael Bestas Committed by Mohammad Hasan Keramat J
Browse files

netbpfload: Support <4.14 kernels

Change-Id: I3d6573c102c1d64a64209bf61ecb8ed0c4ecb64c
parent 8a4323c7
No related branches found
No related tags found
No related merge requests found
......@@ -225,12 +225,14 @@ int main(int argc, char** argv, char * const envp[]) {
// kernel does not have CONFIG_BPF_JIT=y)
// BPF_JIT is required by R VINTF (which means 4.14/4.19/5.4 kernels),
// but 4.14/4.19 were released with P & Q, and only 5.4 is new in R+.
if (writeProcSysFile("/proc/sys/net/core/bpf_jit_enable", "1\n")) return 1;
if (writeProcSysFile("/proc/sys/net/core/bpf_jit_enable", "1\n") &&
android::bpf::isAtLeastKernelVersion(4, 14, 0)) return 1;
// Enable JIT kallsyms export for privileged users only
// (Note: this (open) will fail with ENOENT 'No such file or directory' if
// kernel does not have CONFIG_HAVE_EBPF_JIT=y)
if (writeProcSysFile("/proc/sys/net/core/bpf_jit_kallsyms", "1\n")) return 1;
if (writeProcSysFile("/proc/sys/net/core/bpf_jit_kallsyms", "1\n") &&
android::bpf::isAtLeastKernelVersion(4, 14, 0)) return 1;
}
// Create all the pin subdirectories
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment