lib/bpf: add missing limits.h includes
Subsystems (3)
PATCH 1/1 lib/bpf: add missing limits.h includes
Several functions in bpf_glue.c and bpf_libbpf.c rely on PATH_MAX, which is normally included from <limits.h> in other iproute2 source files.
It fixes errors seen using gcc 10.2.0, binutils 2.35.1 and musl 1.1.24:
bpf_glue.c: In function 'get_libbpf_version':
bpf_glue.c:46:11: error: 'PATH_MAX' undeclared (first use in this function); did you mean 'AF_MAX'?
46 | char buf[PATH_MAX], *s;
| ^~~~~~~~
| AF_MAXReported-by Rui Salvaterra <[email protected]>
Signed-off-by Tony Ambardar <[email protected]>
--- lib/bpf_glue.c | 2 ++ lib/bpf_libbpf.c | 1 + 2 files changed, 3 insertions(+)
lib/bpf_glue.c +2 -0
@@ -4,6 +4,8 @@* Authors: Hangbin Liu <[email protected]> * */ +#include <limits.h> +#include "bpf_util.h" #ifdef HAVE_LIBBPF #include <bpf/bpf.h>
lib/bpf_libbpf.c +1 -0
@@ -13,6 +13,7 @@#include <stdint.h> #include <errno.h> #include <fcntl.h> +#include <limits.h> #include <libelf.h> #include <gelf.h>
Signature · 1 line
2.25.1