netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf] tools: bpftool: fix compilation with older headers
@ 2018-03-06 13:50 Jiri Benc
  2018-03-06 14:39 ` Daniel Borkmann
  2018-03-07 20:56 ` Daniel Borkmann
  0 siblings, 2 replies; 7+ messages in thread
From: Jiri Benc @ 2018-03-06 13:50 UTC (permalink / raw)
  To: netdev; +Cc: Alexei Starovoitov, Daniel Borkmann, Jakub Kicinski

Compilation of bpftool on a distro that lacks eBPF support in the installed
kernel headers fails with:

common.c: In function ‘is_bpffs’:
common.c:96:40: error: ‘BPF_FS_MAGIC’ undeclared (first use in this function)
  return (unsigned long)st_fs.f_type == BPF_FS_MAGIC;
                                        ^
Fix this the same way it is already in tools/lib/bpf/libbpf.c and
tools/lib/api/fs/fs.c.

Signed-off-by: Jiri Benc <jbenc@redhat.com>
---
 tools/bpf/bpftool/common.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/bpf/bpftool/common.c b/tools/bpf/bpftool/common.c
index 0b482c0070e0..465995281dcd 100644
--- a/tools/bpf/bpftool/common.c
+++ b/tools/bpf/bpftool/common.c
@@ -55,6 +55,10 @@
 
 #include "main.h"
 
+#ifndef BPF_FS_MAGIC
+#define BPF_FS_MAGIC		0xcafe4a11
+#endif
+
 void p_err(const char *fmt, ...)
 {
 	va_list ap;
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-03-07 20:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-06 13:50 [PATCH bpf] tools: bpftool: fix compilation with older headers Jiri Benc
2018-03-06 14:39 ` Daniel Borkmann
2018-03-06 15:03   ` Jiri Benc
2018-03-06 16:00     ` David Miller
2018-03-06 16:28       ` Daniel Borkmann
2018-03-06 17:16         ` Arnaldo Carvalho de Melo
2018-03-07 20:56 ` Daniel Borkmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).