]> granicus.if.org Git - php/commitdiff
Fixed bug #48805 (IPv6 socket transport is not working).
authorIlia Alshanetsky <iliaa@php.net>
Wed, 30 Sep 2009 20:48:41 +0000 (20:48 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Wed, 30 Sep 2009 20:48:41 +0000 (20:48 +0000)
NEWS
main/network.c

diff --git a/NEWS b/NEWS
index 61701bac221f8771ee8a37d74fbce81b7742f542..64139dfad6d15ce3ecbfac86812ec32c53254874 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -19,6 +19,7 @@
   of a multibyte character). (Moriyoshi)
 - Fixed bug #49528 (UTF-16 strings prefixed by BOMs wrondly converted).
   (Moriyoshi)
+- Fixed bug #48805 (IPv6 socket transport is not working). (Ilia)
 
 17 Sep 2009, PHP 5.2.11
 - Fixed certificate validation inside php_openssl_apply_verification_policy.
index 7269a51ae8d8e075039e3a3a0d027ca71043db84..33b81d1d7788971a18ead09c842c356e7ab5e9c1 100644 (file)
@@ -786,7 +786,7 @@ php_socket_t php_network_connect_socket_to_host(const char *host, unsigned short
                switch (sa->sa_family) {
 #if HAVE_GETADDRINFO && HAVE_IPV6
                        case AF_INET6:
-                               if (bindto && strchr(bindto, ':')) {
+                               if (!bindto || strchr(bindto, ':')) {
                                        ((struct sockaddr_in6 *)sa)->sin6_family = sa->sa_family;
                                        ((struct sockaddr_in6 *)sa)->sin6_port = htons(port);
                                        socklen = sizeof(struct sockaddr_in6);