diff --git a/test/ares-test-live.cc b/test/ares-test-live.cc index bbf9b4e5..94b4921e 100644 --- a/test/ares-test-live.cc +++ b/test/ares-test-live.cc @@ -157,7 +157,9 @@ TEST_P(DefaultChannelModeTest, LiveGetLocalhostByAddrV4) { TEST_P(DefaultChannelModeTest, LiveGetLocalhostByAddrV6) { HostResult result; - struct in6_addr addr = in6addr_loopback; + struct in6_addr addr; + memset(&addr, 0, sizeof(addr)); + addr.s6_addr[15] = 1; // in6addr_loopback ares_gethostbyaddr(channel_, &addr, sizeof(addr), AF_INET6, HostCallback, &result); Process(); EXPECT_TRUE(result.done_); diff --git a/test/ares-test.cc b/test/ares-test.cc index 96c80b9f..b86cba42 100644 --- a/test/ares-test.cc +++ b/test/ares-test.cc @@ -180,7 +180,7 @@ MockServer::MockServer(int family, int port, int tcpport) struct sockaddr_in6 addr; memset(&addr, 0, sizeof(addr)); addr.sin6_family = AF_INET6; - addr.sin6_addr = in6addr_any; + memset(&addr.sin6_addr, 0, sizeof(addr.sin6_addr)); // in6addr_any addr.sin6_port = htons(tcpport_); int tcprc = bind(tcpfd_, (struct sockaddr*)&addr, sizeof(addr)); EXPECT_EQ(0, tcprc) << "Failed to bind AF_INET6 to TCP port " << tcpport_;