Menu

#29 Build failure with GNU libc 2.8

open
nobody
None
5
2009-01-05
2009-01-05
No

Latest versions of the GNU libc don't provide struct in6_pktinfo by default. One has to #define _GNU_SOURCE so that this structure gets declared. See:

http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/inet/netinet/in.h.diff?r1=1.55&r2=1.56&cvsroot=glibc

This breaks wide-dhcpv6 builds on systems using latest versions of the GNU libc.

Discussion

  • Jérémie Corbier

    Please also note that defining _GNU_SOURCE globally does not work since there is a name conflict between GNU libc GNU-specific dprintf function and wide-dhcpv6 debug messages function.

     
  • Jérémie Corbier

    I worked around this issue by copying struct in6_pktinfo definition into dhcp6.h in the Debian package.

     
  • retvari

    retvari - 2009-10-06

    Here is a patch to detect at configure time whether libc defines "struct in6_pktinfo":

    diff --git wide/configure.in wide/configure.in
    index 59dd84e..8543b35 100644
    --- wide/configure.in
    +++ wide/configure.in
    @@ -236,4 +236,11 @@ AC_SUBST(group)

    AC_CHECK_HEADERS(stdarg.h)

    +AC_MSG_CHECKING(whether libc defines struct in6_pktinfo)
    +AC_TRY_COMPILE([#include <netinet/in.h>],
    + [struct in6_pktinfo p6;],
    + [AC_MSG_RESULT(yes)
    + CFLAGS="$CFLAGS -DHAVE_IN6_PKTINFO"],
    + [AC_MSG_RESULT(no)])
    +
    AC_OUTPUT(Makefile)
    diff --git wide/dhcp6.h wide/dhcp6.h
    index 6afb517..5280a46 100644
    --- wide/dhcp6.h
    +++ wide/dhcp6.h
    @@ -108,6 +108,13 @@ typedef uint64_t u_int64_t;
    #define DHCP6_IRT_DEFAULT 86400 /* 1 day */
    #define DHCP6_IRT_MINIMUM 600

    +#ifndef HAVE_IN6_PKTINFO
    +struct in6_pktinfo {
    + struct in6_addr ipi6_addr; /* src/dst IPv6 address */
    + unsigned int ipi6_ifindex; /* send/recv interface index */
    +};
    +#endif /* HAVE_IN6_PKTINFO */
    +
    /* DUID: DHCP unique Identifier */
    struct duid {
    size_t duid_len; /* length */

     

Log in to post a comment.