summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/sql_parse.cc5
-rw-r--r--vio/viosocket.c2
-rw-r--r--vio/viossl.c2
3 files changed, 5 insertions, 4 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 1aeb158dc11..efb534ed439 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -501,6 +501,9 @@ check_connections(THD *thd)
thd->thread_id));
DBUG_PRINT("info",("New connection received on %s",
vio_description(net->vio)));
+
+ vio_in_addr(net->vio,&thd->remote.sin_addr);
+
if (!thd->host) // If TCP/IP connection
{
char ip[30];
@@ -521,7 +524,6 @@ check_connections(THD *thd)
#endif
if (!(specialflag & SPECIAL_NO_RESOLVE))
{
- vio_in_addr(net->vio,&thd->remote.sin_addr);
thd->host=ip_to_hostname(&thd->remote.sin_addr,&connect_errors);
/* Cut very long hostnames to avoid possible overflows */
if (thd->host)
@@ -543,7 +545,6 @@ check_connections(THD *thd)
DBUG_PRINT("info",("Host: %s",thd->host));
thd->host_or_ip= thd->host;
thd->ip= 0;
- bzero((char*) &thd->remote,sizeof(struct sockaddr));
}
vio_keepalive(net->vio, TRUE);
diff --git a/vio/viosocket.c b/vio/viosocket.c
index ad156fc33bf..1b6f46c57cf 100644
--- a/vio/viosocket.c
+++ b/vio/viosocket.c
@@ -295,7 +295,7 @@ void vio_in_addr(Vio *vio, struct in_addr *in)
{
DBUG_ENTER("vio_in_addr");
if (vio->localhost)
- bzero((char*) in, sizeof(*in)); /* This should never be executed */
+ bzero((char*) in, sizeof(*in));
else
*in=vio->remote.sin_addr;
DBUG_VOID_RETURN;
diff --git a/vio/viossl.c b/vio/viossl.c
index a489cb98f98..07713c83763 100644
--- a/vio/viossl.c
+++ b/vio/viossl.c
@@ -259,7 +259,7 @@ void vio_ssl_in_addr(Vio *vio, struct in_addr *in)
{
DBUG_ENTER("vio_ssl_in_addr");
if (vio->localhost)
- bzero((char*) in, sizeof(*in)); /* This should never be executed */
+ bzero((char*) in, sizeof(*in));
else
*in=vio->remote.sin_addr;
DBUG_VOID_RETURN;