mirror of
https://github.com/netdata/libbpf.git
synced 2026-04-05 08:09:07 +08:00
libbpf: Change bpf_object_skeleton data field to const pointer
This change was necessary to enforce the implied contract that bpf_object_skeleton->data should not be mutated. The data will be cast to `void *` during assignment to handle the case where a user is compiling with older libbpf headers to avoid a compiler warning of `const void *` data being cast to `void *` Signed-off-by: Matt Smith <alastorze@fb.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20210901194439.3853238-2-alastorze@fb.com
This commit is contained in:
committed by
Andrii Nakryiko
parent
50e13993a1
commit
860b201cd0
@@ -854,7 +854,7 @@ struct bpf_object_skeleton {
|
|||||||
size_t sz; /* size of this struct, for forward/backward compatibility */
|
size_t sz; /* size of this struct, for forward/backward compatibility */
|
||||||
|
|
||||||
const char *name;
|
const char *name;
|
||||||
void *data;
|
const void *data;
|
||||||
size_t data_sz;
|
size_t data_sz;
|
||||||
|
|
||||||
struct bpf_object **obj;
|
struct bpf_object **obj;
|
||||||
|
|||||||
Reference in New Issue
Block a user