From e168cc6ff79974d573ac7e830dfe9990f91db685 Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Wed, 2 Aug 2023 19:58:28 +0900 Subject: [PATCH] icmp.c: do not include linux headers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit net/if.h and linux/if.h headers conflict with each other as of linux 6.3 and glibc 2.37 headers: In file included from /usr/include/linux/icmp.h:23, from icmp.c:5: /usr/include/net/if.h:44:5: error: redeclaration of enumerator ‘IFF_UP’ 44 | IFF_UP = 0x1, /* Interface is up. */ | ^~~~~~ /usr/include/linux/if.h:83:9: note: previous definition of ‘IFF_UP’ with type ‘enum net_device_flags’ 83 | IFF_UP = 1<<0, /* sysfs */ | ^~~~~~ icmp.c gets net/if.h from l2tpns.h, and linux/if.h from linux/icmp.h. In our case, we do not need to use the linux headers at all here as we are doing normal userspace things: just use glibc headers all the way. This has been tested with kernel 3.2 / glibc 2.13 headers, so it's probably fine. (l2tpns does not currently build with musl) --- icmp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/icmp.c b/icmp.c index 58c28f2..be5d8ea 100644 --- a/icmp.c +++ b/icmp.c @@ -1,8 +1,8 @@ // L2TPNS: icmp #include -#include -#include +#include +#include #include #include #include