aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools
diff options
context:
space:
mode:
authorMartin KaFai Lau <kafai@fb.com>2019-11-07 10:09:03 -0800
committerAlexei Starovoitov <ast@kernel.org>2019-11-07 10:59:08 -0800
commit7e3617a72df32341fea6d226cd6bb21de40c558d (patch)
treeda83dde50a5e7873bd6689b70ff8539973841714 /tools
parentMerge branch 'bpf-libbpf-fixes' (diff)
downloadwireguard-linux-7e3617a72df32341fea6d226cd6bb21de40c558d.tar.xz
wireguard-linux-7e3617a72df32341fea6d226cd6bb21de40c558d.zip
bpf: Add array support to btf_struct_access
This patch adds array support to btf_struct_access(). It supports array of int, array of struct and multidimensional array. It also allows using u8[] as a scratch space. For example, it allows access the "char cb[48]" with size larger than the array's element "char". Another potential use case is "u64 icsk_ca_priv[]" in the tcp congestion control. btf_resolve_size() is added to resolve the size of any type. It will follow the modifier if there is any. Please see the function comment for details. This patch also adds the "off < moff" check at the beginning of the for loop. It is to reject cases when "off" is pointing to a "hole" in a struct. Signed-off-by: Martin KaFai Lau <kafai@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20191107180903.4097702-1-kafai@fb.com
Diffstat (limited to 'tools')
0 files changed, 0 insertions, 0 deletions