summaryrefslogtreecommitdiff
path: root/sql/sql_connect.cc
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-01-10 13:54:04 +0100
committerSergei Golubchik <sergii@pisem.net>2013-01-10 13:54:04 +0100
commitbd87fed1dc0caa0720e5a60f0fca1b714c58ac75 (patch)
tree78117460df06878cb987630a95e6304b587a7f39 /sql/sql_connect.cc
parent3c987667d903826e8643f7835f102272ce98987e (diff)
parent2e11ca36f28133c18b72351d176ee2fd7fcbc465 (diff)
downloadmariadb-git-bd87fed1dc0caa0720e5a60f0fca1b714c58ac75.tar.gz
5.1 merge
Diffstat (limited to 'sql/sql_connect.cc')
-rw-r--r--sql/sql_connect.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/sql/sql_connect.cc b/sql/sql_connect.cc
index 95e10648402..511fbe07459 100644
--- a/sql/sql_connect.cc
+++ b/sql/sql_connect.cc
@@ -885,6 +885,19 @@ static int check_connection(THD *thd)
my_error(ER_BAD_HOST_ERROR, MYF(0));
return 1;
}
+ /* BEGIN : DEBUG */
+ DBUG_EXECUTE_IF("addr_fake_ipv4",
+ {
+ struct sockaddr *sa= (sockaddr *) &net->vio->remote;
+ sa->sa_family= AF_INET;
+ struct in_addr *ip4= &((struct sockaddr_in *)sa)->sin_addr;
+ /* See RFC 5737, 192.0.2.0/23 is reserved */
+ const char* fake= "192.0.2.4";
+ ip4->s_addr= inet_addr(fake);
+ strcpy(ip, fake);
+ };);
+ /* END : DEBUG */
+
if (!(thd->main_security_ctx.ip= my_strdup(ip,MYF(MY_WME))))
return 1; /* The error is set by my_strdup(). */
thd->main_security_ctx.host_or_ip= thd->main_security_ctx.ip;