aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/utils/iproute2/patches
diff options
context:
space:
mode:
authorTony Ambardar <itugrok@yahoo.com>2021-03-12 20:58:28 -0800
committerHauke Mehrtens <hauke@hauke-m.de>2021-04-10 14:22:28 +0200
commite07105303f538a4713db61d5f99017e81e87ab2c (patch)
treec9ee8c6c04dde20b0a877719bd34e05d4f373a6d /package/network/utils/iproute2/patches
parent0ffc498ddd24a528df4afca8737a50e5969b7161 (diff)
downloadupstream-e07105303f538a4713db61d5f99017e81e87ab2c.tar.gz
upstream-e07105303f538a4713db61d5f99017e81e87ab2c.tar.bz2
upstream-e07105303f538a4713db61d5f99017e81e87ab2c.zip
iproute2: add missing limits.h includes
This patch has been submitted upstream to fix an error reported by a few users. One instance 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 <rsalvaterra@gmail.com> Signed-off-by: Tony Ambardar <itugrok@yahoo.com> (cherry picked from commit 10ffefe60299637bc592ec4ef0dde93e0e2e8344)
Diffstat (limited to 'package/network/utils/iproute2/patches')
-rw-r--r--package/network/utils/iproute2/patches/185-libbpf-add-limits-h.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/package/network/utils/iproute2/patches/185-libbpf-add-limits-h.patch b/package/network/utils/iproute2/patches/185-libbpf-add-limits-h.patch
new file mode 100644
index 0000000000..07dbbc65b9
--- /dev/null
+++ b/package/network/utils/iproute2/patches/185-libbpf-add-limits-h.patch
@@ -0,0 +1,45 @@
+From c77310119f9a5f99221dd967c5eb0c7a26094b41 Mon Sep 17 00:00:00 2001
+From: Tony Ambardar <Tony.Ambardar@gmail.com>
+Date: Wed, 3 Mar 2021 10:29:24 -0800
+Subject: [PATCH] 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_MAX
+
+Reported-by: Rui Salvaterra <rsalvaterra@gmail.com>
+Signed-off-by: Tony Ambardar <Tony.Ambardar@gmail.com>
+---
+ lib/bpf_glue.c | 2 ++
+ lib/bpf_libbpf.c | 1 +
+ 2 files changed, 3 insertions(+)
+
+--- a/lib/bpf_glue.c
++++ b/lib/bpf_glue.c
+@@ -4,6 +4,8 @@
+ * Authors: Hangbin Liu <haliu@redhat.com>
+ *
+ */
++#include <limits.h>
++
+ #include "bpf_util.h"
+ #ifdef HAVE_LIBBPF
+ #include <bpf/bpf.h>
+--- a/lib/bpf_libbpf.c
++++ b/lib/bpf_libbpf.c
+@@ -13,6 +13,7 @@
+ #include <stdint.h>
+ #include <errno.h>
+ #include <fcntl.h>
++#include <limits.h>
+
+ #include <libelf.h>
+ #include <gelf.h>