From: Eric Covener Date: Fri, 20 Sep 2013 13:36:33 +0000 (+0000) Subject: name-based vhosts listed twice with apachectl -S X-Git-Tag: 2.5.0-alpha~5040 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f889cb92be0339ea75eebff0b97dce73372d6260;p=apache name-based vhosts listed twice with apachectl -S 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 --- diff --git a/server/vhost.c b/server/vhost.c index 2aadc3efbd..eab2e194c1 100644 --- a/server/vhost.c +++ b/server/vhost.c @@ -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); } }