diff --git a/lib/bind/config.h.in b/lib/bind/config.h.in index b81bb6338c..c1c9399b91 100644 --- a/lib/bind/config.h.in +++ b/lib/bind/config.h.in @@ -41,4 +41,4 @@ struct __sFILE; extern __inline int __sputaux(int _c, struct __sFILE *_p); #endif - +#undef BROKEN_IN6ADDR_INIT_MACROS diff --git a/lib/bind/configure.in b/lib/bind/configure.in index f74becc952..54b3b76a7b 100644 --- a/lib/bind/configure.in +++ b/lib/bind/configure.in @@ -18,7 +18,7 @@ AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl esyscmd([sed "s/^/# /" COPYRIGHT])dnl AC_DIVERT_POP()dnl -AC_REVISION($Revision: 1.62 $) +AC_REVISION($Revision: 1.63 $) AC_INIT(resolv/herror.c) AC_PREREQ(2.13) @@ -1943,6 +1943,7 @@ AC_SUBST(SERV_R_SET_RETURN) # AC_SUBST(ISC_PLATFORM_BRACEPTHREADONCEINIT) ISC_PLATFORM_BRACEPTHREADONCEINIT="#undef ISC_PLATFORM_BRACEPTHREADONCEINIT" +BROKEN_IN6ADDR_INIT_MACROS="#undef BROKEN_IN6ADDR_INIT_MACROS" case "$host" in *-bsdi3.1*) @@ -1951,12 +1952,14 @@ case "$host" in *-bsdi4.0*) hack_shutup_sigwait=yes hack_shutup_sputaux=yes + hack_shutup_in6addr_init_macros=yes ;; *-bsdi4.1*) hack_shutup_stdargcast=yes ;; *-solaris2.8) hack_shutup_pthreadonceinit=yes + hack_shutup_in6addr_init_macros=yes ;; esac @@ -1996,6 +1999,12 @@ case "$hack_shutup_stdargcast" in ;; esac +case "$hack_shutup_in6addr_init_macros" in + yes) + AC_DEFINE(BROKEN_IN6ADDR_INIT_MACROS) + ;; +esac + # # Substitutions # diff --git a/lib/bind/port_after.h.in b/lib/bind/port_after.h.in index f238bba8f4..15c1e2f831 100644 --- a/lib/bind/port_after.h.in +++ b/lib/bind/port_after.h.in @@ -75,10 +75,37 @@ struct sockaddr_in6 { struct in6_addr sin6_addr; /* IPv6 address */ u_int32_t sin6_scope_id; /* set of interfaces for a scope */ }; -#else -#define INET6 1 #endif /* HAS_INET6_STRUCTS */ +#ifdef BROKEN_IN6ADDR_INIT_MACROS +#undef IN6ADDR_ANY_INIT +#undef IN6ADDR_LOOPBACK_INIT +#endif + +#ifndef IN6ADDR_ANY_INIT +#ifdef s6_addr +#define IN6ADDR_ANY_INIT \ + {{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}} +#else +#define IN6ADDR_ANY_INIT \ + {{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }} +#endif + +#endif +#ifndef IN6ADDR_LOOPBACK_INIT +#ifdef s6_addr +#define IN6ADDR_LOOPBACK_INIT \ + {{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}} +#else +#define IN6ADDR_LOOPBACK_INIT \ + {{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }} +#endif +#endif + #ifndef HAVE_SOCKADDR_STORAGE #define __SS_MAXSIZE 128 #define __SS_ALLIGSIZE (sizeof (long))