[Toybox] [PATCH] ip: add missing linux/ip.h header for struct iphdr declaration

Ariadne Conill ariadne at dereferenced.org
Fri Jul 10 09:11:10 PDT 2020


On Tuesday, July 7, 2020 3:36:47 AM MDT you wrote:
> On 7/5/20 12:24 PM, ariadne at dereferenced.org wrote:
> > In Alpine, we are using Linux 5.4 kernel headers.  It is probably a
> > regression in the headers, but including the header anyway likely makes
> > sense.
> > 
> > I think glibc and bionic do not use kernel headers directly.
> 
> $ find /usr/include -type f | egrep -v '/(linux|asm|asm-generic)/' | xargs
> grep '#include <linux/' | wc -l
> 60
> 
> Although in this case, devuan ascii's /usr/include/linux/if_tunnel.h
> #includes linux/ip.h. Let's see, in current kernel sources...
> 
> $ git annotate include/uapi/linux/if_tunnel.h  | grep ip.h
> 1fe8e0f074c77	(Mikko Rapeli	2016-08-22 20:32:39 +0200	
7)#include
> <linux/ip.h>
> 
> commit 1fe8e0f074c77aa41aaa579345a9e675acbebfa9
> Author: Mikko Rapeli <mikko.rapeli at iki.fi>
> Date:   Mon Aug 22 20:32:39 2016 +0200
> 
>     include/uapi/linux/if_tunnel.h: include linux/if.h, linux/ip.h and
> linux/in6.h
> 
>     Fixes userspace compilation errors like:
> 
>     error: field ‘iph’ has incomplete type
>     error: field ‘prefix’ has incomplete type
> 
>     Signed-off-by: Mikko Rapeli <mikko.rapeli at iki.fi>
>     Signed-off-by: David S. Miller <davem at davemloft.net>
> 
> So this is a bug that was fixed in upstream kernel sources 4 years ago
> (v4.8-rc3), and the 5.4 kernel was released November 24, 2019.
> 
> Are you sure you're using 5.4 kernel headers?

Yes, Alpine is using 5.4 kernel headers.

$ apk info -W /usr/include/linux/if_tunnel.h 
/usr/include/linux/if_tunnel.h is owned by linux-headers-5.4.5-r1

Ariadne





More information about the Toybox mailing list