List:Commits« Previous MessageNext Message »
From:Alexander Nozdrin Date:August 10 2009 12:31pm
Subject:bzr push into mysql branch (alik:2851 to 2852) Bug#45584
View as plain text  
 2852 Alexander Nozdrin	2009-08-10
      Another postfix for Bug#45584: convert value to host-byte-order before
      comparing with the INADDR_LOOPBACK constant.

    modified:
      sql/hostname.cc
      vio/viosocket.c
 2851 Alexander Nozdrin	2009-08-10
      Enable skip_name_resolve.test that was disabled due to Bug#43006
      (which is now fixed).

    modified:
      mysql-test/t/disabled.def
=== modified file 'sql/hostname.cc'
--- a/sql/hostname.cc	2009-08-10 04:17:39 +0000
+++ b/sql/hostname.cc	2009-08-10 12:31:13 +0000
@@ -223,7 +223,7 @@ static inline bool is_ip_loopback(const 
     {
       /* Check for IPv4 127.0.0.1. */
       struct in_addr *ip4= &((struct sockaddr_in *) ip)->sin_addr;
-      return ip4->s_addr == INADDR_LOOPBACK;
+      return ntohl(ip4->s_addr) == INADDR_LOOPBACK;
     }
 
 #ifdef HAVE_IPV6

=== modified file 'vio/viosocket.c'
--- a/vio/viosocket.c	2009-08-10 04:17:39 +0000
+++ b/vio/viosocket.c	2009-08-10 12:31:13 +0000
@@ -457,7 +457,7 @@ my_bool vio_peer_addr(Vio *vio, char *ip
     vio->remote.ss_family= AF_INET;
     vio->addrLen= sizeof (struct sockaddr_in);
 
-    ip4->s_addr= INADDR_LOOPBACK;
+    ip4->s_addr= htonl(INADDR_LOOPBACK);
 
     /* Initialize ip_buffer and port. */
 


Attachment: [text/bzr-bundle] bzr/alik@sun.com-20090810123113-ccdjwai68b5woqdm.bundle
Thread
bzr push into mysql branch (alik:2851 to 2852) Bug#45584Alexander Nozdrin10 Aug