]> granicus.if.org Git - strace/commit
bpf: implement decoding of prog_name and prog_ifindex fields
authorEugene Syromyatnikov <evgsyr@gmail.com>
Thu, 22 Feb 2018 02:22:48 +0000 (03:22 +0100)
committerDmitry V. Levin <ldv@altlinux.org>
Sun, 8 Apr 2018 22:01:12 +0000 (22:01 +0000)
commitcbaa5db24d5c13595de311680f1277d06db10158
tree0ea256c53bb8152f5f11aa65ef8d36c2e9d6319a
parenta3509bac24a01d0d46c142821b520f2e63e96163
bpf: implement decoding of prog_name and prog_ifindex fields

* bpf.c (BEGIN_BPF_CMD_DECODER(BPF_PROG_LOAD)): Add support for decoding
of prog_name (introduced in Linux commit v4.15-rc1~84^2~605^2~4) and
prog_ifindex (introduced as prog_target_ifindex in v4.15-rc1~84^2~127^2~13,
renamed in v4.15-rc1~15^2~5^2~3^2~7).
* bpf_attr.h [!BPF_OBJ_NAME_LEN] (BPF_OBJ_NAME_LEN): New macro constant.
[BPF_OBJ_NAME_LEN]: Check that BPF_OBJ_NAME_LEN is equal to 16.
(struct BPF_PROG_LOAD_struct): Add prog_name and prog_ifindex fields.
(BPF_PROG_LOAD_struct_size, expected_BPF_PROG_LOAD_struct_size): Update.
* tests/bpf.c (init_BPF_PROG_LOAD_attr): Rename
to init_BPF_PROG_LOAD_attr3.
(print_BPF_PROG_LOAD_attr): Rename to print_BPF_PROG_LOAD_attr3.
(init_BPF_PROG_LOAD_attr4, print_BPF_PROG_LOAD_attr4): New functions.
(BPF_PROG_LOAD_checks): Check new decoding features.
bpf.c
bpf_attr.h
tests/bpf.c