lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Thu, 11 Mar 2021 13:47:54 -0800
From:   Tony Ambardar <tony.ambardar@...il.com>
To:     Stephen Hemminger <stephen@...workplumber.org>
Cc:     Tony Ambardar <Tony.Ambardar@...il.com>, netdev@...r.kernel.org,
        Rui Salvaterra <rsalvaterra@...il.com>
Subject: [PATCH iproute2] 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@...il.com>
Signed-off-by: Tony Ambardar <Tony.Ambardar@...il.com>
---
 lib/bpf_glue.c   | 2 ++
 lib/bpf_libbpf.c | 1 +
 2 files changed, 3 insertions(+)

diff --git a/lib/bpf_glue.c b/lib/bpf_glue.c
index d00a0dc1..eaa9504f 100644
--- a/lib/bpf_glue.c
+++ b/lib/bpf_glue.c
@@ -4,6 +4,8 @@
  * Authors:	Hangbin Liu <haliu@...hat.com>
  *
  */
+#include <limits.h>
+
 #include "bpf_util.h"
 #ifdef HAVE_LIBBPF
 #include <bpf/bpf.h>
diff --git a/lib/bpf_libbpf.c b/lib/bpf_libbpf.c
index d05737a4..864f8c35 100644
--- 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>
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ