- sync php-fpm configuration with upstream

- refresh upstream patch for 68421
This commit is contained in:
Remi Collet 2014-11-17 07:12:18 +01:00
parent 5a0a91817e
commit e363175e30
3 changed files with 53 additions and 3 deletions

View File

@ -70,3 +70,49 @@ index 4e1a057..c71281b 100644
-- --
2.1.0 2.1.0
From 4657289e87e18bb8967d5a8b0163c772d410e2b8 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@php.net>
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

View File

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

View File

@ -62,7 +62,7 @@
Summary: PHP scripting language for creating dynamic web sites Summary: PHP scripting language for creating dynamic web sites
Name: php Name: php
Version: 5.6.3 Version: 5.6.3
Release: 2%{?dist} Release: 3%{?dist}
# All files licensed under PHP version 3.01, except # All files licensed under PHP version 3.01, except
# Zend is licensed under Zend # Zend is licensed under Zend
# TSRM is licensed under BSD # TSRM is licensed under BSD
@ -1482,6 +1482,10 @@ rm -f README.{Zeus,QNX,CVS-RULES}
%changelog %changelog
* Mon Nov 17 2014 Remi Collet <remi@fedoraproject.org> 5.6.3-3
- sync php-fpm configuration with upstream
- refresh upstream patch for 68421
* Sun Nov 16 2014 Remi Collet <remi@fedoraproject.org> 5.6.3-2 * Sun Nov 16 2014 Remi Collet <remi@fedoraproject.org> 5.6.3-2
- FPM: add upstream patch for https://bugs.php.net/68421 - FPM: add upstream patch for https://bugs.php.net/68421
access.format=R doesn't log ipv6 address access.format=R doesn't log ipv6 address