]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Change bpf_object_skeleton data field to const pointer
authorMatt Smith <alastorze@fb.com>
Wed, 1 Sep 2021 19:44:37 +0000 (12:44 -0700)
committerAndrii Nakryiko <andrii@kernel.org>
Wed, 8 Sep 2021 00:33:49 +0000 (17:33 -0700)
commitf59bd10681da9be61c5965c4ff380b5ddd207473
tree06f550bd14bb1f2f97cb7b532616429bb79abf0c
parent217f0242099a6d0e9d96fb1c0972f5f84ebbcfa1
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
tools/lib/bpf/libbpf.h