From e363175e30ecaeb2588f4ace0fe0a4e5bbc7d57c Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 17 Nov 2014 07:12:18 +0100 Subject: [PATCH] - sync php-fpm configuration with upstream - refresh upstream patch for 68421 --- php-bug68421.patch | 46 ++++++++++++++++++++++++++++++++++++++++++++++ php-fpm-www.conf | 4 ++-- php.spec | 6 +++++- 3 files changed, 53 insertions(+), 3 deletions(-) diff --git a/php-bug68421.patch b/php-bug68421.patch index 0f59efd..80437ba 100644 --- a/php-bug68421.patch +++ b/php-bug68421.patch @@ -70,3 +70,49 @@ index 4e1a057..c71281b 100644 -- 2.1.0 +From 4657289e87e18bb8967d5a8b0163c772d410e2b8 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Mon, 17 Nov 2014 06:53:38 +0100 +Subject: [PATCH] Improve fix bug #68421 access.format='%R' doesn't log ipv6 + address + +Log IPv4-Mapped-Ipv6 address as IPv4 (not as IPv6) +--- + sapi/fpm/fpm/fastcgi.c | 18 ++++++++++++++---- + 1 file changed, 14 insertions(+), 4 deletions(-) + +diff --git a/sapi/fpm/fpm/fastcgi.c b/sapi/fpm/fpm/fastcgi.c +index 86fca17..d1db0ec 100644 +--- a/sapi/fpm/fpm/fastcgi.c ++++ b/sapi/fpm/fpm/fastcgi.c +@@ -1099,13 +1099,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; + } + /* }}} */ + /* +-- +2.1.0 + diff --git a/php-fpm-www.conf b/php-fpm-www.conf index 727e457..97dd746 100644 --- a/php-fpm-www.conf +++ b/php-fpm-www.conf @@ -32,8 +32,8 @@ group = apache ; 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 diff --git a/php.spec b/php.spec index f038fc8..c678a4a 100644 --- a/php.spec +++ b/php.spec @@ -62,7 +62,7 @@ Summary: PHP scripting language for creating dynamic web sites Name: php Version: 5.6.3 -Release: 2%{?dist} +Release: 3%{?dist} # All files licensed under PHP version 3.01, except # Zend is licensed under Zend # TSRM is licensed under BSD @@ -1482,6 +1482,10 @@ rm -f README.{Zeus,QNX,CVS-RULES} %changelog +* Mon Nov 17 2014 Remi Collet 5.6.3-3 +- sync php-fpm configuration with upstream +- refresh upstream patch for 68421 + * Sun Nov 16 2014 Remi Collet 5.6.3-2 - FPM: add upstream patch for https://bugs.php.net/68421 access.format=R doesn't log ipv6 address