iliaa           Mon May  4 13:12:53 2009 UTC

  Modified files:              
    /php-src/main       network.c 
  Log:
  
  MFB: Fixed bug #48131 (Don't try to bind ipv4 addresses to ipv6 ips via
  bindto)
  
http://cvs.php.net/viewvc.cgi/php-src/main/network.c?r1=1.142&r2=1.143&diff_format=u
Index: php-src/main/network.c
diff -u php-src/main/network.c:1.142 php-src/main/network.c:1.143
--- php-src/main/network.c:1.142        Tue Mar 10 23:39:53 2009
+++ php-src/main/network.c      Mon May  4 13:12:53 2009
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: network.c,v 1.142 2009/03/10 23:39:53 helly Exp $ */
+/* $Id: network.c,v 1.143 2009/05/04 13:12:53 iliaa Exp $ */
 
 /*#define DEBUG_MAIN_NETWORK 1*/
 
@@ -792,9 +792,14 @@
                switch (sa->sa_family) {
 #if HAVE_GETADDRINFO && HAVE_IPV6
                        case AF_INET6:
-                               ((struct sockaddr_in6 *)sa)->sin6_family = 
sa->sa_family;
-                               ((struct sockaddr_in6 *)sa)->sin6_port = 
htons(port);
-                               socklen = sizeof(struct sockaddr_in6);
+                               if (strstr(bindto, ':')) {
+                                       ((struct sockaddr_in6 
*)sa)->sin6_family = sa->sa_family;
+                                       ((struct sockaddr_in6 *)sa)->sin6_port 
= htons(port);
+                                       socklen = sizeof(struct sockaddr_in6);
+                               } else {
+                                       socklen = 0;
+                                       sa = NULL;
+                               }
                                break;
 #endif
                        case AF_INET:



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to