blob: 07dbbc65b9f20ce0e58f96900033b34aa3790cd1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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>
|