httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject cvs commit: httpd-2.0/server core.c
Date Thu, 27 Dec 2001 13:28:42 GMT
trawick     01/12/27 05:28:42

  Modified:    server   core.c
  Log:
  avoid some ugly sockaddr comparisons in do_double_reverse() by using
  apr_sockaddr_equal()
  
  Revision  Changes    Path
  1.122     +1 -15     httpd-2.0/server/core.c
  
  Index: core.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/core.c,v
  retrieving revision 1.121
  retrieving revision 1.122
  diff -u -r1.121 -r1.122
  --- core.c	2001/12/18 13:48:52	1.121
  +++ core.c	2001/12/27 13:28:42	1.122
  @@ -592,24 +592,10 @@
       rv = apr_sockaddr_info_get(&sa, conn->remote_host, APR_UNSPEC, 0, 0, conn->pool);
       if (rv == APR_SUCCESS) {
           while (sa) {
  -            if (sa->ipaddr_len == conn->remote_addr->ipaddr_len &&
  -                !memcmp(sa->ipaddr_ptr, conn->remote_addr->ipaddr_ptr,
  -                        sa->ipaddr_len)) {
  +            if (apr_sockaddr_equal(sa, conn->remote_addr)) {
                   conn->double_reverse = 1;
                   return;
               }
  -#if APR_HAVE_IPV6
  -            /* match IPv4-mapped IPv6 addresses with IPv4 A record */
  -            if (conn->remote_addr->sa.sin.sin_family == APR_INET6 &&
  -                sa->sa.sin.sin_family == APR_INET &&
  -                IN6_IS_ADDR_V4MAPPED((struct in6_addr *)conn->remote_addr->ipaddr_ptr)
&&
  -                !memcmp(&((struct in6_addr *)conn->remote_addr->ipaddr_ptr)->s6_addr[12],
  -                        sa->ipaddr_ptr,
  -                        sizeof (((struct in_addr *)0)->s_addr))) {
  -                conn->double_reverse = 1;
  -                return;
  -            }
  -#endif
               sa = sa->next;
           }
       }
  
  
  

Mime
View raw message