1
0
mirror of https://github.com/php/php-src.git synced 2026-03-31 20:53:00 +02:00

Merge branch 'PHP-5.6'

* PHP-5.6:
  comment about ipv4-mapped in fpm conf
  Improve fix bug #68421 access.format='%R' doesn't log ipv6 address
This commit is contained in:
Remi Collet
2014-11-17 06:59:03 +01:00
2 changed files with 16 additions and 6 deletions

View File

@@ -1078,13 +1078,23 @@ const char *fcgi_get_last_client_ip() /* {{{ */
{
static char str[INET6_ADDRSTRLEN];
if (client_sa.sa.sa_family == AF_UNIX) {
return NULL;
}
/* Ipv4 */
if (client_sa.sa.sa_family == AF_INET) {
return inet_ntop(client_sa.sa.sa_family, &client_sa.sa_inet.sin_addr, str, INET6_ADDRSTRLEN);
}
return inet_ntop(client_sa.sa.sa_family, &client_sa.sa_inet6.sin6_addr, str, INET6_ADDRSTRLEN);
#ifdef IN6_IS_ADDR_V4MAPPED
/* Ipv4-Mapped-Ipv6 */
if (client_sa.sa.sa_family == AF_INET6
&& IN6_IS_ADDR_V4MAPPED(&client_sa.sa_inet6.sin6_addr)) {
return inet_ntop(AF_INET, ((char *)&client_sa.sa_inet6.sin6_addr)+12, str, INET6_ADDRSTRLEN);
}
#endif
/* Ipv6 */
if (client_sa.sa.sa_family == AF_INET6) {
return inet_ntop(client_sa.sa.sa_family, &client_sa.sa_inet6.sin6_addr, str, INET6_ADDRSTRLEN);
}
/* Unix socket */
return NULL;
}
/* }}} */
/*

View File

@@ -156,8 +156,8 @@ group = @php_fpm_group@
; a specific port;
; 'port' - to listen on a TCP socket to all IPv4 addresses on a
; specific port;
; '[::]:port' - to listen on a TCP socket to all addresses on a
; specific port;
; '[::]:port' - to listen on a TCP socket to all addresses
; (IPv6 and IPv4-mapped) on a specific port;
; '/path/to/unix/socket' - to listen on a unix socket.
; Note: This value is mandatory.
listen = 127.0.0.1:9000