From: Date: February 12 2008 1:46pm Subject: bk commit into 6.0 tree (vvaintroub:1.2551) BUG#34381 List-Archive: http://lists.mysql.com/commits/42103 X-Bug: 34381 Message-Id: <200802121246.m1CCkC6Q007278@mail.mysql.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Below is the list of changes that have just been committed into a local= =0A6.0 repository of vvaintroub. When vvaintroub does a push these changes= =0Awill be propagated to the main repository and, within 24 hours after= the=0Apush, to the public repository.=0AFor information on how to access= the public repository=0Asee http://dev.mysql.com/doc/mysql/en/installing-source-tree.html= =0A=0AChangeSet@stripped, 2008-02-12 13:45:47+01:00, vvaintroub@wva. +2 -0= =0A Bug#34381=0A Client application cannot connect to server on Windows= Vista=0A The problem was that the server is creating an IPv6 socket and= listens=0A only to IPv6 traffic. If an older client application tries= to connect to=0A server using IPv4 address (like 127.0.0.1 for localhost),= it fails.=0A =0A The solution is to clear IPV6_V6ONLY socket option before= bind() - in =0A this case we will have dual-mode socket that accepts both= IPv4 and IPv6=0A traffic. =0A This is done for all operating systems= where IPV6_V6ONLY is defined.=0A Although RFC3493 recommends to set IPV6_V6ONLY= "off" by default and many =0A follow the recommendation, on Vista it is= "on" for compatibility reasons =0A (separate IPv4 and IPv6 stacks in prior= version). On FreeBSD the setting=0A can be controlled via sysctrl=0A= =0A include/config-win.h@stripped, 2008-02-12 13:45:45+01:00, vvaintroub@wva.= +5 -0=0A Ensure IPV6_V6ONLY is defined,also when using pre-Vista Platform= SDKs.=0A=0A sql/mysqld.cc@stripped, 2008-02-12 13:45:45+01:00, vvaintroub@wva.= +17 -1=0A Clear IPV6_V6ONLY flag for IPV6 listening socket to =0A = ensure compatibility with existing clients. On many operating systems= =0A like Linux it is not needed (dual mode socket is default), but at= least=0A Windows Vista requires it.=0A=0Adiff -Nrup a/include/config-win.h= b/include/config-win.h=0A--- a/include/config-win.h 2007-12-18 15:36:13= +01:00=0A+++ b/include/config-win.h 2008-02-12 13:45:45 +01:00=0A@@ -93,6= +93,11 @@ functions */=0A =0A #define S_IROTH S_IREAD /* for my_lib */= =0A =0A+/* Winsock2 constant (Vista SDK and later)*/=0A+#ifndef IPV6_V6ONLY= =0A+#define IPV6_V6ONLY 27=0A+#endif=0A+=0A #ifdef __BORLANDC__=0A #define= FILE_BINARY O_BINARY /* my_fopen in binary mode */=0A #define O_TEMPORARY= 0=0Adiff -Nrup a/sql/mysqld.cc b/sql/mysqld.cc=0A--- a/sql/mysqld.cc 2008-02-08= 17:02:57 +01:00=0A+++ b/sql/mysqld.cc 2008-02-12 13:45:45 +01:00=0A@@ -1612,7= +1612,7 @@ static void network_init(void)=0A #ifdef HAVE_SYS_UN_H=0A = struct sockaddr_un UNIXaddr;=0A #endif=0A- int arg=3D1;=0A+ int arg;= =0A int ret;=0A uint waited;=0A uint this_wait;=0A@@ -1663,8 +1663,23= @@ static void network_init(void)=0A We should not use SO_REUSEADDR= on windows as this would enable a=0A user to open two mysqld servers= with the same TCP/IP port.=0A */=0A+ arg=3D 1;=0A (void) setsockopt(ip_sock,SOL_SOCKET,SO_REUSEADDR,(char*)&arg,sizeof(arg));= =0A #endif /* __WIN__ */=0A+=0A+#ifdef IPV6_V6ONLY=0A+ /*=0A+ = For interoperability with older clients, IPv6 socket should=0A+ listen= on both IPv6 and IPv4 wildcard addresses.=0A+ Turn off IPV6_V6ONLY= option.=0A+ */=0A+ if (ai->ai_family =3D=3D AF_INET6)=0A+ {=0A+= arg=3D 0; =0A+ (void) setsockopt(ip_sock, IPPROTO_IPV6,= IPV6_V6ONLY, (char*)&arg,=0A+ sizeof(arg));=0A+ }=0A+#endif= =0A /*=0A Sometimes the port is not released fast enough when= stopping and=0A restarting the server. This happens quite often with= the test suite=0A@@ -1773,6 +1788,7 @@ static void network_init(void)=0A= UNIXaddr.sun_family =3D AF_UNIX;=0A strmov(UNIXaddr.sun_path, mysqld_unix_port);= =0A (void) unlink(mysqld_unix_port);=0A+ arg=3D 1;=0A (void)= setsockopt(unix_sock,SOL_SOCKET,SO_REUSEADDR,(char*)&arg,=0A sizeof(arg));= =0A umask(0);=0A