Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 9 Oct 2012 16:13:43 -0700
From: Isaac Dunham <>
Subject: Re: Clash between 'netinet/if_ether.h' and

On Mon, 8 Oct 2012 19:33:07 -0400
Rich Felker <> wrote:

> On Tue, Oct 09, 2012 at 12:45:17AM +0200, Abdoulaye Walsimou GAYE wrote:
> > Hello,
> > While trying to compile busybox-1.20.2, the following issue raised:
> > 
> >   CC      networking/ifplugd.o
> > In file included from /home/walsimou/embtoolkit.git/sysroot-armel-linux-arm920t/usr/include/net/ethernet.h:10:0,
> >                  from networking/ifplugd.c:41:
> > /home/walsimou/embtoolkit.git/sysroot-armel-linux-arm920t/usr/include/netinet/if_ether.h:75:8: error: redefinition of 'struct ethhdr'
> > /home/walsimou/embtoolkit.git/sysroot-armel-linux-arm920t/usr/include/linux/if_ether.h:127:8: note: originally defined here
> > 
> > Note that uClibc strategy here is to include linux/if_ether.h
> It's a bug to be including linux/if_ether.h, and there's no way to
> work around this without depending on kernel headers, which musl will

Patch that does work around it:

+/* Check for <linux/if_ether.h> - _LINUX_IF_ETHER_H will also work */
+#if !defined(_NETINET_IF_ETHER_H) || !defined(ETH_ALEN)
+#define _LINUX_IF_ETHER_H /* linux/if_ether.h defines the same stuff */

#include <stdint.h>
#include <sys/types.h>

Not really clean, but all that an application can rely on getting from either header can be found in the other:
on my install, the content of linux/if_ether.h is exactly the same except it uses kernel types.

Isaac Dunham <>

Powered by blists - more mailing lists

Your e-mail address:

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.