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:
@@ -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;
|
||||
}
|
||||
/* }}} */
|
||||
/*
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user