This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Redefinition of struct in6_addr in <netinet/in.h> and<linux/in6.h>
- From: Jan Engelhardt <jengelh at inai dot de>
- To: David Miller <davem at davemloft dot net>
- Cc: carlos at systemhalted dot org, bhutchings at solarflare dot com, yoshfuji at linux-ipv6 dot org, amwang at redhat dot com, tmb at mageia dot org, eblake at redhat dot com, netdev at vger dot kernel dot org, linux-kernel at vger dot kernel dot org, libvirt-list at redhat dot com, tgraf at suug dot ch, libc-alpha at sourceware dot org, schwab at suse dot de
- Date: Thu, 17 Jan 2013 11:57:14 +0100 (CET)
- Subject: Re: Redefinition of struct in6_addr in <netinet/in.h> and<linux/in6.h>
- References: <1358351232.2923.10.camel@bwh-desktop.uk.solarflarecom.com> <20130116.164511.2027039182184636075.davem@davemloft.net> <50F75AD7.7000703@systemhalted.org> <20130116.210512.2230612692562212911.davem@davemloft.net>
On Thursday 2013-01-17 03:05, David Miller wrote:
>From: Carlos O'Donell <carlos@systemhalted.org>
>Date: Wed, 16 Jan 2013 20:58:47 -0500
>
>> So I just went down the rabbit hole, and the further I get the
>> closer I get to having two exact copies of the same definitions
>> in both glibc and the kernel and using whichever one was included
>> first.
>>
>> Is anyone opposed to that kind of solution?
>
>Sounds interesting, please share :-)
iptables has the same issue, and solved it its way.
(uapi/)linux/netfilter.h is used to get at things like union
nf_inet_addr. This union contains struct in6_addr. There is no include
for in6_addr in netfilter.h itself. This may break the "standalone
compilation" test, but at least allows for specifying the
environment-specific header for in6_addr in the C file:
a. userspace: #include <netinet/in.h> before <linux/netfilter.h>
b. kernel parts: #include <linux/in6.h> before <linux/netfilter.h>