Changes with Apache 2.3.14
+ *) core: For '*' or '_default_' vhosts, use a wildcard address of any
+ address family, rather than IPv4 only. [Joe Orton]
+
*) core, mod_rewrite, mod_ssl, mod_nw_ssl: Make the SERVER_NAME variable
include [ ] for literal IPv6 addresses, as mandated by RFC 3875.
PR 26005. [Stefan Fritsch]
}
if (strcmp(host, "*") == 0 || strcasecmp(host, "_default_") == 0) {
- rv = apr_sockaddr_info_get(&my_addr, "0.0.0.0", APR_INET, port, 0, p);
+ rv = apr_sockaddr_info_get(&my_addr, NULL, APR_UNSPEC, port, 0, p);
if (rv) {
- return "Could not resolve address '0.0.0.0' -- "
+ return "Could not determine a wildcard address ('0.0.0.0') -- "
"check resolver configuration.";
}
}
return wild_match;
}
+#if APR_HAVE_IPV6
+#define IS_IN6_ANYADDR(ad) ((ad)->family == APR_INET6 \
+ && IN6_IS_ADDR_UNSPECIFIED(&(ad)->sa.sin6.sin6_addr))
+#else
+#define IS_IN6_ANYADDR(ad) (0)
+#endif
+
static void dump_a_vhost(apr_file_t *f, ipaddr_chain *ic)
{
name_chain *nc;
char buf[MAX_STRING_LEN];
apr_sockaddr_t *ha = ic->sar->host_addr;
- if (ha->family == APR_INET &&
- ha->sa.sin.sin_addr.s_addr == INADDR_ANY) {
+ if ((ha->family == APR_INET && ha->sa.sin.sin_addr.s_addr == INADDR_ANY)
+ || IS_IN6_ANYADDR(ha)) {
len = apr_snprintf(buf, sizeof(buf), "*:%u",
ic->sar->host_port);
}