]> 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)
main/network.c

index fe1c877d542444646b80c96912854398dec72743..b7efba1da975a081a93159b326399c5c3eabe588 100644 (file)
@@ -792,7 +792,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);