From bcace631ee92deb3b6f5b269809fa863cc9afa36 Mon Sep 17 00:00:00 2001 From: "joerg@mysql.com" <> Date: Wed, 27 Jul 2005 13:01:48 +0200 Subject: 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 ) --- sql/hostname.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sql/hostname.cc') 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)) -- cgit v1.2.1