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: Cong Wang <amwang at redhat dot com>
- To: Jike Song <albcamus at gmail dot com>
- Cc: David Miller <davem at davemloft dot net>, vapier at gentoo dot org, bhutchings at solarflare dot com, libc-alpha at sourceware dot org, yoshfuji at linux-ipv6 dot org, 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, schwab at suse dot de, carlos at systemhalted dot org
- Date: Thu, 17 Jan 2013 14:59:13 +0800
- Subject: Re: Redefinition of struct in6_addr in <netinet/in.h> and<linux/in6.h>
- References: <201301161205.04502.vapier@gentoo.org> <1358356211.2923.25.camel@bwh-desktop.uk.solarflarecom.com> <201301161228.42592.vapier@gentoo.org> <20130116.135959.90676245194307972.davem@davemloft.net> <CANE52KhF17WRZTUbrjRDnwcbdN+V+69=ZqXjBwPjnswEO5iz7g@mail.gmail.com>
On Thu, 2013-01-17 at 11:55 +0800, Jike Song wrote:
> On Thu, Jan 17, 2013 at 2:59 AM, David Miller <davem@davemloft.net> wrote:
>
> >
> > When GLIBC doesn't provide it's own definition of some networking
> > macros or interfaces that the kernel provides, people include the
> > kernel header.
> >
>
> Recently I got a problem when copying a structure from kernel to userspace,
> after debugging I found:
>
> kernel: include/linux/inet.h
>
> #define INET6_ADDRSTRLEN (48)
>
> glibc: /usr/include/netinet/in.h
>
> #define INET6_ADDRSTRLEN 46
>
>
> Any reason to differentiate them from each other?
>
I see no reason, even although I don't know why it is 46 instead of 40.
But include/linux/inet.h is not exported to user-space, AFAIK.