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 vhost.c
Date Tue, 20 Nov 2001 18:27:07 GMT
trawick     01/11/20 10:27:07

  Modified:    .        CHANGES
               server   vhost.c
  Log:
  Get IPv6 vhosts working (again ?).
  
  There were a couple of bogus IPv4-specific comparisons which prevented
  the data structures from being built correctly in ap_fini_vhost_config().
  One of these (INADDR_ANY) can be easily rewritten to work with IPv6.  The
  other (DEFAULT_VHOST_ADDR) isn't necessary for IPv6.  Note that this is
  because we don't support the various flavors of _default_ that
  Apache-1.3+KAME-patch supports.
  
  PR:      8118
  
  Revision  Changes    Path
  1.446     +2 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.445
  retrieving revision 1.446
  diff -u -r1.445 -r1.446
  --- CHANGES	2001/11/20 03:20:26	1.445
  +++ CHANGES	2001/11/20 18:27:07	1.446
  @@ -1,5 +1,7 @@
   Changes with Apache 2.0.29-dev
   
  +  *) Fix a problem with IPv6 vhosts.  PR #8118  [Jeff Trawick]
  +
     *) Optimization for the BNDM string-search function in
        mod_include.  [Brian Pane]
   
  
  
  
  1.63      +4 -2      httpd-2.0/server/vhost.c
  
  Index: vhost.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/vhost.c,v
  retrieving revision 1.62
  retrieving revision 1.63
  diff -u -r1.62 -r1.63
  --- vhost.c	2001/11/12 23:49:07	1.62
  +++ vhost.c	2001/11/20 18:27:07	1.63
  @@ -615,9 +615,11 @@
           has_default_vhost_addr = 0;
           for (sar = s->addrs; sar; sar = sar->next) {
               ipaddr_chain *ic;
  +            char inaddr_any[16] = {0}; /* big enough to handle IPv4 or IPv6 */
   
  -            if (sar->host_addr->sa.sin.sin_addr.s_addr == DEFAULT_VHOST_ADDR
  -                || sar->host_addr->sa.sin.sin_addr.s_addr == INADDR_ANY) {
  +            if ((sar->host_addr->family == AF_INET &&
  +                 sar->host_addr->sa.sin.sin_addr.s_addr == DEFAULT_VHOST_ADDR)
  +                || !memcmp(sar->host_addr->ipaddr_ptr, inaddr_any, sar->host_addr->ipaddr_len))
{
                   ic = find_default_server(sar->host_port);
                   if (!ic || !add_name_vhost_config(p, main_s, s, sar, ic)) {
                       if (ic && ic->sar->host_port != 0) {
  
  
  

Mime
View raw message