diff options
-rw-r--r-- | toxcore/network.c | 6 | ||||
-rw-r--r-- | toxcore/network.h | 9 |
2 files changed, 14 insertions, 1 deletions
diff --git a/toxcore/network.c b/toxcore/network.c index 49e1726c..af9e8cdd 100644 --- a/toxcore/network.c +++ b/toxcore/network.c | |||
@@ -28,6 +28,10 @@ | |||
28 | #include "network.h" | 28 | #include "network.h" |
29 | #include "util.h" | 29 | #include "util.h" |
30 | 30 | ||
31 | #ifndef IPV6_V6ONLY | ||
32 | #define IPV6_V6ONLY 27 | ||
33 | #endif | ||
34 | |||
31 | /* return current UNIX time in microseconds (us). */ | 35 | /* return current UNIX time in microseconds (us). */ |
32 | uint64_t current_time(void) | 36 | uint64_t current_time(void) |
33 | { | 37 | { |
@@ -407,7 +411,7 @@ Networking_Core *new_networking(IP ip, uint16_t port) | |||
407 | #ifdef LOGGING | 411 | #ifdef LOGGING |
408 | res = | 412 | res = |
409 | #endif | 413 | #endif |
410 | setsockopt(temp->sock, IPPROTO_IPV6, IPV6_ADD_MEMBERSHIP, &mreq, sizeof(mreq)); | 414 | setsockopt(temp->sock, IPPROTO_IPV6, IPV6_ADD_MEMBERSHIP, (char*)&mreq, sizeof(mreq)); |
411 | #ifdef LOGGING | 415 | #ifdef LOGGING |
412 | 416 | ||
413 | if (res < 0) { | 417 | if (res < 0) { |
diff --git a/toxcore/network.h b/toxcore/network.h index 4432baed..f6256ab4 100644 --- a/toxcore/network.h +++ b/toxcore/network.h | |||
@@ -40,6 +40,15 @@ | |||
40 | #include <ws2tcpip.h> | 40 | #include <ws2tcpip.h> |
41 | 41 | ||
42 | typedef unsigned int sock_t; | 42 | typedef unsigned int sock_t; |
43 | typedef unsigned int sa_family_t; | ||
44 | |||
45 | #ifndef IN6_ARE_ADDR_EQUAL | ||
46 | #define IN6_ARE_ADDR_EQUAL(a,b) \ | ||
47 | ((((__const uint32_t *) (a))[0] == ((__const uint32_t *) (b))[0]) \ | ||
48 | && (((__const uint32_t *) (a))[1] == ((__const uint32_t *) (b))[1]) \ | ||
49 | && (((__const uint32_t *) (a))[2] == ((__const uint32_t *) (b))[2]) \ | ||
50 | && (((__const uint32_t *) (a))[3] == ((__const uint32_t *) (b))[3])) | ||
51 | #endif | ||
43 | 52 | ||
44 | #else // Linux includes | 53 | #else // Linux includes |
45 | 54 | ||