From de47c2253dfc39f5a2e26b64a47afb538f602a13 Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Fri, 21 Jun 2002 19:21:44 +0000 Subject: [PATCH] * fake-addrinfo.h: If IPv6 support is compiled in, but the OS does not provide in6addr_any in libc, provide a static copy. * configure.in: If IPv6 support is compiled in, test for existence of in6addr_any in libc. Irix 6.5.16 declares it, and some libraries appear to depend on it, but it is not defined in any libraries that I could find. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14555 dc483132-0cff-0310-8789-dd5450dbe970 --- src/include/ChangeLog | 8 ++++++++ src/include/configure.in | 27 +++++++++++++++++++++++++++ src/include/fake-addrinfo.h | 5 +++++ 3 files changed, 40 insertions(+) diff --git a/src/include/ChangeLog b/src/include/ChangeLog index 88770e313..9a5e5639a 100644 --- a/src/include/ChangeLog +++ b/src/include/ChangeLog @@ -1,3 +1,11 @@ +2002-06-21 Ezra Peisach + + * fake-addrinfo.h: If IPv6 support is compiled in, but the OS does + not provide in6addr_any in libc, provide a static copy. + + * configure.in: If IPv6 support is compiled in, test for existence + of in6addr_any in libc. + 2002-06-21 Ken Raeburn * port-sockets.h [!_WIN32 && !HAVE_MACSOCK_H]: Include diff --git a/src/include/configure.in b/src/include/configure.in index 56f5baea1..a702a2acc 100644 --- a/src/include/configure.in +++ b/src/include/configure.in @@ -74,6 +74,33 @@ AC_CHECK_HEADERS(stdlib.h string.h stddef.h unistd.h sys/types.h sys/file.h sys/ AC_HEADER_STDARG KRB5_AC_INET6 dnl +dnl If compiling with IPv6 support, test if in6addr_any functions. +dnl Irix 6.5.16 defines it, but lacks support in the C library. +if test $krb5_cv_inet6 = yes ; then +AC_CACHE_CHECK([For in6addr_any definition in library], + krb5_cv_var_in6addr_any, +[AC_TRY_LINK([ +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_MACSOCK_H +#include +#else +#include +#endif +#include +#include +],[ + struct sockaddr_in6 in; + in.sin6_addr = in6addr_any; +],krb5_cv_var_in6addr_any=yes, krb5_cv_var_in6addr_any=no)]) + if test $krb5_cv_var_in6addr_any = no; then + AC_DEFINE(NEED_INSIXADDR_ANY,1,[Define if in6addr_any is not defined in libc]) + fi +fi + +dnl +dnl dnl check for ANSI stdio, esp "b" option to fopen(). This (unfortunately) dnl requires a run check... dnl diff --git a/src/include/fake-addrinfo.h b/src/include/fake-addrinfo.h index 5003becd2..8a937c192 100644 --- a/src/include/fake-addrinfo.h +++ b/src/include/fake-addrinfo.h @@ -893,6 +893,11 @@ int getnameinfo (const struct sockaddr *sa, socklen_t len, #endif /* WRAP_GETADDRINFO || WRAP_GETNAMEINFO */ +#if defined(KRB5_USE_INET6) && defined(NEED_INSIXADDR_ANY) +/* If compiling with IPv6 support and C library does not define in6addr_any */ +static const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT; +#endif + #ifdef ADDRINFO_UNDEF_INLINE # undef inline # undef ADDRINFO_UNDEF_INLINE -- 2.26.2