summaryrefslogtreecommitdiff
path: root/sql/hostname.cc
diff options
context:
space:
mode:
authorjoerg@mysql.com <>2005-07-27 13:01:48 +0200
committerjoerg@mysql.com <>2005-07-27 13:01:48 +0200
commitbcace631ee92deb3b6f5b269809fa863cc9afa36 (patch)
tree151accb35c2f28d1c746a9ed7d1ca5efbd32a479 /sql/hostname.cc
parente15dd022415d5da2186c7b23c1761cf1b044bede (diff)
downloadmariadb-git-bcace631ee92deb3b6f5b269809fa863cc9afa36.tar.gz
Fix shortcircuit of 127.0.0.1 -> localhost lookup on little-endian machines. (Bug #11822)
(Originally: 1.1891 05/07/25 12:07:47 jimw@mysql.com )
Diffstat (limited to 'sql/hostname.cc')
-rw-r--r--sql/hostname.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/hostname.cc b/sql/hostname.cc
index 12b69a97859..3b1eeb63d37 100644
--- a/sql/hostname.cc
+++ b/sql/hostname.cc
@@ -143,8 +143,8 @@ my_string ip_to_hostname(struct in_addr *in, uint *errors)
*errors=0;
/* We always treat the loopback address as "localhost". */
- if (in->s_addr == INADDR_LOOPBACK)
- return (char *)my_localhost;
+ if (in->s_addr == htonl(INADDR_LOOPBACK)) // is expanded inline by gcc
+ DBUG_RETURN((char *)my_localhost);
/* Check first if we have name in cache */
if (!(specialflag & SPECIAL_NO_HOST_CACHE))