]> granicus.if.org Git - apache/commitdiff
name-based vhosts listed twice with apachectl -S
authorEric Covener <covener@apache.org>
Fri, 20 Sep 2013 13:36:33 +0000 (13:36 +0000)
committerEric Covener <covener@apache.org>
Fri, 20 Sep 2013 13:36:33 +0000 (13:36 +0000)
When processing a vhost with * or _default_, we'd add the "names" once
for 0.0.0.0 and once for [::], but these are stored in the same "default"
ip chain.  Catch the back-to-back wildcard + same port and short-circuit the
second add.

Submitted By: rjung
Committed By: covener

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1525000 13f79535-47bb-0310-9956-ffa450edef68

server/vhost.c

index 2aadc3efbd471bec5afe1578b80ca82f4d20a099..eab2e194c1045bcfff61071d5e283dc075d4ccf1 100644 (file)
@@ -587,7 +587,8 @@ AP_DECLARE(void) ap_fini_vhost_config(apr_pool_t *p, server_rec *main_s)
                 ic = find_default_server(sar->host_port);
 
                 if (ic && sar->host_port == ic->sar->host_port) { /* we're a match for an existing "default server"  */
-                    if (!sar_prev || memcmp(sar_prev->host_addr->ipaddr_ptr, inaddr_any, sar_prev->host_addr->ipaddr_len)) { 
+                    if (!sar_prev || memcmp(sar_prev->host_addr->ipaddr_ptr, inaddr_any, sar_prev->host_addr->ipaddr_len)
+                                  || sar_prev->host_port != sar->host_port) { 
                         add_name_vhost_config(p, main_s, s, sar, ic);
                     }
                 }