1
0
Fork 0
alistair23-linux/tools/bpf/bpftool
Alan Maguire a2b2ae3812 bpftool: Fix compilation failure for net.o with older glibc
commit 6f02b540d7 upstream.

For older glibc ~2.17, #include'ing both linux/if.h and net/if.h
fails due to complaints about redefinition of interface flags:

  CC       net.o
In file included from net.c:13:0:
/usr/include/linux/if.h:71:2: error: redeclaration of enumerator ‘IFF_UP’
  IFF_UP    = 1<<0,  /* sysfs */
  ^
/usr/include/net/if.h:44:5: note: previous definition of ‘IFF_UP’ was here
     IFF_UP = 0x1,  /* Interface is up.  */

The issue was fixed in kernel headers in [1], but since compilation
of net.c picks up system headers the problem can recur.

Dropping #include <linux/if.h> resolves the issue and it is
not needed for compilation anyhow.

[1] https://lore.kernel.org/netdev/1461512707-23058-1-git-send-email-mikko.rapeli__34748.27880641$1462831734$gmane$org@iki.fi/

Fixes: f6f3bac08f ("tools/bpf: bpftool: add net support")
Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Link: https://lore.kernel.org/bpf/1609948746-15369-1-git-send-email-alan.maguire@oracle.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-17 14:05:37 +01:00
..
Documentation tools: bpftool: add "bpftool map freeze" subcommand 2019-08-21 21:17:27 +02:00
bash-completion tools: bpftool: add "bpftool map freeze" subcommand 2019-08-21 21:17:27 +02:00
.gitignore tools: bpf: account for generated feature/ and libbpf/ directories 2019-08-31 00:38:16 +02:00
Makefile tools: bpftool: do not link twice against libbpf.a in Makefile 2019-08-31 00:38:16 +02:00
btf.c tools, bpftool: Fix wrong return value in do_dump() 2020-08-19 08:16:19 +02:00
btf_dumper.c bpftool: Fix printing incorrect pointer in btf_dump_ptr 2020-01-23 08:22:49 +01:00
cfg.c tools: bpftool: teach cfg code about JMP32 2019-01-26 13:33:01 -08:00
cfg.h tools: bpftool: replace Netronome boilerplate with SPDX license headers 2018-12-13 12:08:44 +01:00
cgroup.c bpf: Print error message for bpftool cgroup show 2020-02-24 08:36:40 +01:00
common.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2019-09-06 16:49:17 +02:00
feature.c tools: bpftool: fix reading from /proc/config.gz 2019-08-12 11:07:16 +02:00
jit_disasm.c tools: bpftool: Fix json dump crash on powerpc 2019-07-05 23:50:38 +02:00
json_writer.c tools: bpftool: move "__printf()" attributes to header file 2019-08-15 22:06:46 -07:00
json_writer.h tools: bpftool: move "__printf()" attributes to header file 2019-08-15 22:06:46 -07:00
main.c tools: bpftool: fix format string for p_err() in detect_common_prefix() 2019-08-15 22:06:46 -07:00
main.h tools: bpftool: move "__printf()" attributes to header file 2019-08-15 22:06:46 -07:00
map.c tools: bpftool: add "bpftool map freeze" subcommand 2019-08-21 21:17:27 +02:00
map_perf_ring.c tools: bpftool: fix arguments for p_err() in do_event_pipe() 2019-08-15 22:06:46 -07:00
net.c bpftool: Fix compilation failure for net.o with older glibc 2021-01-17 14:05:37 +01:00
netlink_dumper.c tools: bpftool: dual license all files 2018-12-13 12:08:44 +01:00
netlink_dumper.h tools: bpftool: dual license all files 2018-12-13 12:08:44 +01:00
perf.c tools: bpftool: compile with $(EXTRA_WARNINGS) 2019-08-14 22:57:36 +02:00
prog.c bpftool: Don't crash on missing xlated program instructions 2020-02-14 16:34:09 -05:00
tracelog.c tools: bpftool: add an option to prevent auto-mount of bpffs, tracefs 2018-12-18 14:47:17 +01:00
xlated_dumper.c bpftool: Don't crash on missing jited insns or ksyms 2020-01-12 12:21:24 +01:00
xlated_dumper.h tools: bpftool: replace Netronome boilerplate with SPDX license headers 2018-12-13 12:08:44 +01:00