--- server/core.c 2011-09-08 17:59:38.000000000 +0200 +++ ../../httpd-2.2.21/server/core.c 2011-11-21 14:44:50.816044547 +0100 @@ -2345,7 +2345,7 @@ static const char *server_hostname_port(cmd_parms *cmd, void *dummy, const char *arg) { const char *err = ap_check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE|NOT_IN_LIMIT); - const char *portstr, *part; + const char *portstr, *part, *ipv6hostend; char *scheme; int port; @@ -2364,10 +2364,19 @@ part = arg; } - portstr = ap_strchr_c(part, ':'); + ipv6hostend = ap_strchr_c(part, ']'); + if (ipv6hostend != NULL ) { + portstr = ap_strchr_c(ipv6hostend, ':'); + } else { + portstr = ap_strchr_c(part, ':'); + } if (portstr) { cmd->server->server_hostname = apr_pstrmemdup(cmd->pool, part, portstr - part); + if ((ipv6hostend != NULL ) && (part[0] == '[')) { + cmd->server->server_hostname = apr_pstrmemdup(cmd->pool, part + 1, + ipv6hostend - part - 1); + } portstr++; port = atoi(portstr); if (port <= 0 || port >= 65536) { /* 65536 == 1<<16 */