Commit 17c9ed67 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

Fix perfschema tests in debug mode.

Correctly initialize fake IPs.
parent e3cf5779
......@@ -701,11 +701,13 @@ int ip_to_hostname(struct sockaddr_storage *ip_storage,
static struct addrinfo debug_addr_info[2];
/* Simulating ipv4 192.0.2.126 */
debug_addr= & debug_sock_addr[0];
inet_pton(AF_INET,"192.0.2.126",debug_addr);
debug_addr->sin_family= AF_INET;
inet_pton(AF_INET,"192.0.2.126", &debug_addr->sin_addr);
/* Simulating ipv4 192.0.2.127 */
debug_addr= & debug_sock_addr[1];
inet_pton(AF_INET,"192.0.2.127",debug_addr);
debug_addr->sin_family= AF_INET;
inet_pton(AF_INET,"192.0.2.127", &debug_addr->sin_addr);
debug_addr_info[0].ai_addr= (struct sockaddr*) & debug_sock_addr[0];
debug_addr_info[0].ai_addrlen= sizeof (struct sockaddr_in);
......@@ -731,11 +733,13 @@ int ip_to_hostname(struct sockaddr_storage *ip_storage,
static struct addrinfo debug_addr_info[2];
/* Simulating ipv4 192.0.2.5 */
debug_addr= & debug_sock_addr[0];
inet_pton(AF_INET,"192.0.2.5",debug_addr);
debug_addr->sin_family= AF_INET;
inet_pton(AF_INET,"192.0.2.5", &debug_addr->sin_addr);
/* Simulating ipv4 192.0.2.4 */
debug_addr= & debug_sock_addr[1];
inet_pton(AF_INET,"192.0.2.5",debug_addr);
debug_addr->sin_family= AF_INET;
inet_pton(AF_INET,"192.0.2.4", &debug_addr->sin_addr);
debug_addr_info[0].ai_addr= (struct sockaddr*) & debug_sock_addr[0];
debug_addr_info[0].ai_addrlen= sizeof (struct sockaddr_in);
......@@ -768,13 +772,16 @@ int ip_to_hostname(struct sockaddr_storage *ip_storage,
static struct addrinfo debug_addr_info[2];
/* Simulating ipv6 2001:DB8::6:7E */
debug_addr= & debug_sock_addr[0];
debug_addr->sin6_family= AF_INET6;
ip6= & debug_addr->sin6_addr;
inet_pton(AF_INET6,"2001:DB8::6:7E",ip6);
/* Simulating ipv6 2001:DB8::6:7F */
debug_addr= & debug_sock_addr[1];
debug_addr->sin6_family= AF_INET6;
ip6= & debug_addr->sin6_addr;
inet_pton(AF_INET6,"2001:DB8::6:7E",ip6);
inet_pton(AF_INET6,"2001:DB8::6:7F",ip6);
debug_addr_info[0].ai_addr= (struct sockaddr*) & debug_sock_addr[0];
debug_addr_info[0].ai_addrlen= sizeof (struct sockaddr_in6);
debug_addr_info[0].ai_next= & debug_addr_info[1];
......
......@@ -979,7 +979,7 @@ static int check_connection(THD *thd)
struct in_addr *ip4= &((struct sockaddr_in *) sa)->sin_addr;
/* See RFC 5737, 192.0.2.0/24 is reserved. */
const char* fake= "192.0.2.4";
inet_pton(AF_INET,fake, &ip4);
inet_pton(AF_INET,fake, ip4);
strcpy(ip, fake);
peer_rc= 0;
}
......
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