[net-tools-devel] FYI: net-tools build fails for linux-4.8
Linux networking base tools
Brought to you by:
eckes
|
From: Randy M. <ran...@wi...> - 2016-10-06 20:27:05
|
I haven't seen any discussion or a patch to fix net-tools
when using linux-4.8. This commit in the kernel:
commit 1fe8e0f074c
[include/uapi/linux/if_tunnel.h:
include linux/if.h, linux/ip.h and linux/in6.h]
breaks net-tools like this:
| make[1]: Leaving directory
`/.../test-oct-03-a/b/wr-small/tmp/work/aarch64-wrs-linux/net-tools/1.60-26-r0.2/net-tools-1.60/lib'
| aarch64-wrs-linux-gcc
--sysroot=/.../test-oct-03-a/b/wr-small/tmp/sysroots/qemuarm64
-D_GNU_SOURCE -O2 -Wall -g -I. -idirafter ./include/ -Ilib -c -o
iptunnel.o iptunnel.c
| In file included from
/.../test-oct-03-a/b/wr-small/tmp/sysroots/qemuarm64/usr/include/linux/if_tunnel.h:6:0,
| from iptunnel.c:49:
|
/.../test-oct-03-a/b/wr-small/tmp/sysroots/qemuarm64/usr/include/linux/ip.h:85:8:
error: redefinition of 'struct iphdr'
| struct iphdr {
| ^~~~~
| In file included from iptunnel.c:29:0:
|
/.../test-oct-03-a/b/wr-small/tmp/sysroots/qemuarm64/usr/include/netinet/ip.h:44:8:
note: originally defined here
| struct iphdr
| ^~~~~
| make: *** [iptunnel.o] Error 1
In the Yocto project kernel tree, we've temporarily reverted the 'bad'
commit. Our local kernel geek claims that we should patch net-tools
rather than expect the kernel header change to be reverted.
Patch below, I hope it isn't garbled by email clients, etc.
It might be that the simple change below is all that's needed but
I've only built the code and I don't have time to test the
build with other kernels let alone confirm that it works correctly
although it really should.
I'm on vacation as of now but Jackie, my co-worker, will be back
from holiday on Saturday morning in Beijing and he can follow-up
if needed.
Thanks,
--
# Randy MacLeod. SMTS, Linux, Wind River
Direct: 613.963.1350 | 350 Terry Fox Drive, Suite 200, Ottawa, ON,
Canada, K2K 2W5
$ cat 0001-iptunnel.c-include-linux-ip.h-to-fix-building-with-l.patch
From ae351cfe89ca68bfb3019c89c3b4fda5d1a98c98 Mon Sep 17 00:00:00 2001
From: Randy MacLeod <Ran...@wi...>
Date: Thu, 6 Oct 2016 16:12:10 -0400
Subject: [PATCH] iptunnel.c: include linux/ip.h to fix building with
linux-4.8
Fix a build error when using the linux-4.8 headers that results in:
In file included from
.../sysroots/qemuarm64/usr/include/linux/if_tunnel.h:6:0,
from iptunnel.c:39:
.../qemuarm64/usr/include/linux/ip.h:85:8: error: redefinition of
'struct iphdr'
struct iphdr {
^~~~~
In file included from iptunnel.c:29:0:
.../qemuarm64/usr/include/netinet/ip.h:44:8: note: originally defined here
struct iphdr
^~~~~
Signed-off-by: Randy MacLeod <Ran...@wi...>
---
iptunnel.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/iptunnel.c b/iptunnel.c
index 4943d83..acfcbc7 100644
--- a/iptunnel.c
+++ b/iptunnel.c
@@ -26,7 +26,6 @@
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <netinet/in.h>
-#include <netinet/ip.h>
#include <arpa/inet.h>
#if defined(__GLIBC__) && (__GLIBC__ > 2 || (__GLIBC__ == 2 &&
__GLIBC_MINOR__ >= 1))
#include <net/if.h>
@@ -36,6 +35,7 @@
#include <linux/if_arp.h>
#endif
#include <linux/types.h>
+#include <linux/ip.h>
#include <linux/if_tunnel.h>
#include "config.h"
--
1.9.1
|