]> granicus.if.org Git - php/commitdiff
- Merge: Fixed bug #48805 (IPv6 socket transport is not working)
authorPierre Joye <pajoye@php.net>
Sat, 10 Oct 2009 12:21:08 +0000 (12:21 +0000)
committerPierre Joye <pajoye@php.net>
Sat, 10 Oct 2009 12:21:08 +0000 (12:21 +0000)
main/network.c

index 9f8c729e807e80fab012ea2a902ea45ae83f0458..fcadcafbeaae0f1620897e1ff1308f5bbf9d6824 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);