summaryrefslogtreecommitdiff
path: root/sql/hostname.cc
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2018-02-10 00:00:10 +0000
committerVladislav Vaintroub <wlad@mariadb.com>2018-02-10 00:00:10 +0000
commit17c9ed672588b4b2c355efbab4329ff6b611dd78 (patch)
treed2535f538a4f3b86fe0c698818f3ee8fb05b17d5 /sql/hostname.cc
parente3cf577948855a31949923544106787bbc253630 (diff)
downloadmariadb-git-17c9ed672588b4b2c355efbab4329ff6b611dd78.tar.gz
Fix perfschema tests in debug mode.
Correctly initialize fake IPs.
Diffstat (limited to 'sql/hostname.cc')
-rw-r--r--sql/hostname.cc17
1 files changed, 12 insertions, 5 deletions
diff --git a/sql/hostname.cc b/sql/hostname.cc
index 92888b737b4..2d39a8bb03d 100644
--- a/sql/hostname.cc
+++ b/sql/hostname.cc
@@ -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];