From: Tony Ambardar Date: Thu, 11 Mar 2021 21:47:54 +0000 (-0800) Subject: lib/bpf: add missing limits.h includes X-Git-Tag: v5.12.0~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=06bee37c1c86d94e1728e75339be15ada08f58d2;p=thirdparty%2Fiproute2.git 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 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_MAX Reported-by: Rui Salvaterra Signed-off-by: Tony Ambardar Signed-off-by: Stephen Hemminger --- diff --git a/lib/bpf_glue.c b/lib/bpf_glue.c index d00a0dc17..eaa9504f3 100644 --- a/lib/bpf_glue.c +++ b/lib/bpf_glue.c @@ -4,6 +4,8 @@ * Authors: Hangbin Liu * */ +#include + #include "bpf_util.h" #ifdef HAVE_LIBBPF #include diff --git a/lib/bpf_libbpf.c b/lib/bpf_libbpf.c index d05737a44..864f8c351 100644 --- a/lib/bpf_libbpf.c +++ b/lib/bpf_libbpf.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include