apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject cvs commit: apr/network_io/unix sockaddr.c
Date Thu, 20 May 2004 14:53:21 GMT
trawick     2004/05/20 07:53:21

  Modified:    .        CHANGES configure.in
               build    apr_network.m4
               network_io/unix sockaddr.c
  Log:
  Don't assume getnameinfo() can handle IPv4-mapped IPv6 addresses
  on any platforms.
  
  Submitted by:	Jeff Trawick, Joe Orton, Colm MacCárthaigh <colm@stdlib.net>
  
  Revision  Changes    Path
  1.467     +4 -0      apr/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apr/CHANGES,v
  retrieving revision 1.466
  retrieving revision 1.467
  diff -u -r1.466 -r1.467
  --- CHANGES	5 May 2004 03:00:28 -0000	1.466
  +++ CHANGES	20 May 2004 14:53:21 -0000	1.467
  @@ -7,6 +7,10 @@
   
   Changes with APR 1.0
   
  +  *) Don't assume getnameinfo() can handle IPv4-mapped IPv6 addresses
  +     on any platforms.
  +     [Jeff Trawick, Joe Orton, Colm MacCárthaigh <colm@stdlib.net>]
  +
     *) Add new functions apr_signal_block, apr_signal_unblock to block/unblock
        the delivery of a particular signal.  [Madhusudan Mathihalli]
   
  
  
  
  1.580     +0 -1      apr/configure.in
  
  Index: configure.in
  ===================================================================
  RCS file: /home/cvs/apr/configure.in,v
  retrieving revision 1.579
  retrieving revision 1.580
  diff -u -r1.579 -r1.580
  --- configure.in	16 Apr 2004 16:32:25 -0000	1.579
  +++ configure.in	20 May 2004 14:53:21 -0000	1.580
  @@ -1885,7 +1885,6 @@
           if test "x$have_sockaddr_in6" = "x1"; then
               if test "x$ac_cv_working_getaddrinfo" = "xyes"; then
                   if test "x$ac_cv_working_getnameinfo" = "xyes"; then
  -                    APR_CHECK_GETNAMEINFO_IPV4_MAPPED
                       APR_CHECK_GETADDRINFO_ADDRCONFIG
                       have_ipv6="1"
                       ipv6_result="yes"
  
  
  
  1.31      +0 -74     apr/build/apr_network.m4
  
  Index: apr_network.m4
  ===================================================================
  RCS file: /home/cvs/apr/build/apr_network.m4,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- apr_network.m4	23 Dec 2003 14:54:55 -0000	1.30
  +++ apr_network.m4	20 May 2004 14:53:21 -0000	1.31
  @@ -175,80 +175,6 @@
   ])
   
   dnl
  -dnl check for getnameinfo() that properly resolves IPv4-mapped IPv6 addresses
  -dnl
  -dnl Darwin is known not to map them correctly
  -dnl
  -AC_DEFUN(APR_CHECK_GETNAMEINFO_IPV4_MAPPED,[
  -  AC_CACHE_CHECK(whether getnameinfo resolves IPv4-mapped IPv6 addresses,
  -                 ac_cv_getnameinfo_ipv4_mapped,[
  -  AC_TRY_RUN( [
  -#ifdef HAVE_NETDB_H
  -#include <netdb.h>
  -#endif
  -#ifdef HAVE_STRING_H
  -#include <string.h>
  -#endif
  -#ifdef HAVE_SYS_TYPES_H
  -#include <sys/types.h>
  -#endif
  -#ifdef HAVE_SYS_SOCKET_H
  -#include <sys/socket.h>
  -#endif
  -#ifdef HAVE_NETINET_IN_H
  -#include <netinet/in.h>
  -#endif
  -#ifdef HAVE_ARPA_INET_H
  -#include <arpa/inet.h>
  -#endif
  -
  -void main(void) {
  -    struct sockaddr_in6 sa = {0};
  -    struct in_addr ipv4;
  -#if defined(NI_MAXHOST)
  -    char hbuf[NI_MAXHOST];
  -#else
  -    char hbuf[256];
  -#endif
  -    unsigned int *addr32;
  -    int error;
  -
  -    ipv4.s_addr = inet_addr("127.0.0.1");
  -
  -    sa.sin6_family = AF_INET6;
  -    sa.sin6_port = 0;
  -
  -    addr32 = (unsigned int *)&sa.sin6_addr;
  -    addr32[2] = htonl(0x0000FFFF);
  -    addr32[3] = ipv4.s_addr;
  -
  -#ifdef SIN6_LEN
  -    sa.sin6_len = sizeof(sa);
  -#endif
  -
  -    error = getnameinfo((const struct sockaddr *)&sa, sizeof(sa),
  -                        hbuf, sizeof(hbuf), NULL, 0,
  -                        NI_NAMEREQD);
  -    if (error) {
  -        exit(1);
  -    } else {
  -        exit(0);
  -    }
  -}
  -],[
  -  ac_cv_getnameinfo_ipv4_mapped="yes"
  -],[
  -  ac_cv_getnameinfo_ipv4_mapped="no"
  -],[
  -  ac_cv_getnameinfo_ipv4_mapped="yes"
  -])])
  -if test "$ac_cv_getnameinfo_ipv4_mapped" = "no"; then
  -  AC_DEFINE(GETNAMEINFO_IPV4_MAPPED_FAILS, 1,
  -            [Define if getnameinfo does not map IPv4 address correctly])
  -fi
  -])
  -
  -dnl
   dnl Checks the definition of gethostbyname_r and gethostbyaddr_r
   dnl which are different for glibc, solaris and assorted other operating
   dnl systems
  
  
  
  1.50      +3 -4      apr/network_io/unix/sockaddr.c
  
  Index: sockaddr.c
  ===================================================================
  RCS file: /home/cvs/apr/network_io/unix/sockaddr.c,v
  retrieving revision 1.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- sockaddr.c	4 Mar 2004 16:17:25 -0000	1.49
  +++ sockaddr.c	20 May 2004 14:53:21 -0000	1.50
  @@ -575,11 +575,10 @@
        * a numeric address string if it fails to resolve the host name;
        * that is *not* what we want here
        *
  -     * Additionally, if we know getnameinfo() doesn't handle IPv4-mapped
  -     * IPv6 addresses correctly, drop down to IPv4 before calling
  -     * getnameinfo().
  +     * For IPv4-mapped IPv6 addresses, drop down to IPv4 before calling
  +     * getnameinfo() to avoid getnameinfo bugs (MacOS X, glibc).
        */
  -#ifdef GETNAMEINFO_IPV4_MAPPED_FAILS
  +#if APR_HAVE_IPV6
       if (sockaddr->family == AF_INET6 &&
           IN6_IS_ADDR_V4MAPPED(&sockaddr->sa.sin6.sin6_addr)) {
           struct apr_sockaddr_t tmpsa;
  
  
  

Mime
View raw message