summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--auto_tests/network_test.c6
-rw-r--r--toxcore/network.c4
2 files changed, 5 insertions, 5 deletions
diff --git a/auto_tests/network_test.c b/auto_tests/network_test.c
index e3b47ea2..b88b0e8c 100644
--- a/auto_tests/network_test.c
+++ b/auto_tests/network_test.c
@@ -28,7 +28,7 @@ START_TEST(test_addr_resolv_localhost)
28 int localhost_split = 0; 28 int localhost_split = 0;
29 29
30 IP ip; 30 IP ip;
31 ip_init(&ip, /* ipv6? */ 0); 31 ip_init(&ip, 0); // ipv6enabled = 0
32 32
33 int res = addr_resolve(localhost, &ip, NULL); 33 int res = addr_resolve(localhost, &ip, NULL);
34 34
@@ -39,7 +39,7 @@ START_TEST(test_addr_resolv_localhost)
39 ck_assert_msg(ip.ip4.uint32 == htonl(0x7F000001), "Expected 127.0.0.1, got %s.", inet_ntoa(ip.ip4.in_addr)); 39 ck_assert_msg(ip.ip4.uint32 == htonl(0x7F000001), "Expected 127.0.0.1, got %s.", inet_ntoa(ip.ip4.in_addr));
40 } 40 }
41 41
42 ip_init(&ip, /* ipv6? */ 1); 42 ip_init(&ip, 1); // ipv6enabled = 1
43 res = addr_resolve(localhost, &ip, NULL); 43 res = addr_resolve(localhost, &ip, NULL);
44 44
45 if (!(res & TOX_ADDR_RESOLVE_INET6)) { 45 if (!(res & TOX_ADDR_RESOLVE_INET6)) {
@@ -55,7 +55,7 @@ START_TEST(test_addr_resolv_localhost)
55 } 55 }
56 56
57 if (!localhost_split) { 57 if (!localhost_split) {
58 ip_init(&ip, /* ipv6? */ 1); 58 ip_init(&ip, 1); // ipv6enabled = 1
59 ip.family = AF_UNSPEC; 59 ip.family = AF_UNSPEC;
60 IP extra; 60 IP extra;
61 ip_reset(&extra); 61 ip_reset(&extra);
diff --git a/toxcore/network.c b/toxcore/network.c
index 5ab480b7..c6cf6ed4 100644
--- a/toxcore/network.c
+++ b/toxcore/network.c
@@ -970,9 +970,9 @@ int addr_resolve(const char *address, IP *to, IP *extra)
970 } 970 }
971 971
972 IP ip4; 972 IP ip4;
973 ip_init(&ip4, /* ipv6? */ false); 973 ip_init(&ip4, 0); // ipv6enabled = 0
974 IP ip6; 974 IP ip6;
975 ip_init(&ip6, /* ipv6? */ true); 975 ip_init(&ip6, 1); // ipv6enabled = 1
976 976
977 for (walker = server; (walker != NULL) && !done; walker = walker->ai_next) { 977 for (walker = server; (walker != NULL) && !done; walker = walker->ai_next) {
978 switch (walker->ai_family) { 978 switch (walker->ai_family) {