linux-stable/tools/bpf/bpftool
Alan Maguire 31a3520409 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:17:03 +01:00
..
bash-completion tools: bpftool: Add "inner_map" to "bpftool map create" outer maps 2020-09-10 17:29:21 -07:00
Documentation bpftool: Fix build failure 2020-09-14 18:47:57 -07:00
skeleton tools, bpftool: Remove two unused variables. 2020-10-29 15:23:18 +01:00
.gitignore tools/bpftool: Generalize BPF skeleton support and generate vmlinux.h 2020-06-22 17:01:48 -07:00
btf.c bpftool: Fix error return value in build_btf_type_table 2020-11-24 23:19:18 +01:00
btf_dumper.c tools/bpftool: Fix compilation warnings in 32-bit mode 2020-08-13 16:45:41 -07:00
cfg.c tools, bpftool: Poison and replace kernel integer typedefs 2020-05-11 21:20:46 +02:00
cfg.h tools: bpftool: replace Netronome boilerplate with SPDX license headers 2018-12-13 12:08:44 +01:00
cgroup.c tools, bpftool: Clean subcommand help messages 2020-06-01 14:38:18 -07:00
common.c bpftool: Use only nftw for file tree parsing 2020-07-21 23:42:56 +02:00
feature.c tools, bpftool: Avoid array index warnings. 2020-10-29 15:22:57 +01:00
gen.c tools/bpftool: Remove libbpf_internal.h usage in bpftool 2020-08-18 18:38:25 -07:00
iter.c tools/bpf: Support new uapi for map element bpf iterator 2020-08-06 16:39:14 -07:00
jit_disasm.c tools/bpf/bpftool: Remove duplicate headers 2020-04-26 08:40:01 -07:00
json_writer.c bpftool: Support dumping metadata 2020-09-15 18:28:27 -07:00
json_writer.h bpftool: Support dumping metadata 2020-09-15 18:28:27 -07:00
link.c bpftool: Implement link_query for bpf iterators 2020-08-21 14:01:39 -07:00
main.c tools: bpftool: Print optional built-in features along with version 2020-09-10 11:16:46 -07:00
main.h tools/bpftool: Fix compilation warnings in 32-bit mode 2020-08-13 16:45:41 -07:00
Makefile Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-10-05 18:40:01 -07:00
map.c tools: bpftool: Add "inner_map" to "bpftool map create" outer maps 2020-09-10 17:29:21 -07:00
map_perf_ring.c tools, bpftool: Poison and replace kernel integer typedefs 2020-05-11 21:20:46 +02:00
net.c bpftool: Fix compilation failure for net.o with older glibc 2021-01-17 14:17:03 +01:00
netlink_dumper.c bpftool: Use consistent include paths for libbpf 2020-01-20 16:37:45 -08:00
netlink_dumper.h tools: bpftool: dual license all files 2018-12-13 12:08:44 +01:00
perf.c tools, bpftool: Clean subcommand help messages 2020-06-01 14:38:18 -07:00
pids.c tools/bpftool: Fix PID fetching with a lot of results 2020-12-08 16:45:20 +01:00
prog.c tools/bpftool: Fix attaching flow dissector 2020-11-05 18:20:41 -08:00
struct_ops.c tools, bpftool: Clean subcommand help messages 2020-06-01 14:38:18 -07: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: Use consistent include paths for libbpf 2020-01-20 16:37:45 -08:00
xlated_dumper.h tools: bpftool: replace Netronome boilerplate with SPDX license headers 2018-12-13 12:08:44 +01:00