commit | d9d75bce6a748195bd39d983bcd61699f24579b6 | [log] [tgz] |
---|---|---|
author | Treehugger Robot <treehugger-gerrit@google.com> | Thu Jun 23 20:35:14 2022 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Thu Jun 23 20:35:14 2022 +0000 |
tree | 32b3fb29ed498730cd000f99a903f2c404b934fe | |
parent | f231b878e239b252341e701f61a4f9e5ccdb5b19 [diff] | |
parent | 0e2fe7c95de3ee2162efc576234d50f0f7340ab2 [diff] |
Merge "add more comments about bpfGetFd... and kernel version compatibility" am: 5575f0e251 am: 4862797c0f Original change: https://android-review.googlesource.com/c/platform/frameworks/libs/net/+/2132575 Change-Id: I97c1a3a391419235694f052f86b45f247ceab261 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/staticlibs/native/bpf_syscall_wrappers/include/BpfSyscallWrappers.h b/staticlibs/native/bpf_syscall_wrappers/include/BpfSyscallWrappers.h index 4b29c44..d5b7670 100644 --- a/staticlibs/native/bpf_syscall_wrappers/include/BpfSyscallWrappers.h +++ b/staticlibs/native/bpf_syscall_wrappers/include/BpfSyscallWrappers.h
@@ -150,8 +150,12 @@ }); } -// requires 4.14+ kernel - +// BPF_OBJ_GET_INFO_BY_FD requires 4.14+ kernel +// +// Note: some fields are only defined in newer kernels (ie. the map_info struct grows +// over time), so we need to check that the field we're interested in is actually +// supported/returned by the running kernel. We do this by checking it is fully +// within the bounds of the struct size as reported by the kernel. #define DEFINE_BPF_GET_FD_INFO(NAME, FIELD) \ inline int bpfGetFd ## NAME(const BPF_FD_TYPE map_fd) { \ struct bpf_map_info map_info = {}; \