diff options
author | Andrii Nakryiko <andriin@fb.com> | 2020-08-19 04:36:06 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-08-19 04:38:25 +0300 |
commit | 85367030a6c7ef3373347cf816c698995074f6f0 (patch) | |
tree | b0f4b19f18ec9d8d64893a4b7a3e4790851185e2 /tools/lib/bpf/nlattr.c | |
parent | 7084566a236fbc98beb11430d8d67dd08b2ac151 (diff) | |
download | linux-85367030a6c7ef3373347cf816c698995074f6f0.tar.xz |
libbpf: Centralize poisoning and poison reallocarray()
Most of libbpf source files already include libbpf_internal.h, so it's a good
place to centralize identifier poisoning. So move kernel integer type
poisoning there. And also add reallocarray to a poison list to prevent
accidental use of it. libbpf_reallocarray() should be used universally
instead.
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200819013607.3607269-4-andriin@fb.com
Diffstat (limited to 'tools/lib/bpf/nlattr.c')
-rw-r--r-- | tools/lib/bpf/nlattr.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/tools/lib/bpf/nlattr.c b/tools/lib/bpf/nlattr.c index 0ad41dfea8eb..b607fa9852b1 100644 --- a/tools/lib/bpf/nlattr.c +++ b/tools/lib/bpf/nlattr.c @@ -7,14 +7,11 @@ */ #include <errno.h> -#include "nlattr.h" -#include "libbpf_internal.h" -#include <linux/rtnetlink.h> #include <string.h> #include <stdio.h> - -/* make sure libbpf doesn't use kernel-only integer typedefs */ -#pragma GCC poison u8 u16 u32 u64 s8 s16 s32 s64 +#include <linux/rtnetlink.h> +#include "nlattr.h" +#include "libbpf_internal.h" static uint16_t nla_attr_minlen[LIBBPF_NLA_TYPE_MAX+1] = { [LIBBPF_NLA_U8] = sizeof(uint8_t), |