OSDN Git Service

libbpf: Add bpf object kern_version attribute setter
authorRafael David Tinoco <rafaeldtinoco@ubuntu.com>
Tue, 23 Mar 2021 04:09:52 +0000 (01:09 -0300)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 26 Mar 2021 02:23:27 +0000 (19:23 -0700)
commit155f556d64b1a48710f01305e14bb860734ed1e3
tree6a719b790128b4142547560041bfc912cc7fe8c4
parent3ac3f314c325d76deefa34925e11ad52df77cdc3
libbpf: Add bpf object kern_version attribute setter

Unfortunately some distros don't have their kernel version defined
accurately in <linux/version.h> due to different long term support
reasons.

It is important to have a way to override the bpf kern_version
attribute during runtime: some old kernels might still check for
kern_version attribute during bpf_prog_load().

Signed-off-by: Rafael David Tinoco <rafaeldtinoco@ubuntu.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Link: https://lore.kernel.org/bpf/20210323040952.2118241-1-rafaeldtinoco@ubuntu.com
tools/lib/bpf/libbpf.c
tools/lib/bpf/libbpf.h
tools/lib/bpf/libbpf.map