Commit e20f1ec3 authored by Sergei Golubchik's avatar Sergei Golubchik

mysql_client_test: don't use 192.168.0.1

the test expects 192.168.0.1 not to resolve to anything.
this is a fragile assumption. use 127.0.0.2 instead
(which only marginally better)
parent bb8e99fd
......@@ -19678,7 +19678,7 @@ static void test_proxy_header_tcp(const char *ipaddr, int port)
size_t header_lengths[2];
int i;
// normalize IPv4-mapped IPv6 addresses, e.g ::ffff:192.168.0.1 to 192.168.0.1
// normalize IPv4-mapped IPv6 addresses, e.g ::ffff:127.0.0.2 to 127.0.0.2
const char *normalized_addr= strncmp(ipaddr, "::ffff:", 7)?ipaddr : ipaddr + 7;
memset(&v2_header, 0, sizeof(v2_header));
......@@ -19736,6 +19736,7 @@ static void test_proxy_header_tcp(const char *ipaddr, int port)
mytest(result);
row = mysql_fetch_row(result);
addrlen = strlen(normalized_addr);
printf("%.*s %.*s\n", (int)addrlen, row[0], (int)addrlen, normalized_addr);
DIE_UNLESS(strncmp(row[0], normalized_addr, addrlen) == 0);
DIE_UNLESS(atoi(row[0] + addrlen+1) == port);
mysql_close(m);
......@@ -19804,9 +19805,9 @@ static void test_proxy_header_ignore()
static void test_proxy_header()
{
test_proxy_header_tcp("192.168.0.1",3333);
test_proxy_header_tcp("127.0.0.2",3333);
test_proxy_header_tcp("2001:db8:85a3::8a2e:370:7334",2222);
test_proxy_header_tcp("::ffff:192.168.0.1",2222);
test_proxy_header_tcp("::ffff:127.0.0.2",2222);
test_proxy_header_localhost();
test_proxy_header_ignore();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment