From a2e4217c95f6dac3601b62d280f424cbdef1508c Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Tue, 3 Apr 2018 08:08:09 +0000 Subject: [PATCH] tests: check decoding of bpf_attr of size 1 * tests/bpf.c (BPF_PROG_GET_NEXT_ID_checks): New entry. --- tests/bpf.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/bpf.c b/tests/bpf.c index 4b3a11d2..a3b79942 100644 --- a/tests/bpf.c +++ b/tests/bpf.c @@ -498,6 +498,19 @@ static const struct bpf_attr_check BPF_PROG_GET_NEXT_ID_checks[] = { .size = offsetofend(struct BPF_PROG_GET_NEXT_ID_struct, start_id), .str = "start_id=3735928559, next_id=0" }, + { + .data = { .BPF_PROG_GET_NEXT_ID_data = { + .start_id = 0xdeadbeef + } }, + .size = 1, + .str = "start_id=" +#if WORDS_BIGENDIAN + "3724541952" /* 0xde000000 */ +#else + "239" /* 0x000000ef */ +#endif + ", next_id=0" + }, { .data = { .BPF_PROG_GET_NEXT_ID_data = { .start_id = 0xbadc0ded, -- 2.40.0