From: Alan Maguire Date: Wed, 6 Jan 2021 15:59:06 +0000 (+0000) Subject: bpftool: Fix compilation failure for net.o with older glibc X-Git-Tag: accepted/tizen/unified/20230118.172025~8123^2~6^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6f02b540d7597f357bc6ee711346761045d4e108;p=platform%2Fkernel%2Flinux-rpi.git bpftool: Fix compilation failure for net.o with older glibc 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 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 Signed-off-by: Andrii Nakryiko Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/bpf/1609948746-15369-1-git-send-email-alan.maguire@oracle.com --- diff --git a/tools/bpf/bpftool/net.c b/tools/bpf/bpftool/net.c index 3fae61e..ff3aa0c 100644 --- a/tools/bpf/bpftool/net.c +++ b/tools/bpf/bpftool/net.c @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include