===== sql/hostname.cc 1.20 vs edited ===== --- 1.20/sql/hostname.cc 2003-01-27 22:38:22 -08:00 +++ edited/sql/hostname.cc 2005-03-04 14:34:32 -08:00 @@ -175,7 +175,8 @@ &tmp_errno))) { DBUG_PRINT("error",("gethostbyname_r returned %d",tmp_errno)); - add_wrong_ip(in); + if(tmp_errno == HOST_NOT_FOUND || tmp_errno == NO_DATA) + add_wrong_ip(in); /* only cache negative responses, not failures */ my_gethostbyname_r_free(); DBUG_RETURN(0); } @@ -198,13 +199,17 @@ { 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)))) { @@ -231,7 +236,7 @@ { 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; } } @@ -247,7 +252,7 @@ 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); }