apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jor...@apache.org
Subject cvs commit: apr/network_io/unix sockaddr.c
Date Thu, 04 Mar 2004 16:17:25 GMT
jorton      2004/03/04 08:17:25

  Modified:    network_io/unix sockaddr.c
  Log:
  Workaround odd behaviour of AF_UNSPEC lookups with AI_PASSIVE set on
  some old versions of glibc:
  
  * network_io/sockets/sockaddr.c (call_resolver): Ignore anything other
  than AF_INET and AF_INET6 addresses.
  
  Revision  Changes    Path
  1.49      +11 -1     apr/network_io/unix/sockaddr.c
  
  Index: sockaddr.c
  ===================================================================
  RCS file: /home/cvs/apr/network_io/unix/sockaddr.c,v
  retrieving revision 1.48
  retrieving revision 1.49
  diff -w -d -u -r1.48 -r1.49
  --- sockaddr.c	13 Feb 2004 09:38:33 -0000	1.48
  +++ sockaddr.c	4 Mar 2004 16:17:25 -0000	1.49
  @@ -352,7 +352,17 @@
       prev_sa = NULL;
       ai = ai_list;
       while (ai) { /* while more addresses to report */
  -        apr_sockaddr_t *new_sa = apr_pcalloc(p, sizeof(apr_sockaddr_t));
  +        apr_sockaddr_t *new_sa;
  +
  +        /* Ignore anything bogus: getaddrinfo in some old versions of
  +         * glibc will return AF_UNIX entries for AF_UNSPEC+AI_PASSIVE
  +         * lookups. */
  +        if (ai->ai_family != AF_INET && ai->ai_family != AF_INET6) {
  +            ai = ai->ai_next;
  +            continue;
  +        }
  +
  +        new_sa = apr_pcalloc(p, sizeof(apr_sockaddr_t));
   
           new_sa->pool = p;
           memcpy(&new_sa->sa, ai->ai_addr, ai->ai_addrlen);
  
  
  

Mime
View raw message