diff options
author | Alan Maguire <alan.maguire@oracle.com> | 2021-01-06 18:59:06 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-01-17 16:05:37 +0300 |
commit | a2b2ae3812e55b625cfcc715f93ae4330a93f6f4 (patch) | |
tree | d408af3b42ecc0616937fd197e6bb1799ae5ea42 /tools/bpf | |
parent | 2992e3371a3aeb4fd4321c55c0eafa85c30bf5be (diff) | |
download | linux-a2b2ae3812e55b625cfcc715f93ae4330a93f6f4.tar.xz |
bpftool: Fix compilation failure for net.o with older glibc
commit 6f02b540d7597f357bc6ee711346761045d4e108 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: f6f3bac08ff9 ("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>
Diffstat (limited to 'tools/bpf')
-rw-r--r-- | tools/bpf/bpftool/net.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/tools/bpf/bpftool/net.c b/tools/bpf/bpftool/net.c index bb311ccc6c48..c6787a1daa48 100644 --- a/tools/bpf/bpftool/net.c +++ b/tools/bpf/bpftool/net.c @@ -9,7 +9,6 @@ #include <unistd.h> #include <libbpf.h> #include <net/if.h> -#include <linux/if.h> #include <linux/rtnetlink.h> #include <linux/tc_act/tc_bpf.h> #include <sys/socket.h> |