Checking kernel version is not the most reliable way of determining whether a given BPF feature is present in the kernel. Many distributions backport BPF features to older kernel versions.
Kernel provides the enum bpf_func_id which contains BPF_FUNC_* variants. In combination with bpf_core_enum_value_exists, it can be used to determine whether the given function is supported by the running kernel.
Checking kernel version is not the most reliable way of determining whether a given BPF feature is present in the kernel. Many distributions backport BPF features to older kernel versions.
Kernel provides the
enum bpf_func_id
which containsBPF_FUNC_*
variants. In combination withbpf_core_enum_value_exists
, it can be used to determine whether the given function is supported by the running kernel.Fixes: #261