#At file:///mnt/raid/alik/MySQL/bzr/bug38247/azalea-bf-bug45584/ based on revid:alik@stripped
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
=== 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 commit into mysql branch (alik:2852) Bug#45584 | Alexander Nozdrin | 10 Aug |