diff options
author | Quentin Monnet <quentin@isovalent.com> | 2020-05-11 18:15:33 +0200 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2020-05-11 21:20:46 +0200 |
commit | 6e7e034e88e8e22cb14765c86da92416017e45b8 (patch) | |
tree | a51838934255b07523f0eaf6517713ff7c92a99f /tools/bpf/bpftool/main.h | |
parent | bpf, libbpf: Replace zero-length array with flexible-array (diff) | |
download | linux-6e7e034e88e8e22cb14765c86da92416017e45b8.tar.xz linux-6e7e034e88e8e22cb14765c86da92416017e45b8.zip |
tools, bpftool: Poison and replace kernel integer typedefs
Replace the use of kernel-only integer typedefs (u8, u32, etc.) by their
user space counterpart (__u8, __u32, etc.).
Similarly to what libbpf does, poison the typedefs to avoid introducing
them again in the future.
Signed-off-by: Quentin Monnet <quentin@isovalent.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20200511161536.29853-2-quentin@isovalent.com
Diffstat (limited to 'tools/bpf/bpftool/main.h')
-rw-r--r-- | tools/bpf/bpftool/main.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/bpf/bpftool/main.h b/tools/bpf/bpftool/main.h index a41cefabccaf..f89ac70ef973 100644 --- a/tools/bpf/bpftool/main.h +++ b/tools/bpf/bpftool/main.h @@ -18,6 +18,9 @@ #include "json_writer.h" +/* Make sure we do not use kernel-only integer typedefs */ +#pragma GCC poison u8 u16 u32 u64 s8 s16 s32 s64 + #define ptr_to_u64(ptr) ((__u64)(unsigned long)(ptr)) #define NEXT_ARG() ({ argc--; argv++; if (argc < 0) usage(); }) |