mailing list of musl libc
 help / color / mirror / code / Atom feed
* netinet/if_ether.h and linux/if_ether.h
@ 2013-11-02 13:18 Paul Schutte
  2013-11-02 19:07 ` Szabolcs Nagy
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Schutte @ 2013-11-02 13:18 UTC (permalink / raw)
  To: musl

[-- Attachment #1: Type: text/plain, Size: 858 bytes --]

Hi,

I am trying to compile openvpn against musl and I get the following:

In file included from /usr/include/linux/if_tun.h:20:0,
                 from syshead.h:222,
                 from base64.c:40:
/usr/include/linux/if_ether.h:127:8: error: redefinition of 'struct ethhdr'
/usr/include/netinet/if_ether.h:93:8: note: originally defined here



Glibc does not have this problem as they include linux/if_ether.h
from netinet/if_ether.h. For musl I realize that would mean a dependency on
kernel-headers.


Openvpn uses the following:

#if defined(HAVE_NETINET_IF_ETHER_H)
#include <netinet/if_ether.h>
#endif

#ifdef HAVE_LINUX_IF_TUN_H
#include <linux/if_tun.h>                   <--- includes linux/if_ether.h
#endif


I can get it to work by just removing the netinet/if_ether.h part, but
maybe it is something worthy of your attention.

Regards
Paul

[-- Attachment #2: Type: text/html, Size: 1321 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: netinet/if_ether.h and linux/if_ether.h
  2013-11-02 13:18 netinet/if_ether.h and linux/if_ether.h Paul Schutte
@ 2013-11-02 19:07 ` Szabolcs Nagy
  2013-11-02 19:15   ` Paul Schutte
  2013-11-02 19:34   ` Rich Felker
  0 siblings, 2 replies; 4+ messages in thread
From: Szabolcs Nagy @ 2013-11-02 19:07 UTC (permalink / raw)
  To: musl

* Paul Schutte <sjpschutte@gmail.com> [2013-11-02 13:18:41 +0000]:
> I am trying to compile openvpn against musl and I get the following:
> 
> In file included from /usr/include/linux/if_tun.h:20:0,
>                  from syshead.h:222,
>                  from base64.c:40:
> /usr/include/linux/if_ether.h:127:8: error: redefinition of 'struct ethhdr'
> /usr/include/netinet/if_ether.h:93:8: note: originally defined here
> 

yes this was reported earlier but it was not addressed

there is no clean solution: netinet/if_ether.h should include
linux/if_ether.h so they don't conflict, but then it cannot be
used without the kernel headers

> I can get it to work by just removing the netinet/if_ether.h part, but
> maybe it is something worthy of your attention.

netinet/if_ether.h has additional interfaces over the linux/if_ether.h
ones, so this does not work in general


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: netinet/if_ether.h and linux/if_ether.h
  2013-11-02 19:07 ` Szabolcs Nagy
@ 2013-11-02 19:15   ` Paul Schutte
  2013-11-02 19:34   ` Rich Felker
  1 sibling, 0 replies; 4+ messages in thread
From: Paul Schutte @ 2013-11-02 19:15 UTC (permalink / raw)
  To: musl

[-- Attachment #1: Type: text/plain, Size: 1001 bytes --]

Thanks Nsz !


On Sat, Nov 2, 2013 at 7:07 PM, Szabolcs Nagy <nsz@port70.net> wrote:

> * Paul Schutte <sjpschutte@gmail.com> [2013-11-02 13:18:41 +0000]:
> > I am trying to compile openvpn against musl and I get the following:
> >
> > In file included from /usr/include/linux/if_tun.h:20:0,
> >                  from syshead.h:222,
> >                  from base64.c:40:
> > /usr/include/linux/if_ether.h:127:8: error: redefinition of 'struct
> ethhdr'
> > /usr/include/netinet/if_ether.h:93:8: note: originally defined here
> >
>
> yes this was reported earlier but it was not addressed
>
> there is no clean solution: netinet/if_ether.h should include
> linux/if_ether.h so they don't conflict, but then it cannot be
> used without the kernel headers
>
> > I can get it to work by just removing the netinet/if_ether.h part, but
> > maybe it is something worthy of your attention.
>
> netinet/if_ether.h has additional interfaces over the linux/if_ether.h
> ones, so this does not work in general
>

[-- Attachment #2: Type: text/html, Size: 1448 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: netinet/if_ether.h and linux/if_ether.h
  2013-11-02 19:07 ` Szabolcs Nagy
  2013-11-02 19:15   ` Paul Schutte
@ 2013-11-02 19:34   ` Rich Felker
  1 sibling, 0 replies; 4+ messages in thread
From: Rich Felker @ 2013-11-02 19:34 UTC (permalink / raw)
  To: musl

On Sat, Nov 02, 2013 at 08:07:43PM +0100, Szabolcs Nagy wrote:
> * Paul Schutte <sjpschutte@gmail.com> [2013-11-02 13:18:41 +0000]:
> > I am trying to compile openvpn against musl and I get the following:
> > 
> > In file included from /usr/include/linux/if_tun.h:20:0,
> >                  from syshead.h:222,
> >                  from base64.c:40:
> > /usr/include/linux/if_ether.h:127:8: error: redefinition of 'struct ethhdr'
> > /usr/include/netinet/if_ether.h:93:8: note: originally defined here
> > 
> 
> yes this was reported earlier but it was not addressed
> 
> there is no clean solution: netinet/if_ether.h should include
> linux/if_ether.h so they don't conflict, but then it cannot be
> used without the kernel headers
> 
> > I can get it to work by just removing the netinet/if_ether.h part, but
> > maybe it is something worthy of your attention.
> 
> netinet/if_ether.h has additional interfaces over the linux/if_ether.h
> ones, so this does not work in general

I think the proper solution is just to acknowledge that kernel headers
and userspace headers are generally not to be used together. In
particular things like this should be split into multiple source
files.

If there are still too many programs that break and can't be fixed
easily, maybe we can make a script that removes the conflicting
definitions from kernel headers and includes the userspace (libc)
headers for them. The other direction is not really acceptable because
the kernel folks do not respect namespace (how would you deal with
things from the kernel that should be exposed under _GNU_SOURCE but
not POSIX?)...

Rich


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-11-02 19:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-02 13:18 netinet/if_ether.h and linux/if_ether.h Paul Schutte
2013-11-02 19:07 ` Szabolcs Nagy
2013-11-02 19:15   ` Paul Schutte
2013-11-02 19:34   ` Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).