From 72490191019af446fccf3bd44ffb6b1a7519fc4c Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 6 May 2005 12:18:37 +0300 Subject: [PATCH] A fix for Bug#8467. BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- BitKeeper/etc/logging_ok | 1 + sql/hostname.cc | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index 2e341a5e820..e8f1c57bd24 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -86,6 +86,7 @@ jani@dsl-jkl1657.dial.inet.fi jani@dsl-kpogw4gb5.dial.inet.fi jani@hynda.(none) jani@hynda.mysql.fi +jani@ibmlab.site jani@janikt.pp.saunalahti.fi jani@rhols221.adsl.netsonic.fi jani@rhols221.arenanet.fi diff --git a/sql/hostname.cc b/sql/hostname.cc index 47960275e3a..ec5c6f29a27 100644 --- a/sql/hostname.cc +++ b/sql/hostname.cc @@ -207,13 +207,17 @@ my_string ip_to_hostname(struct in_addr *in, uint *errors) { VOID(pthread_mutex_unlock(&LOCK_hostname)); DBUG_PRINT("error",("gethostbyaddr returned %d",errno)); - goto err; + + if (errno == HOST_NOT_FOUND || errno == NO_DATA) + add_wrong_ip(in); /* only cache negative responses, not failures */ + + DBUG_RETURN(0); } if (!hp->h_name[0]) // Don't allow empty hostnames { VOID(pthread_mutex_unlock(&LOCK_hostname)); DBUG_PRINT("error",("Got an empty hostname")); - goto err; + goto add_wrong_ip_and_return; } if (!(name=my_strdup(hp->h_name,MYF(0)))) { @@ -240,7 +244,7 @@ my_string ip_to_hostname(struct in_addr *in, uint *errors) { DBUG_PRINT("error",("mysqld doesn't accept hostnames that starts with a number followed by a '.'")); my_free(name,MYF(0)); - goto err; + goto add_wrong_ip_and_return; } } @@ -256,7 +260,7 @@ my_string ip_to_hostname(struct in_addr *in, uint *errors) DBUG_PRINT("error",("Couldn't verify hostname with gethostbyname")); my_free(name,MYF(0)); -err: +add_wrong_ip_and_return: add_wrong_ip(in); DBUG_RETURN(0); }