diff options
author | irungentoo <irungentoo@gmail.com> | 2014-06-07 19:47:00 -0400 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2014-06-07 19:47:00 -0400 |
commit | 99572e944a7c466304e45b755e40a8dbb7717b4b (patch) | |
tree | 81bc47c3580e90e54f491c15c0ae22322b1a470c /toxcore | |
parent | 550fced157294fdd8045f9bb27d13c38fc8b6d87 (diff) |
IN6_ARE_ADDR_EQUAL was used only once, replaced it.
Diffstat (limited to 'toxcore')
-rw-r--r-- | toxcore/network.c | 2 | ||||
-rw-r--r-- | toxcore/network.h | 12 |
2 files changed, 1 insertions, 13 deletions
diff --git a/toxcore/network.c b/toxcore/network.c index b6bc8e18..647940c3 100644 --- a/toxcore/network.c +++ b/toxcore/network.c | |||
@@ -658,7 +658,7 @@ int ip_equal(IP *a, IP *b) | |||
658 | if (a->family == AF_INET) | 658 | if (a->family == AF_INET) |
659 | return (a->ip4.in_addr.s_addr == b->ip4.in_addr.s_addr); | 659 | return (a->ip4.in_addr.s_addr == b->ip4.in_addr.s_addr); |
660 | else if (a->family == AF_INET6) | 660 | else if (a->family == AF_INET6) |
661 | return IN6_ARE_ADDR_EQUAL(&a->ip6.in6_addr, &b->ip6.in6_addr); | 661 | return a->ip6.uint64[0] == b->ip6.uint64[0] && a->ip6.uint64[1] == b->ip6.uint64[1]; |
662 | else | 662 | else |
663 | return 0; | 663 | return 0; |
664 | } | 664 | } |
diff --git a/toxcore/network.h b/toxcore/network.h index 9058a341..bf14f319 100644 --- a/toxcore/network.h +++ b/toxcore/network.h | |||
@@ -52,18 +52,6 @@ typedef unsigned int sock_t; | |||
52 | /* sa_family_t is the sockaddr_in / sockaddr_in6 family field */ | 52 | /* sa_family_t is the sockaddr_in / sockaddr_in6 family field */ |
53 | typedef short sa_family_t; | 53 | typedef short sa_family_t; |
54 | 54 | ||
55 | #ifndef IN6_ARE_ADDR_EQUAL | ||
56 | #ifdef IN6_ADDR_EQUAL | ||
57 | #define IN6_ARE_ADDR_EQUAL(a,b) IN6_ADDR_EQUAL(a,b) | ||
58 | #else | ||
59 | #define IN6_ARE_ADDR_EQUAL(a,b) \ | ||
60 | ((((__const uint32_t *) (a))[0] == ((__const uint32_t *) (b))[0]) \ | ||
61 | && (((__const uint32_t *) (a))[1] == ((__const uint32_t *) (b))[1]) \ | ||
62 | && (((__const uint32_t *) (a))[2] == ((__const uint32_t *) (b))[2]) \ | ||
63 | && (((__const uint32_t *) (a))[3] == ((__const uint32_t *) (b))[3])) | ||
64 | #endif | ||
65 | #endif | ||
66 | |||
67 | #ifndef EWOULDBLOCK | 55 | #ifndef EWOULDBLOCK |
68 | #define EWOULDBLOCK WSAEWOULDBLOCK | 56 | #define EWOULDBLOCK WSAEWOULDBLOCK |
69 | #endif | 57 | #endif |