diff --git a/netd/BpfHandler.cpp b/netd/BpfHandler.cpp index 7950ff7596..2b773c9346 100644 --- a/netd/BpfHandler.cpp +++ b/netd/BpfHandler.cpp @@ -93,7 +93,7 @@ static Status initPrograms(const char* cg2_path) { // cgroup if the program is pinned properly. // TODO: delete the if statement once all devices should support cgroup // socket filter (ie. the minimum kernel version required is 4.14). - if (!access(CGROUP_SOCKET_PROG_PATH, F_OK)) { + if (bpf::isAtLeastKernelVersion(4, 14, 0)) { RETURN_IF_NOT_OK( attachProgramToCgroup(CGROUP_SOCKET_PROG_PATH, cg_fd, BPF_CGROUP_INET_SOCK_CREATE)); }