apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@locus.apache.org
Subject cvs commit: apr/network_io/unix sa_common.c
Date Wed, 13 Dec 2000 22:17:22 GMT
trawick     00/12/13 14:17:22

  Modified:    network_io/unix sa_common.c
  Log:
  apr_get_ipaddr(): return IPv4-style strings for IPv4-mapped IPv6 addresses
  
  Revision  Changes    Path
  1.18      +10 -0     apr/network_io/unix/sa_common.c
  
  Index: sa_common.c
  ===================================================================
  RCS file: /home/cvs/apr/network_io/unix/sa_common.c,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- sa_common.c	2000/12/08 14:52:33	1.17
  +++ sa_common.c	2000/12/13 22:17:20	1.18
  @@ -117,6 +117,16 @@
                     sockaddr->ipaddr_ptr,
                     *addr,
                     sockaddr->addr_str_len);
  +#if APR_HAVE_IPV6
  +    if (sockaddr->sa.sin.sin_family == AF_INET6 &&
  +        IN6_IS_ADDR_V4MAPPED(sockaddr->ipaddr_ptr)) {
  +        /* This is an IPv4-mapped IPv6 address; drop the leading
  +         * part of the address string so we're left with the familiar
  +         * IPv4 format.
  +         */
  +        *addr += strlen("::ffff:");
  +    }
  +#endif
       return APR_SUCCESS;
   }
   
  
  
  

Mime
View raw message