bpftool: Align bpf_load_and_run_opts insns and data
authorIan Rogers <irogers@google.com>
Sat, 7 Oct 2023 04:44:39 +0000 (21:44 -0700)
committerAndrii Nakryiko <andrii@kernel.org>
Mon, 9 Oct 2023 16:36:51 +0000 (09:36 -0700)
commit1be84ca53ca0421c781f9ec007cd8bccbb58f763
treed0d080976441f94c1d82d6e376e46a53653ef1db
parent23671f4dfd10b48b4a2fee4768886f0d8ec55b7e
bpftool: Align bpf_load_and_run_opts insns and data

A C string lacks alignment so use aligned arrays to avoid potential
alignment problems. Switch to using sizeof (less 1 for the \0
terminator) rather than a hardcode size constant.

Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Quentin Monnet <quentin@isovalent.com>
Link: https://lore.kernel.org/bpf/20231007044439.25171-2-irogers@google.com
tools/bpf/bpftool/gen.c